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. 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.
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.
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 :)
"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"...
"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."
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.
Here's an example. The trick I used was creating the extra block and the hole on the same side (so, not like the pic). With the pieces numbered as in the post:
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.
The proof in the article is a proof by contradiction. Having equal numbers of each colored square is a necessary but not sufficient condition to form a rectangle.
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.
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.
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.
> 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.
> 1) Why limit yourself to 4x7? The 1988 NES version of Tetris is 10 units wide.
Presumably, the objective is to arrange the tetriminos into a pleasing rectangle shape. Unfortunately, the factors of 28 are 1, 2, 4, 7, 14 and 28, so 4x7 is the closest you can get to a square, and 2x14 has a similar problem of having the same number of 'white' squares as 'black' squares. The closest one can get is 5x6 with two holes removed.
Why? A full row in tetris is removed. To someone who knows the game, leaving a hole in each row would be more pleasing. Aesthetically I'd also find it more interesting, but that's an aside.
This is not an exercise in "valid" tetris configurations, per se. It's a matter of arranging these blocks to make a clean square - plain and simple. The "malicious design" is tongue-in-cheek.
Every engineer who has this lamp on their desk has thought of this.
> 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.)
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..., 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.
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?
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.
Every even x even rectangle has equal dark and light squares.
Every even x odd rectangle has equal dark and light squares.
Every odd x odd rectangle has one more odd then even, or one more even then odd. (1x1 square is obvious, any odd x odd rectangle can be reduced to 1x1 square by removing only odd x even rectangle.)
Since the T piece creates a odd-even difference of 2, any number of other tetris pieces (including repeats) that only contains a single T piece can never form a rectangle with no holes.
Interestingly, his account is rather different than that on wikipedia 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.
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.
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-...
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.
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.
I vaguely remember someone having proved Tetris NP-hard but I think the problem wasn't filling a fixed shape but rather maximizing the number of erased lines given a board and an upcoming sequence of pieces.
All this from memory, so it might be totally wrong.
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...
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.
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.
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.
I would think rotating this sideways and placing the troublesome T on top would give a pleasingly neat and symmetrical shape, if not a rectangular one.
The power goes into the bottom piece so that gravity ensures good electrical connection between the pieces. I imagine here may still be a solution but your 4444 piece needs to be the base.
(on second thoughts, you could probably get away with rotating your solution if you're willing to forfeit the '4 width' condition)
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. 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.