The Mathematics of Tetris

My colleague, Ido Segev, pointed out that there is a problem with most of the elegant proofs here - Tetris is not just a problem of tiling a rectangle.

Below is his proof that the conjecture is, in fact, false.

Counter proof


There is in fact a straightforward invariant that works in this circumstance - the 'classic' invariant for tiling problems. Checkerboard-color the grid, and note that all other pieces (the $\color{cyan}{\text{I}}$, $\color{green}{\text{S}}$s, $\color{blue}{\text{J}}$s, and the square) take up an equal number of black and white squares in all orientations; by contrast, the $\color{purple}{\text{T}}$ always takes up three squares of one color and one square of the other. This implies that for any number of rows (each of which have an equal number of squares of each color) to be perfectly filled, an even number of $\color{purple}{\text{T}}$ pieces must be used.

EDIT: As pointed out by Gilad, this approach only solves the 'static' issue of tiling a rectangle with tetrominoes including the $\color{purple}{\text{T}}$, not the 'dynamic' region-filling that Tetris provides for; see his excellent solution for why this matters if intermediate rows can be cleared and partial-pieces left behind.


Edited to add: The following is only correct if you build up your four lines from 0 (or if you only eliminate four rows at once) which is the way to get maximal points in Tetris. For a counterexample in the general case of clearing the screen in any way you like, see (and vote for) the answer by Gilad Naor

My original answer:

Color the squares black and white in a chessboard fashion and regard the parity of black squares. This is your invariant.

(The $10\times 4$ rectangle has an even number of black squares, each $\color{purple}{\text{T}}$-piece has $3$ or $1$ black squares and all other pieces clearly have $2$ black squares, so not only do you have an even number of $\color{purple}{\text{T}}$s, you have the same number of predominantly black $\color{purple}{\text{T}}$s and predominantly white $\color{purple}{\text{T}}$s.)

There is a similar further relation for the combined number of $\color{orange}{\text{L}}$s and $\color{blue}{\text{J}}$s:

The number of $\color{orange}{\text{L}}$s, $\color{blue}{\text{J}}$s and $\color{purple}{\text{T}}$s with a horizontal line of three squares is even.

Instead of the checkboard colouring, you just look at the alternate coloring of whole rows and see that these pieces are exactly the ones that contribute an odd number of black squares.