Library · Geometric Probability · Chapter 39
Expected absolute y-coordinate in a disc
Problem 39.1
Let be a point chosen uniformly at random in the closed unit disc. What is the expected value of ?
Solution. Compute the integral directly in polar coordinates. For uniform in the unit disc, where has density on and is uniform on , independently of .
Thus The first factor: . The second factor: . Multiplying,
The quantity is the expected perpendicular distance from a uniform random point in the disc to the horizontal diameter. It also equals the projected mean absolute deviation along any fixed direction, by the rotational symmetry of the disc.
There is a clean slicing identity behind this. For a convex body of area in the plane, a unit direction , and a reference level , let be the length of the slice . Then the mean absolute deviation of the coordinate about is For the unit disc with , , and , this evaluates to , recovering the answer above. (Note the absolute value: the signed deviation about the mean averages to . For this symmetric disc the mean and median both equal , but a median does not generally have this property. The quantity here is the mean absolute deviation.)
import numpy as np
r = np.sqrt(np.random.rand(10**7))
theta = np.random.rand(10**7) * 2*np.pi
y = r * np.sin(theta)
print(f"sim: {np.abs(y).mean():.5f} exact: {4/(3*np.pi):.5f}")
# sim: 0.42438 exact: 0.42441