The Simple Proof of the Tetris Lamp 11 Jan 2015 // 3 minute read
I received this lamp as a birthday present last year. Its a great little thing - you can move the individual Tetris pieces around to form whatever shape you wish, and once connected they all individually light up thanks to conducting strips around the edges of each segment.
Leaving the obvious Tetris connection behind for a second though, one thing thats always irritated me is my inability to build the lamp into a clean rectangle. No matter how hard I tried I always ended up with a stray block sticking out of the side, and another missing on top, or some other irritating imperfect combination.
The lamp itself, in a standard irritating setup
This irritation extended to many who have visited my room since the lamp became a fixture there. A friend of mine in particular spent an evening shuffling the pieces around into various positions, refusing to accept that there was someone out there with such a twisted mind that theyd happily design the pieces such that they didnt fit together in a clean way. Surely not.
He was inevitably unsuccessful in his endeavours, and Ive since accepted that the lamp probably cant be constructed in such a way since the pieces just look like they wont fit together cleanly. Thats not a particularly satisfactory conclusion however, and it definitely didnt quell my compulsive interest in the task.
However, whilst having drinks in my room last night, another friend (who hadnt been exposed to the lamps tortuous attraction before) glanced at the construction on my desk, thought for a few minutes and exclaimed that he had a proof that it couldnt be formed into a rectangle. After hearing the details, the solution is so simple and elegant that I thought Id share it here.
The lamp itself is composed of 7 individual pieces, containing a total of 28 squares. Therefore, assuming we can indeed form it into a rectangle, it would have to be 7x4 or 14x2 squares in size. Im using the former case here simply because its a more natural shape, however this proof applies equally as well to the latter. Now imagine that we label each of these squares with a colour - either black or white - such that they form a checkerboard pattern as shown above. Notice that the number of black squares must be equal to the number of white, a property well exploit.
So thats 14 black squares, and 14 white. Looking at each of the pieces individually, the issue with our assumption quickly appears.
As shown above, for pieces 1-6, the number of black squares within the piece is equal to the number of white. Clearly which squares are black and which are white depends on the actual placement of the piece within the rectangle, but the shapes themselves dictate the count of each colour (since adjacent squares must be different colours).
However, piece 7 disrupts the trend. Irrelevant of how its located, it must be comprised of 3 squares of one colour, and 1 of the other, a property that is purely down to its shape.
So, taking that into account along with the other 6 pieces, in total theyre comprised of 13 squares of one colour, and 15 of the other, with no assumptions about how theyre located within the rectangle. Ah. We needed 14 of each, and since weve just shown that we cant get that, our original assumption is overturned and our proof is complete.
The proof itself is so simple that Im slightly disappointed I didnt notice it myself sooner. However Im glad that no more time will be wasted mindlessly moving around the pieces hoping for a breakthrough.
Maybe now I can shift my irritation from the lamp itself to whoever designed it to possess such a property.
Follow me at @jack_morris_ to be notified about more posts like this.
EDIT: This has received a much larger response than I ever anticipated, so thanks to everyone whos read and shared this. You can follow the discussion on Hacker News, /r/math and /r/programming. This article was also the cover story for Hacker Monthly Issue 58, which provided the cover photo.