Library · Geometric Probability · Chapter 38
Expected range of n uniform random points on a segment
Problem 38.1
Let be iid uniform random variables on . What is the expected value of the range (the distance between the largest and smallest)?
Solution. For iid uniform points on , the order statistics have the classical expected values Therefore So
Derivation of the order-statistic means. The joint density of order statistics is on the simplex . The marginal density of is the Beta density, with mean . Equivalently, the uniform order statistics are obtained by “sorting” and have equal expected spacings, of which there are : hence each spacing has mean , and the -th order statistic is the sum of the first spacings. ■
Specialisations:
: . (This recovers Chapter 33, since .)
: .
: .
As : , at rate .
import numpy as np
for n in [2, 3, 5, 10]:
x = np.random.rand(n, 10**6)
r = x.max(axis=0) - x.min(axis=0)
print(f"n={n}: sim={r.mean():.5f} exact={(n-1)/(n+1):.5f}")
# n=2: sim=0.33336 exact=0.33333
# n=3: sim=0.50033 exact=0.50000
# n=5: sim=0.66673 exact=0.66667
# n=10: sim=0.81830 exact=0.81818