29**. A cube was painted white on the outside and then cut into 64 small cubes. Then the small cubes were randomly assembled into a large cube. (The cubes could not only be rearranged but also rotated.) What is the probability that it will be white on the outside? (All ways of assembling the large cube are considered equally likely.)
29. Suppose first that only one small cube, say, the one standing in the corner (Fig. 29), has been moved. In how many ways can it be put back in place? Any of the eight vertices of the cube can be placed at point $A$. Each of these can be rotated in three different ways. This gives a total of 24 options. The same number of options applies to the return of each of the other cubes. Combining them with each other, we get $24^{64}$ ways.

To come to the general case, we must also consider all the ways in which the cubes can be permuted (without rotating them). There are a total of 64! such permutations. The total number of ways to assemble the cube is $24^{64} \cdot 64!$.

Now let's calculate the number of ways in which the cube can be assembled with the outer surface painted white. Among the 64 cubes, there are:

1) 8 with 3 painted faces,
2) 24 with 2 painted faces,
3) 24 with 1 painted face,
4) 8 with no painted faces.

Show that to obtain a cube painted on the outside, the cubes of the first type must be placed at the vertices of the cube, and each of them can be rotated in three ways. This gives $3^{8} \cdot 8!$ possibilities. Similarly, for the cubes of the second type, there are $2^{24} \cdot 24!$ suitable placements, for the cubes of the third type $4^{24} \cdot 24!$ placements, and finally, for the cubes of the fourth type $24^{8} \cdot 8!$ placements. Combining the placements of cubes of all four types, we get that there are

$$
3^{8} \cdot 8! \cdot 2^{24} \cdot 24! \cdot 4^{24} \cdot 24! \cdot 24^{8} \cdot 8!
$$

ways to assemble a cube painted on the outside. The desired probability $p$ is obtained as the quotient of this number divided by the total number of ways to assemble the cube, i.e., it is equal to

$$
p=\frac{3^{8} \cdot 8^{21} \cdot 24^{8} \cdot (8!)^{2} \cdot (24!)^{2}}{24^{44} \cdot 64!}=\frac{(8!)^{2} \cdot (24!)^{2}}{3^{48} \cdot 8^{322} \cdot 64!}
$$

The magnitude of this number can be estimated using approximate formulas known in mathematical analysis. It turns out that $p<10^{-83}$. For comparison, note that according to physicists' calculations, the number of atoms in the visible part of the universe does not exceed $10^{68}$.

![](https://cdn.mathpix.com/cropped/2024_05_21_7d0959e1f193b6338b84g-43.jpg?height=542&width=572&top_left_y=620&top_left_x=180)

Fig. 29.