Library · Geometric Probability · Chapter 48
Expected lengths of the three broken-stick pieces
Problem 48.1
A unit stick is broken at two independent uniform random points, producing three pieces. Let , , denote the shortest, middle, and longest of the three piece-lengths respectively. Compute , , and .
Solution. The three pieces sum to , so the three expectations sum to . The pieces are exchangeable (invariant under relabelling), but their order statistics have different distributions and hence different means.
Step 1: density of the simplex. The pieces with and are uniform on the -simplex with density (the simplex has area ).
Step 2: via tail integration. Compute . The event requires , , and , which describes a smaller simplex of side . Thus Therefore
Step 3: via inclusion–exclusion. The longest piece exceeds iff some piece does. The three events , , have pairwise and triple intersections computable from the simplex density. By inclusion–exclusion, Compute each term for (the pairwise and triple terms vanish when and respectively). After integration one obtains
Step 4: by subtraction. Since ,
In summary,
The values are the first three elements of a harmonic-number pattern: for iid uniform points on producing pieces, the expected -th order statistic piece is Setting : , , , confirming the above. This is the formula of David and Nagaraja (Order Statistics, Wiley 2003) and has appeared many times on math.stackexchange as a classical exercise.
import numpy as np
x, y = np.random.rand(2, 10**7)
lo, hi = np.minimum(x, y), np.maximum(x, y)
pieces = np.stack([lo, hi - lo, 1 - hi])
sorted_pieces = np.sort(pieces, axis=0)
print(f"E[S] sim: {sorted_pieces[0].mean():.5f} exact: {1/9:.5f}")
print(f"E[M] sim: {sorted_pieces[1].mean():.5f} exact: {5/18:.5f}")
print(f"E[L] sim: {sorted_pieces[2].mean():.5f} exact: {11/18:.5f}")
# E[S] sim: 0.11116 exact: 0.11111
# E[M] sim: 0.27782 exact: 0.27778
# E[L] sim: 0.61102 exact: 0.61111