1. **Problem statement:** We have a $32 \times 32 \times 32$ cube made of unit cubes, all six faces painted. We consider all subcubes inside it (of any side length from 1 to 32). We select one subcube at random from the collection $C$ of all subcubes. We want the expected number of its sides that are completely painted.
2. **Total number of subcubes:** For side length $k$ ($1 \le k \le 32$), the number of subcubes of side $k$ is $ (32 - k + 1)^3 = (33 - k)^3$.
Total subcubes:
$$\sum_{k=1}^{32} (33 - k)^3 = \sum_{m=1}^{32} m^3 = \left(\frac{32 \cdot 33}{2}\right)^2 = 16^2 \cdot 33^2 = 256 \cdot 1089 = 278784.$$
3. **Painting of subcube sides:** Each subcube has 6 faces. A face of the subcube is painted if it lies on the outer surface of the big cube (since only the outer faces are painted).
4. **Counting subcubes by number of painted faces:** The number of painted faces of a subcube depends on its position inside the big cube.
- 0 painted faces: subcube fully inside, not touching any outer face.
- 1 painted face: subcube touches exactly one outer face.
- 2 painted faces: subcube touches exactly two outer faces (an edge).
- 3 painted faces: subcube touches exactly three outer faces (a corner).
No subcube can have more than 3 painted faces because the cube has 3 dimensions.
5. **For a subcube of side length $k$, define:**
- Number of positions with 3 painted faces (corners): 8 (corners of the big cube)
- Number of positions with 2 painted faces (edges but not corners):
$$12 \times ((33 - k) - 2) = 12 (31 - k)$$
- Number of positions with 1 painted face (faces but not edges):
$$6 \times ((33 - k) - 2)^2 = 6 (31 - k)^2$$
- Number of positions with 0 painted faces (interior):
$$((33 - k) - 2)^3 = (31 - k)^3$$
6. **Check sum for each $k$: **
$$8 + 12(31-k) + 6(31-k)^2 + (31-k)^3 = (33-k)^3$$
7. **Expected number of painted faces for subcubes of side $k$: **
$$E_k = \frac{8 \times 3 + 12(31-k) \times 2 + 6(31-k)^2 \times 1 + (31-k)^3 \times 0}{(33-k)^3} = \frac{24 + 24(31-k) + 6(31-k)^2}{(33-k)^3}$$
Simplify numerator:
$$24 + 24(31-k) + 6(31-k)^2 = 6(31-k)^2 + 24(31-k) + 24$$
8. **Overall expected value:**
$$E = \frac{\sum_{k=1}^{32} E_k \times (33-k)^3}{\sum_{k=1}^{32} (33-k)^3} = \frac{\sum_{k=1}^{32} \left(6(31-k)^2 + 24(31-k) + 24\right)}{\sum_{k=1}^{32} (33-k)^3}$$
Since $E_k$ was weighted by $(33-k)^3$ in denominator, multiplying back cancels denominator, so numerator is sum of numerators.
Rewrite sums with $m = 31 - k$:
When $k=1$, $m=30$; when $k=32$, $m=-1$ (ignore negative, sum from $m=0$ to $30$):
$$\sum_{m=0}^{30} (6m^2 + 24m + 24)$$
Calculate each sum:
$$\sum_{m=0}^{30} m^2 = \frac{30 \cdot 31 \cdot 61}{6} = 9455$$
$$\sum_{m=0}^{30} m = \frac{30 \cdot 31}{2} = 465$$
$$\sum_{m=0}^{30} 1 = 31$$
So numerator:
$$6 \times 9455 + 24 \times 465 + 24 \times 31 = 56730 + 11160 + 744 = 68634$$
Denominator:
$$\sum_{k=1}^{32} (33-k)^3 = \sum_{m=1}^{32} m^3 = \left(\frac{32 \cdot 33}{2}\right)^2 = 278784$$
9. **Final expected value:**
$$E = \frac{68634}{278784}$$
Simplify fraction by dividing numerator and denominator by 6:
$$\frac{68634 \div 6}{278784 \div 6} = \frac{11439}{46464}$$
Divide numerator and denominator by 3:
$$\frac{11439 \div 3}{46464 \div 3} = \frac{3813}{15488}$$
No further common factors.
**Answer:**
$$\boxed{\frac{3813}{15488}}$$
Expected Painted Sides D74B06
Step-by-step solutions with LaTeX - clean, fast, and student-friendly.