General Aptitude

Cubes and dice

Part 1 of 2 · 15 min

Painted cubes

The concept

Start with something familiar

Pick up a Rubik's cube. It is built from 27 small cubes. The 8 corner pieces each show 3 colours. The 12 edge pieces show 2 colours. The 6 centre pieces show 1 colour. And hidden in the middle is 1 piece you never see at all.8+12+6+1=278 + 12 + 6 + 1 = 27That one sentence is the whole of this topic. A big cube is painted on the outside and cut into small cubes, and GATE asks how many small cubes have 3, 2, 1 or 0 painted faces. Where a small cube sits, corner, edge, face or inside, decides how much paint it gets.
Play with it
n = 3, 27 cubes
Together8 + 12 + 6 + 1 = 27

Idea 1: cuts in three directions multiply

Before painting, count the pieces. A cut is a flat slice through the whole block. If you make aa cuts in one direction, the block splits into a+1a + 1 slabs. Cuts in the other two directions split each slab further, so the counts multiply:pieces=(a+1)(b+1)(c+1)\text{pieces} = (a + 1)(b + 1)(c + 1)A cube with side nn cut into unit cubes needs n−1n - 1 cuts each way, giving n×n×n=n3n \times n \times n = n^3 small cubes.
Cuts each wayPieces
1, 1, 12×2×2=82 \times 2 \times 2 = 8
2, 2, 23×3×3=273 \times 3 \times 3 = 27
2, 2, 33×3×4=363 \times 3 \times 4 = 36
Example
What is the largest number of pieces you can get from a cube with 6 straight cuts, if every cut is parallel to a face?
Spread the cuts evenly: 2 in each direction gives 3×3×3=273 \times 3 \times 3 = 27. Putting all 6 in one direction gives only 7.

Idea 2: there are always exactly 8 cubes with three painted faces

A small cube gets three painted faces only if it touches three outer faces of the big cube at once, and that only happens at a corner. A cube has 8 corners, so:3 faces painted=8(for any n≥2)\text{3 faces painted} = 8 \qquad (\text{for any } n \ge 2)
Example
A painted cube is cut into 1,000 small cubes. How many have three painted faces?
Still 8, one at each corner. The size of the cube doesn't matter.

Idea 3: two painted faces sit along the 12 edges, n − 2 on each

A small cube with exactly two painted faces touches two outer faces, so it lies along an edge of the big cube. Each edge has nn small cubes, but the two at the ends are corners with three faces painted. That leaves n−2n - 2 on each edge, and a cube has 12 edges:2 faces painted=12(n−2)\text{2 faces painted} = 12(n - 2)
Example
A painted cube of side 4 cm is cut into 1 cm cubes. How many have exactly two painted faces?
n=4n = 4, so 12×(4−2)=2412 \times (4 - 2) = 24.

Idea 4: one painted face sits in the middle of each face; the rest is a hidden core

A small cube with exactly one painted face lies on an outer face of the big cube but away from its edges. On each face that's an (n−2)(n - 2) by (n−2)(n - 2) square of cubes, and there are 6 faces. Peeling one layer off every side leaves the unpainted core, a cube of side n−2n - 2:1 face=6(n−2)20 faces=(n−2)3\begin{aligned} \text{1 face} &= 6(n - 2)^2 \\ \text{0 faces} &= (n - 2)^3 \end{aligned}All four groups together must add up to n3n^3, which makes a handy check.
The first column is the number of painted faces on a small cube.
Paintedn=3n = 3n=4n = 4n=5n = 5
3 faces888
2 faces122436
1 face62454
0 faces1827
Total2764125
Example
A painted cube is cut into 216 small cubes. How many have at least one painted face?
n3=216n^3 = 216, so n=6n = 6. Unpainted cubes =(6−2)3=64= (6 - 2)^3 = 64. At least one face painted =216−64=152= 216 - 64 = 152.

Idea 5: when only some faces are painted, peel off one layer per painted face

The formulas above assume every face is painted, and that the solid is a cube. For anything else, think about the unpainted block directly. Each painted face spoils exactly one layer of small cubes on its side. Remove those layers, and what's left is unpainted.
Painted facesUnpainted block
all 6 of an nn cube(n−2)(n−2)(n−2)(n-2)(n-2)(n-2)
all except the bottom(n−2)(n−2)(n−1)(n-2)(n-2)(n-1)
only top and bottomn×n×(n−2)n \times n \times (n-2)
all 6 of an a×b×ca \times b \times c cuboid(a−2)(b−2)(c−2)(a-2)(b-2)(c-2)
For a fully painted cuboid, the same corner-edge-face reasoning gives 8 corners, 4[(a−2)+(b−2)+(c−2)]4[(a-2) + (b-2) + (c-2)] cubes with two faces painted (4 edges of each length), and 2[(a−2)(b−2)+(b−2)(c−2)+(a−2)(c−2)]2[(a-2)(b-2) + (b-2)(c-2) + (a-2)(c-2)] with one face painted.
Example
A 5×4×35 \times 4 \times 3 cuboid is painted on all faces and cut into unit cubes. How many have no paint?
Peel one layer off each side: (5−2)(4−2)(3−2)=3×2×1=6(5-2)(4-2)(3-2) = 3 \times 2 \times 1 = 6.

How to spot which idea you need

The question says...Use
"how many pieces after kk cuts"Idea 1: (a+1)(b+1)(c+1)(a+1)(b+1)(c+1)
"three faces painted"Idea 2: 8 corners
"exactly two faces painted"Idea 3: 12(n−2)12(n-2)
"one face" or "no face painted"Idea 4: 6(n−2)26(n-2)^2 or (n−2)3(n-2)^3
some faces unpainted, or a cuboidIdea 5: peel one layer per painted face

Worked example 1warm-up

A wooden cube of side 4 cm is painted on all faces and cut into 1 cm cubes. Find how many small cubes have 3, 2, 1 and 0 painted faces.
Solution
Step 1. Find nnIdea 1
n=4n = 4, so there are 43=644^3 = 64 small cubes.
Step 2. CornersIdea 2
8 cubes with three faces painted.
Step 3. EdgesIdea 3
12×(4−2)=2412 \times (4 - 2) = 24 with two faces.
Step 4. Faces and coreIdea 4
6×22=246 \times 2^2 = 24 with one face, and 23=82^3 = 8 with none.
Step 5. Check
8+24+24+8=648 + 24 + 24 + 8 = 64, the total number of small cubes.

Worked example 2GATE level

A cube is painted red on two opposite faces and blue on the other four. It is then cut into 125 equal small cubes. How many small cubes show both red and blue?
Solution
Step 1. Find nnIdea 1
n3=125n^3 = 125, so n=5n = 5.
Step 2. Find where red meets blueIdea 3
A small cube shows both colours only where a red face meets a blue face, which is along an edge or at a corner. Each red face has 4 edges, and all 4 border a blue face. With 2 red faces, that's 2×4=82 \times 4 = 8 red-blue edges.
Step 3. Count the edge cubes
Each red-blue edge has n−2=3n - 2 = 3 cubes that aren't corners: 8×3=248 \times 3 = 24.
Step 4. Add the cornersIdea 2
Every one of the 8 corners touches one red face (top or bottom) and two blue faces, so all 8 show both colours.
Step 5. Total and check
24+8=3224 + 8 = 32. The other 4 edges run between two blue faces, so their 4×3=124 \times 3 = 12 middle cubes are blue only, as expected. All the two-face and three-face cubes together: 32+12=44=12×3+832 + 12 = 44 = 12 \times 3 + 8.

All the equations at a glance

IdeaEquation
Pieces from cuts(a+1)(b+1)(c+1)(a+1)(b+1)(c+1)
3 faces painted88
2 faces painted12(n−2)12(n-2)
1 face painted6(n−2)26(n-2)^2
No paint(n−2)3(n-2)^3
Some faces unpaintedpeel one layer per painted face