Library · Geometric Probability · Chapter 1

Three sticks forming a triangle

Revised Report an error

Problem 1.1

Let a,b,ca, b, c be independent uniform random variables in [0,1][0,1]. What is the probability that sticks of lengths a,b,ca, b, c form a triangle?

Solution. Three positive lengths form a triangle iff each is less than the sum of the other two. The parameter space is the unit cube [0,1]3[0,1]^3, with total volume 11.

The triangle inequality a<b+ca < b + c fails in the region {a≥b+c}\{a \geq b + c\}, which is the corner tetrahedron with vertices (0,0,0),(1,0,0),(1,1,0),(1,0,1)(0,0,0), (1,0,0), (1,1,0), (1,0,1). Its volume is 16\tfrac16 (one-sixth of the unit cube). By symmetry, the analogous tetrahedra for b≥a+cb \geq a + c and c≥a+bc \geq a + b also have volume 16\tfrac16 each. These three bad regions are disjoint: at most one side can exceed the sum of the other two.

Hence the bad volume is 3⋅16=123 \cdot \tfrac16 = \tfrac12, and the good volume — the triangle region — is 1−12=121 - \tfrac12 = \tfrac12. The probability of forming a triangle is P=12.■\boxed{\mathbb{P} = \tfrac12.} \qedhere

The unit cube [0,1]^3 of stick lengths (a,b,c) . The three shaded corner tetrahedra (copper) are the configurations where one stick is at least as long as the other two combined; each has volume \tfrac16 . The remaining volume \tfrac12 is the triangle region.
The unit cube [0,1]3[0,1]^3 of stick lengths (a,b,c)(a,b,c). The three shaded corner tetrahedra (copper) are the configurations where one stick is at least as long as the other two combined; each has volume 16\tfrac16. The remaining volume 12\tfrac12 is the triangle region.
import numpy as np
a, b, c = np.random.rand(3, 10**7)
p = ((a+b>c) & (b+c>a) & (c+a>b)).mean()
print(f"sim: {p:.5f}   exact: 0.5")
# sim: 0.50005   exact: 0.5
Report an error on this page

Reports are stored by Netlify. See the privacy note.