Library · Geometric Probability · Chapter 9
An n-gon from a broken stick
Problem 9.1
For an integer , a unit stick is broken at independent uniform random points, producing pieces. What is the probability that the pieces can be reassembled to form a (non-degenerate) -gon?
Solution. Let be the piece-lengths, so and . The pieces can form a non-degenerate -gon iff each is less than the sum of the others:
We compute by inclusion–exclusion. Let . Each piece marginally has density on (Beta), so
The events are mutually exclusive (two pieces cannot both exceed , since their sum would exceed ). Hence by addition,
Therefore
For (triangle) the probability is ; for (quadrilateral) it is ; for (pentagon) it is . The probability tends to as — intuitively, when a stick is broken into many pieces, “short enough pieces” becomes automatic. This generalises the case of Chapter 2 (whose complement is the instance here).
The result is cited frequently on math.stackexchange, usually as a classroom exercise illustrating inclusion–exclusion in the simplex.
import numpy as np
# Break stick at n-1 uniform points; check if all n pieces < 1/2.
for n in [3, 4, 5, 6]:
pts = np.sort(np.random.rand(n-1, 10**6), axis=0)
spacings = np.vstack([pts[:1], np.diff(pts, axis=0), 1 - pts[-1:]])
ngon = (spacings < 0.5).all(axis=0)
print(f"n={n}: sim={ngon.mean():.5f} exact={1 - n/2**(n-1):.5f}")
# n=3: sim=0.24987 exact=0.25000
# n=4: sim=0.49910 exact=0.50000
# n=5: sim=0.68732 exact=0.68750
# n=6: sim=0.81286 exact=0.81250