Tetris Figures Problem

I am only a mathematical amateur, but have been bothered by a problem for a long time. In the game Tetris, you have figures made by squares and there exist five really unique figures which cannot not be made congruent by mirroring or rotation.

enter image description here

Now my question is, why do exactly five figures exist? Is there a formula how to calculate the number of unique figures for the general case (x figures with y equal sides)? The requirement is that all elements of the figure are connected with at least one other element on a whole border.

I would be thankful for answers and links.


Solution 1:

For all the squares to be connected, we need to consider three cases:-

($1$) $4$ squares in $1$ row: $1$ way = $\large {4 \choose 0}$

($2$) $3$ squares in $1$st row, $1$ square in $2$nd row : $2$ ways = $\large {3 \choose 1}-1$ (the minus $1$ is due to obtaining a shape that is $180^\circ$ rotation of an existing shape - the L shape)

($3$) $2$ squares in $1$st row, $2$ squares in $2$nd row : $2$ ways = $\large {2 \choose 2}+1$ - the $1$ term represents the maximum shift of one of the rows relative to the other such that all squares remain connected, and there are no repeated shapes due to a $180^\circ$ rotation.

Thus there are $5$ unique figures.