
The Simple Proof of the Tetris Lamp - jpeggg
http://jackm.co.uk/posts/2015/01/11/the-simple-proof-of-the-tetris-lamp/
======
jones1618
Terrific reasoning! That same "checkerboard coloring" strategy is used a lot
for figuring out tiling problems.

It is too bad the lamp wasn't made of pentominoes (the 12 Tetris-like pieces
with 5 squares vs. your tetrominoes with 4 squares.). See
[http://en.wikipedia.org/wiki/Pentomino](http://en.wikipedia.org/wiki/Pentomino).
There are 2339 ways to form these into a perfect 6x10 rectangle (more if you
include rotations and reflections).

FYI: The creator of Tetris actually got the idea for his game pieces from
Solomon W. Golomb's book "Polyominoes" that introduced all kinds of variations
on tiling puzzles and proofs. Chapter one starts using checkerboard reasoning
right off the bat. So, you are in good company.

------
megamark16
I came here looking for a link to someplace where I can buy this lamp. Since
no one has posted such a link yet, here it is:

[http://www.thinkgeek.com/product/f034/](http://www.thinkgeek.com/product/f034/)

(I realize we all have access to Google, but if I save 100 people 10 seconds,
then I just saved 1000 seconds!)

~~~
martin_
The article links to it in the first sentence also:
[http://www.amazon.co.uk/Lychee-Tetris-Constructible-Three-
di...](http://www.amazon.co.uk/Lychee-Tetris-Constructible-Three-dimensional-
squares/dp/B00JZGD930)

~~~
toast0
If only it were underlined so we would have known it was a link?

~~~
debacle
Is that responsive?

------
mjs
Similar to:

[https://en.wikipedia.org/wiki/Mutilated_chessboard_problem](https://en.wikipedia.org/wiki/Mutilated_chessboard_problem)

~~~
gus_massa
Yes. Every time you get a problem with a rectangle table, you must paint it
like a chessboard. If that is not enough to find the solution, you must try to
think.

A small technical detail, dew to professional deformation. The article says
that the numbers of squares of each color must be the same, but that only
happens if the total number is even, like in this case 13+15=28. If the total
number of squares is odd, then you get one extra square of one of the colors.

~~~
pja
Minor derail - I know I mistype 'their' as 'they're' and likewise for other
similar homonym pairs all the time, but due -> dew is a particularly nice
example of the genre :)

~~~
theoh
"making do" -> "making due" seems to be relatively common among US English
speakers, too. In British pronunciation dew also sounds the same as due but
both differ from the US "do"...

------
pmelendez
>"Maybe now I can shift my irritation from the lamp itself to whoever designed
it to possess such a property. "

I wouldn't be mad at the designer. That person designed a lamp and proposed an
impossible puzzle that at first glance looked plausible.

It is the best way to troll people... ever!

~~~
runn1ng
[http://en.wikipedia.org/wiki/File:15-puzzle-
loyd.svg](http://en.wikipedia.org/wiki/File:15-puzzle-loyd.svg)

:)

~~~
Russell91
"Some later interest was fuelled by Loyd offering a $1,000 prize for anyone
who could provide a solution for achieving a particular combination specified
by Loyd, namely reversing the 14 and 15.[13] This was impossible, as had been
shown over a decade earlier by Johnson & Story (1879), as it required a
transformation from an even to an odd combination."

------
davecap1
That's exactly how they get you to buy TWO lamps! :)

~~~
rndn
Is that really obvious? I think the checkerboard pattern only says something
about the neighborhoods of the pieces and the amounts of tiles of each color
used, not whether there exists is a rectangle configuration.

~~~
rmetzler
If you buy 2 lamps, you've got 2 of all the 7 pieces. Piece 7 (the T-shaped
piece) is doubled and you can switch the pattern for the second set. You'll
have 15x color A and 13x color B in the first set and 13x color A and 15x
color B in the second set. I'm pretty sure this would enable you to create a
rectangular lamp.

~~~
nemetroid
Having the same number of both colours is not sufficient. 14 Z pieces will
give you 28 of each color, but you can't make a rectangular lamp (of any size)
from only Z pieces.

~~~
eterm
Not in 2D, but you can in 3D!

edit: Actually I'm not sure my previous statement was true. You can make it
more pleasing such as this though:
[http://nterm.co.uk/content/images/tetris.png](http://nterm.co.uk/content/images/tetris.png)

~~~
penguat
<nitpick>rectangle specifies 2d</nitpick> I believe you could form a hollow
cuboid, but I don't think you could complete a solid cuboid.

------
lern_too_spel
Your friend read Martin Gardner's aha! Insight, which has exactly this proof
in it and is a popular book for young mathematical puzzle enthusiasts.

------
jimmaswell
Here's one nice-looking configuration I found. You seem to be implicitly
assuming you can only have a depth of one unit but that's possibly an
unnecessary limitation. I'm working on seeing if some kind of perfect cuboid
can be made.

[https://3dwarehouse.sketchup.com/model.html?id=u2d94f70c-682...](https://3dwarehouse.sketchup.com/model.html?id=u2d94f70c-6825-4fed-
bc3d-bfc700d99eec) (there's a webgl viewer)

~~~
osense
I'm not sure, but i think the lamp wouldn't work anymore - it seems like the
front and back metal strips might have different polarity.

~~~
jimmaswell
Might not light up anymore, yeah. Maybe with some rewiring.

------
pharke
A few things:

1) Why limit yourself to 4x7? The 1988 NES version of Tetris is 10 units wide.

2) There isn't any malicious design, you simply get 1 of each shape (one of
the L pieces in the author's photo is reflected, should be turned the other
way).

3) In Tetris, a full row is removed immediately so having a complete
rectangular shape that occupies the full available width is unrealistic.

Pedantry aside, you'd have to ask Alexey Pajitnov if there was any devilry
involved in choosing the shapes since the makers of the lamp have faithfully
included a full set. Also, I personally prefer the aesthetic of a lamp
arranged in such a way as to leave a hole in each row rather than a plain wall
of coloured squares.

~~~
vinceguidry
> Pedantry aside, you'd have to ask Alexey Pajitnov if there was any devilry
> involved in choosing the shapes since the makers of the lamp have faithfully
> included a full set.

No devilry, there's just only so many ways you can connect four squares
together to make a shape.

[http://en.wikipedia.org/wiki/Tetromino](http://en.wikipedia.org/wiki/Tetromino)

~~~
pharke
He could have chosen pentominoes instead.

[http://en.wikipedia.org/wiki/Pentomino](http://en.wikipedia.org/wiki/Pentomino)

------
jimmaswell
You could rotate some pieces such that they're partially jutting out of the
back of the lamp, which might make it possible.

------
rndn
Isn't the lamp simply designed to contain all of the seven types of Tetris
pieces?

------
PhasmaFelis
> _Maybe now I can shift my irritation from the lamp itself to whoever
> designed it to possess such a property._

There's no "design" involved in the choice of pieces: there are seven
different ways to connect four squares in an orthogonal grid, "tetrominoes",
assuming you allow for pieces to be rotated but not reflected. Tetris uses all
seven, and so does the lamp. (Although the lamp's design apparently allows
pieces to be reflected, i.e. rotated outside of the grid, so the S and Z
pieces can be considered the same, as can L and J.)

------
jakethedog
You can make a rectangle as long as you don't use all of the pieces (maybe
that is part of the puzzle?). For example, from
[http://www.amazon.co.uk/Lychee-Tetris-Constructible-Three-
di...](http://www.amazon.co.uk/Lychee-Tetris-Constructible-Three-dimensional-
squares/dp/B00JZGD930), remove the purple piece, shift the red piece to the
left one space and flip it, then place the blue piece vertically on the right
hand side.

~~~
peeters
The argument in the article was that it's the purple piece (the "T") that is
the problem (or least that makes the proof trivial). Can you make a rectangle
with a subset that includes the T?

~~~
throwaway183839
Theorem: No.

Proof: Any rectangle made of Tetris pieces must have an even number of squares
(in fact, a multiple of 4) and hence the same number of black/white squares.
Every Tetris piece except the T has the same number of black/white squares,
hence the T cannot be used in any arrangement of a subset of Tetris pieces
into a rectangle.

------
analyticsjam
I recently read a similar case in Simon Singh's book _Fermat 's Enigma_
[http://www.amazon.com/reader/0385493622?_encoding=UTF8&query...](http://www.amazon.com/reader/0385493622?_encoding=UTF8&query=15)
about the 14-15 puzzle. It was similarly unsolvable and provable the same way.

Interestingly, his account is rather different than that on wikipedia
[http://en.wikipedia.org/wiki/15_puzzle](http://en.wikipedia.org/wiki/15_puzzle)
Singh claims that Sam Lloyd created the puzzle, secretly proved it was
impossible, and offered rewards to anyone who could solve it.

------
a3_nm
A similar trick can be used to solve the following problem: considering a
rectangular grid, is it possible to find a cycle that goes from adjacent
squares to adjacent squares and visits each square exactly once?

Answer (ROT13): Vg qrcraqf ba gur cnevgl bs gur ahzore bs fdhnerf, juvpu
qrcraqf ba jurgure gur qvzrafvbaf bs gur tevq fvqrf ner obgu bqq be abg. Vs
gur ahzore bs fdhnerf vf bqq, gurer nera'g nf znal juvgr fdhnerf nf oynpx
fdhnerf, naq n plpyr zhfg tb sebz juvgr gb oynpx naq sebz oynpx gb juvgr, fb
ab plpyr rkvfgf. Vs vg vf rira, lbh pna rnfvyl pbzr hc jvgu n trareny fpurzr
gb pbafgehpg n plpyr.

~~~
theoh
This is called a Hamiltonian circuit.

------
archagon
Speaking of Tetris proofs, I've had the following problem on the back-burner
for a while: is there a way to check whether an arbitrary contiguous space
comprised of squares can be filled in by tetrominoes? I don't have a math
background so reasoning about it is difficult. Here's the question on
StackOverflow: [http://stackoverflow.com/questions/20083552/tetromino-
space-...](http://stackoverflow.com/questions/20083552/tetromino-space-
filling-need-to-check-if-its-possible)

~~~
jones1618
A lot depends on your specific rules of the game. Does "filled by tetrominoes"
mean you have to use every tetromino at least once? If not, then you can
always fill your contiguous square space with 2x2 tetrominoes. Also, whatever
your rules, it is generally a lot easier to prove it is possible (or not) to
fill a space than find an actual solution.

~~~
archagon
The main rule I'm trying to follow is "as random a tiling as possible". So
unless absolutely necessary, no picking certain pieces just because it's
easier.

The max area I'm having to tile is fairly small (maybe 100x100 at most) so an
actual solution could be fairly easily brute-forced in the last step of the
process. I just want to avoid having to backtrack as much as possible since it
increases the cost substantially.

------
jpeggg
Author here - slightly overwhelmed by the response, but thanks for everyone's
feedback! I never thought so many people would be as interested as I am in the
lamp...

------
ezl
you should turn that link into an affiliate link. i would love to know how
many (other) people also bought that tetris lamp after reading the article.

------
kcanini
What's more annoying is that it has two identical L pieces, instead of having
one that is a mirror-image of the other, as they appear in Tetris.

~~~
bjackman
Well it looks like you can rotate them (I mean in the 3rd dimension not
present in actual Tetris)

------
DominikR
Interesting concept. However, is it really a proof? If I removed piece #7 I'd
have 24 boxes (12 white, 12 black) with which I could theoretically build a
6x4 rectangle, but I don't see how this would be actually possible with those
pieces.

Maybe it only proves the negative, but not that there must be a solution.

Edit: there seems to be a solution for a 4x6 rectangle.

~~~
jpeggg
Exactly that - it's a proof that in this case a solution can't be found.
Having a collection of pieces that doesn't violate the assumption in the
article isn't a sufficient requirement for a solution to exist.

------
qb45
This is to prevent customers from accidentally assembling the lamp in an
unspectacular way.

~~~
asgard1024
Yeah, if you form a perfect rectangle, all the pieces will _disappear_.

------
staffordrj
Very relevant to the video game Sigils of Elohim
[http://store.steampowered.com/app/321480/](http://store.steampowered.com/app/321480/)

------
h_a
Reminds me of Knuth's Dancing Links algorithm:
[http://arxiv.org/pdf/cs/0011047.pdf](http://arxiv.org/pdf/cs/0011047.pdf)

------
robinhouston
If you remove the T piece, is it possible to assemble the other six into a
rectangle? I suspect not, but the checkerboard proof does not suffice for
this.

~~~
pjtr

        rr  Z []      S  LL
        r  ZZ []      SS  L
        r  Z     IIII  S  L
    
        rr  Z [] S  LL
        r  ZZ [] SS  L
        r  Z IIII S  L
    
        rrZ[]SLL
        rZZ[]SSL
        rZIIIISL

~~~
robinhouston
Interesting! I just came here to say that I’ve found a 4x6 packing. I love the
fact you can also do 3x8!

    
    
        ZZLL
        IZZL
        IOOL
        IOOJ
        ISSJ
        SSJJ

------
izzydata
Maybe now you will have to buy a second one in order to make a perfectly
rectangle then get rid of the excess pieces. Genius design.

------
bbcbasic
Wow so weird to see the tetris lamp on HN. One of my 2 year-old's favourite
toys!

------
otikik
So if you ignore piece number 7, can you form a rectangle with the remaining
pieces?

~~~
mistercow
Well, this proof doesn't mean you can't. It's not sufficient to prove that you
can.

~~~
mc808
It can be done, at least if you're allowed to flip one of the 'L' pieces into
a 'J'.

    
    
        1112
        1322
        3324
        3554
        6554
        6664

~~~
tintamarre
:-)
[https://lh4.googleusercontent.com/-dTGQKj2JHKo/VLOsol5kN3I/A...](https://lh4.googleusercontent.com/-dTGQKj2JHKo/VLOsol5kN3I/AAAAAAAAwWM/VJj9ECvKBKo/w878-h1184-no/IMG_20150112_121439.jpg)

------
paxcoder
I would be interested in learning who that friend was, and how he got to the
proof.

------
Spoygg
Nerdgasm :)

