## Brainteaser 1631: Ali Baba’s boxes

**From The Sunday Times, 12th December 1993** [link]

The royal jewellers Fabulé make standard-sized golden cubic boxes which are diamond-encrusted on the outside. They make these from large sheets of gold which have been encrusted with diamonds on one side and they then cut out the required shapes to make the boxes.

For example, the 3-by-4 cruciform shown on the left below provides a shape which folds up into a cubic box, but the strip on the right does not.

Recently thieves broke into the Fabulé workshops and stole various cut-out pieces of the diamond-encrusted sheeting. They did not realise that in fact they had taken the mis-cuts: all the pieces that consisted of six squares but none would actually fold into a box. And their haul consisted of one piece of each possible faulty shape.

How many pieces did they steal?

This puzzle was selected for the book *Brainteasers* (2002, edited by Victor Bryant). The text was changed, but the substance of the puzzle remains the same.

[teaser1631]

## Jim Randell 9:20 am

on23 July 2019 Permalink |It seems like a bit of a wasteful manufacturing process, but it does mean that the shapes cannot be turned over. (Although card with different coloured sides would have sufficed).

I enjoyed programming a constructive solution for this puzzle.

This Python program generates possible shapes that consist of 6 connected squares, and determines how many different shapes there are when translation and rotation are allowed (but not reflection). It then takes those shapes and attempts to wrap each one around a cube to find out which of them represent the net of a cube.

It runs in 982ms

Run:[ @repl.it ]Solution:There are 40 shapes that cannot be folded into a cube.We can make 60 different shapes out of 6 joined squares (where reflection is not allowed). (See OEIS A000988 [ @oeis ]).

And there are 11 shapes that can be folded to make a cube (if reflection is allowed):

The two of these on the left are

achiral(i.e. their mirror image can be formed by rotating the piece), leaving 9 that arechiral(i.e. the mirror image cannot be formed by rotation of the piece). So we need to make mirror images of the 9 chiral shapes to give 20 shapes altogether that can be folded into a cube (where reflection is not allowed).The remaining 40 shapes cannot be folded into a cube.

See: [ @wikipedia ], which tells us there are 60 one-sided hexonimoes and gives the 11 nets of the cube. Which is enough information to determine the answer.

The program is constructive so can easily be augmented to plot the 60 shapes, and colour in those which can be folded into cubes. I used my simple plotting library [ @github ].

Run:[ @repl.it ]The output looks like this:

The colours show how the shape can be folded to give the colouring of a standard Rubik’s Cube.

LikeLike