Skip to content
Vamshi Jandhyala

Books · Problem of the Week: Solutions

Chapter 2

An Average Shadow

↓ Download PDF handout

Aunit cube hangs above a horizontal plane. Light arrives in parallel rays from directly overhead, so the shadow is the vertical projection of the cube. Turn the cube to a random orientation. What is the average area of the shadow?

The answer is 3/23/2, and it is not really a fact about cubes. It is a case of a theorem of Cauchy: for any convex body, the mean area of the shadow, averaged over orientations, is a quarter of the surface area. The cube has surface area 66.

Stan Wagon’s Problem of the Week 1417, circulated 29 July 2026, which attributes the result to A.-L. Cauchy, 1850.

Everything depends on one vector

Fix the plane and turn the cube. Let RR be the rotation that carries the cube from its starting position to where it now sits, and let u=RTk,k=(0,0,1),u = R^{\mathsf{T}} k, \qquad k = (0,0,1), so that uu is the vertical direction expressed in the cube’s own frame. If you were sitting inside the cube, uu is where you would point to say “up”. Its three components are the cosines of the angles between the vertical and the cube’s three edge directions.

The area of the shadow is ux+uy+uz|u_x| + |u_y| + |u_z|.

Proof. The argument is a double count. Take a point in the interior of the shadow and send a vertical line up through it. Because the cube is convex, that line meets the boundary in exactly two points, one where it enters and one where it leaves, unless it happens to graze an edge or a vertex. Those exceptional points form a set of area zero, so almost every interior point of the shadow is covered twice as the boundary is projected down, which gives 2area(shadow)  =  faces Farea(F)nFk,2 \cdot \operatorname{area}(\text{shadow}) \;=\; \sum_{\text{faces } F} \operatorname{area}(F) \, |n_F \cdot k|, where nFn_F is the unit outward normal of the face FF. The factor nFk|n_F \cdot k| is the ordinary rule that a flat plate of area AA tilted so its normal makes angle θ\theta with the vertical throws a shadow of area AcosθA|\cos\theta|.

For the unit cube the six faces each have area 11, and their outward normals are the six vectors ±Re1,±Re2,±Re3\pm R e_1, \pm R e_2, \pm R e_3. Now (Rej)k=ejRTk=uj(R e_j) \cdot k = e_j \cdot R^{\mathsf{T}} k = u_j, so the six terms pair off and the sum is 2(ux+uy+uz)2(|u_x| + |u_y| + |u_z|). Halve it. 

For the cube the double count has a concrete reading. From each pair of opposite faces exactly one is turned upwards, so three faces are lit; their projections tile the shadow without overlapping, and they contribute ux|u_x|, uy|u_y| and uz|u_z|. Three orientations are worth carrying forward:

uu (0,0,1)(0,0,1) (1,1,0)/2(1,1,0)/\sqrt{2} (1,1,1)/3(1,1,1)/\sqrt{3}
a face level an edge up a diagonal upright
area 11 2\sqrt{2} 3\sqrt{3}

The middle one looks like a throwaway, and it is not: 2\sqrt{2} turns out to be the threshold at which the distribution changes character.

The shadow is the vertical projection, and its area is read off a single vector: the vertical direction as the cube sees it.

The whole problem has now collapsed. There is no geometry left, only a vector on the unit sphere and the function uux+uy+uzu \mapsto |u_x| + |u_y| + |u_z|. Write AA for it.

What the extremes are

Both bounds come straight from ux2+uy2+uz2=1u_x^2 + u_y^2 + u_z^2 = 1. Squaring the sum gives (ux+uy+uz)2=1+2(uxuy+uyuz+uzux)1(|u_x| + |u_y| + |u_z|)^2 = 1 + 2(|u_xu_y| + |u_yu_z| + |u_zu_x|) \ge 1, and Cauchy-Schwarz in the other direction gives (ux+uy+uz)23(ux2+uy2+uz2)=3(|u_x| + |u_y| + |u_z|)^2 \le 3(u_x^2 + u_y^2 + u_z^2) = 3. So 1    A    3,1 \;\le\; A \;\le\; \sqrt{3}, the lower bound holding when uu is a coordinate direction and the upper when the three components are equal in absolute value. In the cube those are a face lying level, whose shadow is the unit square, and a space diagonal standing upright, whose shadow is a regular hexagon of area 31.732\sqrt{3} \approx 1.732. In linear-algebra language AA is the 1\ell^1 norm of uu, and this is the standard comparison with the 2\ell^2 norm.

For a generic orientation the shadow is a centrally symmetric hexagon. When one component of uu vanishes the hexagon degenerates to a rectangle, as it does for both extreme cases above and for the edge-up orientation. The area varies continuously with the orientation, though not smoothly: the absolute values put a corner wherever a component crosses zero.

Four shadows seen from directly above. The largest is only about 7373 per cent bigger than the smallest: a cube casts a surprisingly steady shadow. Only the third is a hexagon; the other three have a component of uu equal to zero, and degenerate to rectangles.

The mean, without evaluating an integral

The natural move now is to average ux+uy+uz|u_x| + |u_y| + |u_z| over the sphere. It is worth resisting, because there is a route that never computes an average of cosθ|\cos\theta| at all, and it delivers the general theorem rather than the cube.

Let KK be a convex body with surface area SS. The mean area of the vertical projection of KK, over a uniformly random orientation, is S/4S/4.

Proof. Go back to the double count, which used nothing about cubes. For any convex body a vertical line still meets the boundary twice above almost every point of the shadow, so for a fixed light direction 2area(shadow)  =  KnkdA,2\cdot\operatorname{area}(\text{shadow}) \;=\; \int_{\partial K} |n \cdot k| \, dA, with nn the outward unit normal, which exists at almost every boundary point of a convex body. The identity is immediate for polytopes and for smooth bodies, and the general case follows by approximation.

Now average over a uniform orientation. Averaging is linear, so it passes through the integral and lands on nk|n \cdot k| alone. Here is the step that does the work: Enk\mathbb{E}|n \cdot k| is the same number for every unit vector nn. A uniform orientation is by definition invariant under rotation, so no direction is distinguishable from any other, and the average cannot depend on which normal it is looking at. Call that common value mm. Then E[area(shadow)]  =  12mKdA  =  12mS,\mathbb{E}\big[\operatorname{area}(\text{shadow})\big] \;=\; \tfrac{1}{2} m \int_{\partial K} dA \;=\; \tfrac{1}{2} m S, so the average shadow is proportional to the surface area, with one constant good for every convex body, and so far nothing has been integrated.

The constant is then fixed by any single body whose shadows are known without calculation. The sphere of radius 11 is the obvious candidate: turn it however you like and the shadow is a disc of area π\pi, while its surface area is 4π4\pi. So 12m4π=π\tfrac{1}{2} m \cdot 4\pi = \pi, giving m=1/2m = 1/2 and a mean shadow of S/4S/4

The cube has S=6S = 6, so its average shadow is 3/23/2. The sphere did the work that an integral would otherwise have had to do.

It is worth seeing the cube computed directly as well, since the two routes are independent. Under a uniform orientation u=RTku = R^{\mathsf{T}}k is a uniform point on the sphere, and its three coordinates have the same distribution, so the average shadow is 3Euz3\,\mathbb{E}|u_z|. Archimedes settles that: his hat-box theorem says the vertical coordinate of a uniform point on the sphere is itself uniform on [1,1][-1,1], because the sphere and the circumscribed cylinder have equal areas between any two horizontal planes. Hence Euz=1/2\mathbb{E}|u_z| = 1/2 and the mean is 3/23/2 again.

The distribution, not just the mean

The mean is the question asked, but the distribution is where the problem becomes interesting, because it has a closed form on most of its range.

Replacing uu by (ux,uy,uz)(|u_x|, |u_y|, |u_z|) leaves AA alone and lands in the positive octant, and the eight octants have equal area, so it is enough to take uu uniform on the positive octant, where A=ux+uy+uzA = u_x + u_y + u_z. Write P(As)\mathbb{P}(A \ge s) for the fraction of orientations whose shadow has area at least ss.

The set {As}\{A \ge s\} is the part of the octant on the far side of the plane ux+uy+uz=su_x + u_y + u_z = s. On the whole sphere that plane cuts off a cap whose pole is the space diagonal (1,1,1)/3(1,1,1)/\sqrt{3} and whose angular radius α\alpha satisfies cosα=s/3\cos\alpha = s/\sqrt{3}; what we want is that cap intersected with the octant.

A full spherical cap of angular radius α\alpha has area 2π(1cosα)2\pi(1 - \cos\alpha). So as long as the cap sits entirely inside the octant, its area is 2π(1s/3)2\pi(1 - s/\sqrt{3}), and dividing by the octant’s area π/2\pi/2 gives P(As)=4(1s3).\mathbb{P}(A \ge s) = 4\left(1 - \frac{s}{\sqrt{3}}\right).

When does the cap fit? The nearest point of the octant’s boundary to the pole lies on one of the three walls ux=0u_x = 0, uy=0u_y = 0, uz=0u_z = 0, at angular distance arccos2/3\arccos\sqrt{2/3} from the diagonal. The cap fits precisely when cosα2/3\cos\alpha \ge \sqrt{2/3}, that is when s2s \ge \sqrt{2}, and at s=2s = \sqrt{2} it is inscribed, touching all three walls at once.

The three points where it touches are worth naming: they are (0,1,1)/2(0,1,1)/\sqrt{2} and its two permutations, which are exactly the edge-up orientations from the table earlier. That is where the 2\sqrt{2} in the third column came from. The threshold is not a coincidence of the algebra but the moment the level set reaches the orientations with an edge vertical.

The superlevel sets {As}\{A \ge s\} are spherical caps about the space diagonal, marked at the centre, intersected with the octant. At s=2s = \sqrt{2} the cap is inscribed, touching each wall once at an edge-up orientation (the three marked points); above 2\sqrt{2} it lies wholly inside, so its area is linear in ss.

So on [2,3][\sqrt{2}, \sqrt{3}] the tail is a straight line and the density is the constant 4/34/\sqrt{3}. That stretch is no thin sliver of the range: P(A2)=44630.7340.\mathbb{P}(A \ge \sqrt{2}) = 4 - \frac{4\sqrt{6}}{3} \approx 0.7340.

So [2,3][\sqrt{2}, \sqrt{3}] carries about 73.473.4 per cent of the probability with a constant density: conditional on A2A \ge \sqrt{2}, the area is uniformly distributed on that interval. Two more values fall out of the same formula. Putting s=3/2s = 3/2 gives P(A3/2)=4230.5359\mathbb{P}(A \ge 3/2) = 4 - 2\sqrt{3} \approx 0.5359, so the mean sits below the median, and solving 4(1s/3)=1/24(1 - s/\sqrt{3}) = 1/2 puts the median at med(A)=7381.5155.\operatorname{med}(A) = \frac{7\sqrt{3}}{8} \approx 1.5155.

Below 2\sqrt{2} the octant walls clip the cap and the linear formula fails. What survives is a closed form for the density. Differentiating the tail gives fA(s)=43[13πarccos ⁣(s2(3s2))],1s2,f_A(s) = \frac{4}{\sqrt{3}} \left[1 - \frac{3}{\pi} \arccos\!\left(\frac{s}{\sqrt{2(3-s^2)}}\right)\right], \qquad 1 \le s \le \sqrt{2}, and fA(s)=4/3f_A(s) = 4/\sqrt{3} on [2,3][\sqrt{2}, \sqrt{3}]. The arccosine is exactly the angular correction for the part of the cap the walls cut away. Integrating this density gives the tail values

ss 1.051.05 1.11.1 1.21.2 1.31.3 2\sqrt{2}
P(As)\mathbb{P}(A \ge s) 0.99750.9975 0.98970.9897 0.95520.9552 0.88700.8870 0.73400.7340

and integrating sfA(s)s f_A(s) across the whole range returns 3/23/2, as it must.

The exact density. It climbs from zero at 11, meets the plateau 4/34/\sqrt{3} continuously at 2\sqrt{2} with a vertical tangent, and is constant from there to 3\sqrt{3}. The mean and the median differ by about one per cent.

The two pieces agree at 2\sqrt{2}: the arccosine vanishes there, so the rising branch arrives at exactly 4/34/\sqrt{3} and the density is continuous. What it is not is smooth. The approach has a vertical tangent, and the curve turns a corner onto the plateau, which is why sampling the density a little short of 2\sqrt{2} is so misleading: at s=20.002s = \sqrt{2} - 0.002 it still reads 2.1072.107 against a limit of 2.3092.309, and it only closes the gap in the last thousandth.

A trap in the sampling

The problem statement offers a recipe for simulating a random orientation. Plainly stated, it is: choose a rotation axis uniformly on the unit sphere, then choose the rotation angle uniformly from 00 to 2π2\pi. It is an inviting prescription, and it does not sample orientations uniformly. A simulation that follows it converges to 1.45831.4583, not 1.51.5.

The discrepancy is easy to see. By Rodrigues’ formula, rotating kk by an angle φ\varphi about a unit axis aa gives a vector whose vertical component is uz=cosφ+m2(1cosφ),m=ak.u_z = \cos\varphi + m^2(1 - \cos\varphi), \qquad m = a \cdot k. Under the recipe, mm is uniform on [1,1][-1,1] and φ\varphi is independent of it, so E[cosφ]=0\mathbb{E}[\cos\varphi] = 0 and E[uz]=0+E[m2]1=13.\mathbb{E}[u_z] = 0 + \mathbb{E}[m^2] \cdot 1 = \tfrac{1}{3}. Under a genuinely uniform orientation uu is uniform on the sphere, so upward and downward tilts are equally likely and E[uz]=0\mathbb{E}[u_z] = 0. A value of 1/31/3 is therefore proof of bias, with no further calculation needed. The recipe leaves the cube leaning towards where it started, and since shadows are smallest near the starting position, the average shadow comes out too small.

The cause is the angle, not the axis. Uniform measure on SO(3)SO(3), written in axis-angle coordinates, is a uniform axis together with an angle drawn from the density (1cosφ)/π(1 - \cos\varphi)/\pi on [0,π][0,\pi], not a uniform one. Small rotations are rarer than a flat angle supposes. Keep the uniform axis, replace the flat angle by that density, and the simulation returns 3/23/2 to within its standard error. Drawing a unit quaternion uniformly on the 33-sphere does the same job in fewer lines.

How wrong is the recipe? Its construction never refers to any direction but the vertical, so its law for uu is invariant under rotations about the vertical; the azimuth is therefore uniform and independent, and the mean shadow is Euz+4πE1uz2\mathbb{E}|u_z| + \tfrac{4}{\pi}\mathbb{E}\sqrt{1 - u_z^2}, with uzu_z distributed as above. Both expectations are integrals of an explicit function of mm and φ\varphi over [1,1]×[0,2π)[-1,1] \times [0,2\pi). The second is exactly 2/32/3; the first has no closed form I could find, and numerical integration gives 0.60947570.6094757. The mean shadow is therefore 0.6094757+83π=1.4583020,against 1.5,0.6094757 + \frac{8}{3\pi} = 1.4583020, \qquad \text{against } 1.5, a shortfall of 2.782.78 per cent.

That is not a subtle error. The standard deviation of the shadow area under the recipe is 0.18060.1806, so the shortfall of 0.04170.0417 is about 7.37.3 standard errors at a thousand samples, and only about 7676 samples are needed before it reaches two. The bias could pass for noise in a few dozen draws and should be conspicuous well before a thousand.

The lesson generalises past this problem. “Uniformly at random” is a statement about a measure, and on a group the invariant measure is rarely the one that a natural-looking construction produces. Building the rotation out of two independently uniform ingredients feels symmetric, and the feeling is misleading. Cauchy’s answer is exact and holds for every convex body; whether a simulation finds it depends entirely on which measure the sampler was quietly using.

An interactive version of the cube and its shadow, where the two samplers can be compared directly, is at vamshij.com/mathematics/average_shadow.

Interactive: turn the cube, watch the shadow

shadow area 1.732 samples 0 running mean

orientation drawn
place it
dragging turns
sample
Drag to turn the cube by hand, or switch the drag to the camera and walk round the scene: drop the viewpoint towards the plane and the shadow comes edge-on, which is the quickest way to see that it really is the vertical projection and not a drawing of one. The area of the shadow is |ux| + |uy| + |uz|, where u is the vertical direction seen from inside the cube, so it runs from 1 with a face level to √3 ≈ 1.732 with a space diagonal upright. The copper outline on the histogram is the exact distribution under uniform orientation; it is dead straight above √2. Tumble the cube and the running mean settles on 3/2. Switch the draw to the recipe printed in the problem statement and it settles on 1.4583 instead, missing the copper outline as it goes.