Problem #42 MEDIUM
The Painted Cube
Amazon Meta Geometry Probability
Problem Statement
A solid wooden cube measuring 4 x 4 x 4 units is painted red on all six of its outer faces. It is then cut into 64 smaller unit cubes (each measuring 1 x 1 x 1). If you pick one of these 64 small cubes completely at random, what is the probability that it has paint on exactly 2 of its faces? Generalise your approach for an n x n x n cube.
Answer & Quick Explanation
Think you've got it? Click below to check your answer.
Probability = 24/64 = 3/8. There are 24 small cubes with exactly 2 painted faces (12 edges x 2 non-corner cubes per edge). General formula: 12(n-2) two-face cubes in an n x n x n cube, probability = 12(n-2)/n^3.
Detailed Editorial Solution
Want to see the step-by-step breakdown? Click below to reveal the editorial.
Categorise the 64 small cubes by how many painted faces they have. Position in the original cube determines this: corners have 3, edges have 2, faces have 1, and interior cubes have 0 painted faces.
Step 1: Corner cubes: a cube has 8 corners. Each corner small cube has 3 painted faces. Count = 8.
Step 2: Edge cubes (non-corner): a cube has 12 edges. For a 4x4x4 cube, each edge has 4 small cubes total, minus 2 corners = 2 non-corner edge cubes per edge. Count = 12 x 2 = 24.
Step 3: Face cubes (non-edge): a cube has 6 faces. Each face is a 4x4 grid of small cubes. Remove the border (edge and corner cubes): interior of each face = (4-2) x (4-2) = 2 x 2 = 4 cubes per face. Count = 6 x 4 = 24.
Step 4: Interior cubes (0 painted faces): the internal 2x2x2 block. Count = 2 x 2 x 2 = 8.
Step 5: Verify total: 8 + 24 + 24 + 8 = 64. Correct.
Step 6: P(exactly 2 painted faces) = 24 / 64 = 3/8. General formula for n x n x n: 2-face cubes = 12 x (n-2), probability = 12(n-2) / n^3.
Key Insight:
Position in the cube determines paint count. The 3D structure has three types of boundary positions — corners, edges, faces — plus interior. Counting by position type is far simpler than trying to enumerate cubes directly. This spatial categorisation technique applies to many 3D grid problems.