Solution
Average Distance in a Cube
Show the problem again
Two points are chosen independently and uniformly at random inside the unit cube [0, 1]³. What is the expected Euclidean distance between them? Give the answer rounded to 4 decimal places.
Worked solution
The answer is about 0.6617. As in the square case, the coordinate differences are independent with density 2(1 − u) on [0, 1], so E[d] = 8 ∫∫∫ (1 − u)(1 − v)(1 − w) √(u² + v² + w²) du dv dw over [0, 1]³. Exploiting the six-fold symmetry and passing to spherical coordinates over the region w ≤ v ≤ u, the radial integral is elementary and the remaining angular integrals reduce to logarithms and inverse trigonometric values. The result is Robbins' closed form E[d] = (4 + 17√2 − 6√3 − 7π)/105 + ln(1 + √2)/5 + 2 ln(2 + √3)/5 ≈ 0.661707. A Monte Carlo check with 10⁷ pairs gives 0.6618, consistent with this. For comparison, the expected distance is 1/3 on a unit segment and about 0.5214 in a unit square.
Source: The closed form is due to David P. Robbins, American Mathematical Monthly (1978); the value is often called Robbins' constant. Statement written for AxiomIQ.