From New Scientist #1469, 15th August 1985 [link]
I have a puzzle consisting of eight jigsaw type pieces. Each sturdy piece has been cut from a piece of card 2 inches by 3 inches, by removing one or more of the six 1 inch by 1 inch squares into which it can be divided. For example, one of the pieces is as shown:
The card is the same on both sides and the pieces can be used either way up. For three-quarters of the pieces (like the one shown) this is no advantage, but the other pieces are different when turned over. No two pieces of the puzzle are the same.
The pieces can all be put together to form a large rectangle and, although this can be done by several different arrangements of the pieces, you can only get a large rectangle of one particular size.
What is the size of the large rectangular jigsaw which we can make?
[enigma321]
The published solution is that the rectangle is 3″ × 9″, and I have found 6 different collections of 8 pieces that can be assembled to make rectangles of (only) 3×9. But I have also found 2 different collections of 8 pieces that can be assembled to make rectangles of (only) 2×13.
Here’s my Python program. It takes quite a long time to run to completion (2h28m).
Each of the arrangements found can be broken into sub-rectangles which can be rotated and reassembled in a different order to give a different way to assemble the pieces (and many have non-rectangular sub-shapes that can be removed, re-assembled in a different way to make the same shape and then replaced into the hole to give a new way to assemble the pieces). So it is clear that there are many ways to assemble the pieces into a rectangle of a given size.
It appears, then, that the puzzle is flawed.
Here are my 2 sets of pieces that can be assembled into a 2×13 rectangle (in multiple ways), the pieces correspond to the following named pieces in my program – (specified as (achiral) + (chiral)):
(The chiral pieces are shown in shades of grey, the achiral pieces are coloured. The piece given in the puzzle text is coloured red).
The minimum dimension of any assembled rectangle is 2 as the example piece given (p6 (= U5)) has a minimum dimension of 2, so 2×13 is the only possible rectangle that can be constructed from 8 pieces with a total area of 26.
The collections of pieces that can be assembled in to a 3×9 rectangle (in multiple ways) are given below, the corresponding pieces are:
Again this is the only possible rectangle that can be constructed from 8 pieces with a total area of 27.
There are also 4 different collections of 8 pieces that can be assembled to make rectangles of 2×14 and 4×7, and also 2 different collections of 8 pieces that can be assembled to make rectangles of 3×10 and 5×6.
Having used the code above as a starting point for solving Teaser 2996, I then packaged the code dealing with polyominoes into a separate module, and improved on the packing algorithm using Knuth’s Algorithm X (the same approach used by Polyform Puzzler, and by Brian below).
The improved algorithm can then be used to solve this puzzle, giving a program which runs in only 374ms.
Run: [ @replit ]
I have put my solution here [{broken link removed}] as I needed more control over comment content than WordPress offers.
Brian,
The puzzle as originally formulated says that each piece has at least one of the six squares removed. With that restriction I find only ten pieces, of which three look different when reversed, and a maximum possible area of 35 units. Is there a way to modify the conditions so that “you can get only one size” becomes true?
Yes, my code solves the puzzle but it does more than this as well so I allowed all possible shapes including the one with six squares. But I agree that I should have an option to remove the use of the ‘all six squares’ shape. I’m not sure that I understand your question about the ‘only one size’ criterion.
I think your query amounts to a desire to have a program that gives puzzle solutions directly rather than giving output that has to be inspected to find solutions. If so I have changed the code to provide a ‘puzzle’ mode and a more general one.
Did I express myself badly? Jim showed that there is no unique solution to the puzzle as originally formulated. You have shown that there are lots more solutions if we modify the conditions. I was hoping for a minimum modification that would yield a unique solution, so that we could “rescue” the flawed puzzle.
One way (or two ways really) to rescue the puzzle would be instead of requiring p6 (the “U” pentomino) to be present in the set of 8 pieces, to require either p2 (the “I” tromino) or p3 (the “V” tronimo) to be absent from the set of 8 pieces. (The requirement for 6 achiral and 2 chiral pieces remains). Then there are only solutions for the 3×9 rectangle. (They are the 1st and 2nd of the 3×9 diagrams I gave above – the 1st one omits p3 (orange in the other diagrams) the 2nd one omits p2 (green in the other diagrams)).
I found a site that provides a Python based framework for solving Polyform Puzzles [ http://puzzler.sourceforge.net/ ].
Here is my program modified to use this solver. It’s a bit tricky to control it to solve the multiple rectangles required for this puzzle, but it runs much faster than my original solution. It takes just 2.89s, and finds the same set of solutions I gave above.
Under the hood I think it is using the same Knuth algorithm that Brian used in his solution (although when I tried to run Brian’s program, it didn’t produce any output after consuming 32.5 hours of CPU time, so I stopped it).
For completeness I should point out, that if we don’t require p6 (the “U” pentomino), but do require 6 achiral and 2 chiral pieces there are three additional solutions:
One set of 8 pieces that can be assembled into (only) a 5×5 rectangle – (p0, p1, p2, p3, p4, p5) + (p7, p8) = (O1, I2, I3, V3, O4, T4) + (Z4, L4).
Two sets of 8 pieces that can be assembled into (only) a 2×13 rectangle – (p0, p1, p2, p3, p4, p5) + (p7, p9) = (O1, I2, I3, V3, O4, T4) + (Z4, P5) and (p0, p1, p2, p3, p4, p5) + (p8, p9) = (O1, I2, I3, V3, O4, T4) + (L4, P5).
Yes, polyform puzzler uses Donald Knuth’s Dancing Links algorithm. In my solution, I originally missed the need to include the U shape so I got some extra solutions (I have left these in my pictures). I now get the same results for the 3 x 9 rectangle but I am still seeing four rather than two solutionns for the 2 x 13 rectangle. This appears to arise because I am not constraining the solution to include two chiral shapes – two of my solutions have only one chiral shape.