Friday, October 03, 2008

Mathematical Recreations - Tetris

So, I was doodling while watching an episode of The Wire, and I came across this curiousity. Let's look at Tetris pieces, from the popular video game Tetris. Another way to define these is the set of arrangements of four squares where you can travel from one square to any other given square by shared sides. Go ahead and try to think of any that are in that set that aren't in the above picture, except by changes in rotation.

Now, since we're doodling, lets see if you can draw all of the Tetris pieces without taking your pen off the paper, and without crossing over or drawing on top of an existing line. Try it. Well, it works for some, and it doesn't for others.


Now why?! It's a little baffling. But, like any mathematical curiousity, it is made simple by breaking things down into constituent parts. The parts of the pieces where the rules are applied directly is at the joints/crossroads, so let's try to categorize them:


[Below here there are spoilers, beware]

Going from left to right:

One: In all of the pieces, there is no joint with only one line coming in, since this wouldn't be able to make a square.

Two: There are many joints with two lines attached to them, but they have to be at corners, not like I've drawn it above. When you're drawing the continuous line, you come in one way and go out another.

Three: If there are three lines attached to a joint, it must mean that it is an endpoint. See what I mean? Since you can't come in to an intersection more than you go out, and vice versa, then that means you need to stop in the intersection. This will be made clearer when we look at four.

Four: Since there is an even number of lines, you can go in twice and go out twice.

Now, let's number the joints in our Tetris shapes:


See? Only the top two shapes (I wish I had names for them) have exactly two endpoints, the points labeled with a 3. All the other pieces have more than two, and if we're trying to draw a continuous line you can't really stop or start more than twice, can you?

No comments: