Library · Geometric Probability · Chapter 38

Expected range of n uniform random points on a segment

Revised Report an error

Problem 38.1

Let X1,…,XnX_1, \ldots, X_n be iid uniform random variables on [0,1][0, 1]. What is the expected value of the range R=X(n)−X(1)R = X_{(n)} - X_{(1)} (the distance between the largest and smallest)?

Solution. For nn iid uniform points on [0,1][0, 1], the order statistics X(1)≤⋯≤X(n)X_{(1)} \leq \cdots \leq X_{(n)} have the classical expected values E[X(k)]=kn+1.\mathbb{E}[X_{(k)}] = \frac{k}{n+1}. Therefore E[R]=E[X(n)]−E[X(1)]=nn+1−1n+1=n−1n+1.\mathbb{E}[R] = \mathbb{E}[X_{(n)}] - \mathbb{E}[X_{(1)}] = \frac{n}{n+1} - \frac{1}{n+1} = \frac{n - 1}{n + 1}. So E[R]=n−1n+1.■\boxed{\mathbb{E}[R] = \frac{n-1}{n+1}.} \qedhere

Derivation of the order-statistic means. The joint density of nn order statistics is n!n! on the simplex 0≤X(1)≤⋯≤X(n)≤10 \leq X_{(1)} \leq \cdots \leq X_{(n)} \leq 1. The marginal density of X(k)X_{(k)} is the Beta(k,n−k+1)(k, n-k+1) density, with mean k/(n+1)k/(n+1). Equivalently, the uniform order statistics are obtained by “sorting” and have equal expected spacings, of which there are n+1n+1: hence each spacing has mean 1/(n+1)1/(n+1), and the kk-th order statistic is the sum of the first kk spacings. ■

Specialisations:

  • n=2n = 2: E[R]=13\mathbb{E}[R] = \tfrac{1}{3}. (This recovers Chapter 33, since R=∣X1−X2∣R = |X_1 - X_2|.)

  • n=3n = 3: 12\tfrac{1}{2}.

  • n=10n = 10: 911≈0.818\tfrac{9}{11} \approx 0.818.

  • As n→∞n \to \infty: E[R]→1\mathbb{E}[R] \to 1, at rate 1−2n+11 - \tfrac{2}{n+1}.

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
Report an error on this page

Reports are stored by Netlify. See the privacy note.