Wednesday, April 20, 2011

Puzzled

Jesse, my boss who is leaving the company, told me about one of his favorite puzzles.  It consists of 16 square pieces with a tab or a slot on each side.  There are four different shapes of tabs and slots.  Your goal is to assemble the puzzle into a 4 x 4 square.  You can rotate or flip the pieces any way you want, but for the hardest challenge you have to assemble it using only the rough side or only the smooth side.

I figure there are over 2 x 1022 potential combinations if you do it the hard way.  Jeremy, you can write that number out in decimal notation and tell me whether it is big or little.

Being a tool-using monkey I stuck the pieces into an Access table, generated the list of 64 different piece/rotations that have to be considered,  wrote one query to come up with every valid combination of pieces into rows, wrote another to determine the valid combinations of those rows into 4 x 4 grids, and dumped the solutions to a spreadsheet.

There are 12 valid combinations if you don't allow yourself to flip any pieces.  This is one of the simpler ones—simpler because I didn't have to rotate many pieces from my baseline orientation.

2 comments: