Library · Geometric Probability · Chapter 31

Expected squared distance in a disc

Revised Report an error

Problem 31.1

Let P1,P2P_1, P_2 be points chosen independently and uniformly in the closed disc of radius rr. What is the expected squared distance E[∣P1−P2∣2]\mathbb{E}[|P_1 - P_2|^2]?

Solution. Treat P1,P2P_1, P_2 as two-dimensional vectors. Expanding the squared distance, ∣P1−P2∣2=∣P1∣2+∣P2∣2−2 P1⋅P2.|P_1 - P_2|^2 = |P_1|^2 + |P_2|^2 - 2 \, P_1 \cdot P_2.

Take expectations. By independence, E[P1⋅P2]=E[P1]⋅E[P2]\mathbb{E}[P_1 \cdot P_2] = \mathbb{E}[P_1] \cdot \mathbb{E}[P_2]. By the rotational symmetry of the disc, E[Pi]=0\mathbb{E}[P_i] = 0 (each component has zero mean). Hence E[∣P1−P2∣2]=2 E[∣P∣2],\mathbb{E}[|P_1 - P_2|^2] = 2 \, \mathbb{E}[|P|^2], where PP is a single uniform random point in the disc.

Compute in polar coordinates with density 1/(πr2)1/(\pi r^2): E[∣P∣2]=1πr2∫02π ⁣ ⁣∫0rs2⋅s ds dθ=1πr2⋅2π⋅r44=r22.\begin{align*} \mathbb{E}[|P|^2] &= \frac{1}{\pi r^2} \int_0^{2\pi} \!\! \int_0^r s^2 \cdot s \, ds \, d\theta \\ &= \frac{1}{\pi r^2} \cdot 2\pi \cdot \frac{r^4}{4} = \frac{r^2}{2}. \end{align*} Therefore E[∣P1−P2∣2]=2⋅r22=r2.■\boxed{\mathbb{E}[|P_1 - P_2|^2] = 2 \cdot \tfrac{r^2}{2} = r^2.} \qedhere

The appeal of this result is its total absence of elliptic integrals. The first moment E[∣P1−P2∣]=12845π⋅r≈0.905 r\mathbb{E}[|P_1 - P_2|] = \tfrac{128}{45\pi} \cdot r \approx 0.905\,r (“disc line picking”) is much harder to compute; it reduces to an elliptic integral via the law of cosines. The squared distance admits a much cleaner analysis thanks to the bilinearity of the inner product and the vanishing of the mean vector.

import numpy as np
# Uniform on unit disc via (sqrt(u), theta) polar
r = np.sqrt(np.random.rand(2, 10**7))
theta = np.random.rand(2, 10**7) * 2*np.pi
x, y = r*np.cos(theta), r*np.sin(theta)
d2 = (x[0]-x[1])**2 + (y[0]-y[1])**2
print(f"sim: {d2.mean():.5f}   exact: 1.0")
# sim: 1.00012   exact: 1.0
Report an error on this page

Reports are stored by Netlify. See the privacy note.