Probability of a painted cube being reassembled into itself Suppose 27 cubes are stacked together, suspended in the air, to form a larger cube.
The cube is then painted on all the exposed surfaces and dried.
The smaller cubes are then randomly permuted in both spatial position and spatial orientation to form another large cube.
What is the probability that new larger cube is identical to the original?
This is not homework, it was passed on by a friend who found it somewhere on the internet, and they do not remember where.
 A: After painting, there are $4$ types of small cubes:
1) $8$ cubes with $3$ painted faces.
2) $12$ cubes with $2$ painted faces.
3) $6$ cubes with $1$ painted face.
4) $1$ completely unpainted cube.
Now, a cube of type $1)$ must be placed again on a vertex. This gives $8!$ possible arrangements. However, such cubes can be oriented in $3$ possible ways, so we also have $3^{8}$ orientations. This gives $8!\cdot 3^{8}$ possibilities for the vertices.
Similarly, for type $2)$ we obtain $12!\cdot 2^{12}$ possibilities (those cubes can be placed in $12$ positions, but can only be oriented in $2$ ways).
For type $3)$ we get $6!\cdot 4^{6}$ possibilities.
Finally type $4)$ has $24$ possibilities (it can only be placed in one position, but can be oriented in $24$ ways).
For the total number of possible reassemblings, note that every cube can be oriented in $24$ ways, and that there are $27!$ rearrangements. So we have $27!\cdot 24^{27}$ possibilities in all.
Hence the probability is
$$\frac{8!\cdot 3^{8}\cdot 12!\cdot 2^{12}\cdot 6!\cdot 4^{6}\cdot 24}{27!\cdot 24^{27}}.$$
A: There are $27$ cubies of four types:


*

*one body cubie (B),

*six face cubies (F),

*twelve edge cubies (E), and

*eight vertex cubies (V).


We can represent the cubie types occupying the $27$ cubie positions by a $27$-letter word using the letters B, F, E, and V with the multiplicities above.  The number of distinct such words, all of which are equally likely and only one of which matches that of the original arrangement, is given by the multinomial coefficient
$$
\binom{27}{1,6,12,8}=\frac{27!}{1!\cdot6!\cdot12!\cdot8!}.
$$
Now for how each of the cubie types might appear.


*

*There is only one way the body cubie can appear (i.e. with no faces painted).

*There are six ways a face cubie can appear (e.g. front face painted, top face painted, etc.)  In fact these six possible appearances are precisely those realized by the six face cubies in the original arrangement—one of the six has its front face painted, one its top face painted, and so on.

*Similarly, there are twelve ways an edge cubie can appear (e.g. front and top painted, front and left painted), each realized by one of the twelve edge cubies in the original arrangement.

*Likewise there are eight ways a vertex cubie can appear.


Putting together the type information and the appearance information for each of the cubies, there are
$$
\binom{27}{1,6,12,8}\cdot1^1\cdot6^6\cdot12^{12}\cdot8^8
$$
distinct arrangements, each of which has the same probability and only one of which matches the original arrangement.  Hence the probability of matching the original arrangement is the reciprocal of this number.
