Library · Geometric Probability · Chapter 60
Robbins’s constant
Problem 60.1
Two points are chosen independently and uniformly in the unit cube . What is the expected distance ?
Solution. The answer is Robbins’s constant: writing and , This was first computed in closed form by David P. Robbins in 1978. The derivation uses which reduces (after change of variable to with triangular marginals) to a 3D integral. Its evaluation involves careful integration by parts and yields the explicit combination of , , , and two logarithms above.
Compare:
1D (unit segment): (clean).
2D (unit square, interior): . (The distinct boundary-of-square constant, for two points on the perimeter, is ; do not conflate the two.)
3D (unit cube): Robbins’s constant above.
Each successive dimension introduces new transcendental terms, and no closed form is known for general -dimensional cubes. ■
import numpy as np
from math import sqrt, log, pi
p = np.random.rand(3, 2, 10**6)
d = np.linalg.norm(p[:,0] - p[:,1], axis=0)
exact = (4 + 17*sqrt(2) - 6*sqrt(3) + 21*log(1+sqrt(2))
+ 42*log(2+sqrt(3)) - 7*pi)/105
print(f"sim: {d.mean():.5f} exact: {exact:.5f}")
# sim: 0.66156 exact: 0.66171