Library · Geometric Probability · Chapter 47
Expected perimeter of a random triangle in a disc
Problem 47.1
Let be three points chosen independently and uniformly at random in the closed unit disc. What is the expected value of the perimeter of the triangle they form?
Solution. The perimeter of is . By linearity of expectation, where are iid uniform in the unit disc.
The constant is a classical “line-picking” constant, first computed by Czuber in 1884: (The derivation is a polar-coordinate integration that evaluates, after some effort, to this closed form.) Accepting this result,
Two remarks. First, the perimeter does not depend on the correlations between sides — linearity of expectation works even for dependent random variables — so we effectively get the three sides “for the price of one.” Second, the analogous mean distance between two random points of the unit square is which makes the disc-perimeter look positively elegant. (The three-dimensional cousin, the mean distance in a unit cube, is the genuinely notorious Robbins constant ; see Chapter 60.) The disc’s rotational symmetry is again the key.
import numpy as np
# Three uniform points in unit disc; compute triangle perimeter, average
r = np.sqrt(np.random.rand(3, 10**6))
t = np.random.rand(3, 10**6) * 2*np.pi
x, y = r*np.cos(t), r*np.sin(t)
d = lambda i, j: np.sqrt((x[i]-x[j])**2 + (y[i]-y[j])**2)
perim = d(0,1) + d(1,2) + d(2,0)
print(f"sim: {perim.mean():.5f} exact: {128/(15*np.pi):.5f}")
# sim: 2.71704 exact: 2.71624