Twenty-seven identical white cubes are assembled into a single cube, the outside of which is painted black. The cube is then disassembled and the smaller cubes thoroughly shuffled in a bag. A blindfolded man (who cannot feel the paint) reassembles the pieces into a cube. What is the probability that the outside of this cube is completely black?

This problem is a counting exercise. We will count the number of cube orientations and arrangements such that the outside of the larger cube is black, and then divide this by the total number of possible orientations and arrangements to obtain the required probability.

We will count without any consideration of symmetry. Other counting methods could be used, but as long as we are consistent we will obtain the correct probability.

Consider the four types of cubes upon disassembly:

- 8 cubes with three faces painted black;
- 12 cubes with two black faces;
- 6 cubes with one black face;
- 1 completely white cube.

Each cube of type (a) must be oriented in one of three ways, giving 3^{8} possible orientations. Next, each corner cube must be placed in one of eight corners, giving 8! possible arrangements. Thus we have 3^{8} · 8! possibilities in all.

Similarly, each cube of type (b) must be oriented in one of two ways, giving 2^{12} possible orientations. Then, each edge cube must go to one of 12 edges, giving 12! possible arrangements. Thus we have 2^{12} · 12! possibilities in all.

Also, each cube of type (c) has four possible orientations, and may be placed in one of six positions, yielding 4^{6} · 6! possibilities.

Finally, the one white cube of type (d) may be oriented in 24 ways. (Four ways for each face.)

Thus the total number of correct reassemblings is a = 3^{8} · 8! · 2^{12} · 12! · 4^{6} · 6! · 24.

To find the total number of *possible* reassemblings, consider that each cube may be oriented in 24 ways, and there are 27! possible arrangements of the cubes, giving b = 24^{27} · 27! possibilities in all.

Therefore, the probability that the outside of the reassembled cube is completely black is

a/b = 1/(2^{56} · 3^{22} · 5^{2} · 7 · 11 · 13^{2} · 17 · 19 · 23) = 1/5465062811999459151238583897240371200 1.83 × 10^{−37}.

Source: The IMO Compendium, by Dusan Djukic, Vladimir Jankovic, Ivan Matic, Nikola Petrovic. See section 3.22.2, problem 5.