Buffon’s Needle
In 1777, the Comte de Buffon posed a question: if you drop a needle onto a floor of parallel lines, what is the probability it crosses a line? The answer involves π. Drop thousands of needles and watch your estimate converge.
What’s happening
The problem
A floor has parallel lines spaced D apart. A needle of length L (where L ≤ D) is dropped at random. What is the probability that the needle crosses one of the lines?
The solution
Let x be the distance from the needle’s center to the nearest line, and θ be the
angle between the needle and the lines. The needle crosses a line when
x ≤ (L/2) sin(θ). Since x is uniformly distributed on [0, D/2]
and θ on [0, π], we integrate:
P(crossing) = (2 / (Dπ)) ∫₀ᵱ (L/2) sin(θ) dθ
= (2L) / (πD)
= 2L / (πD)
Rearranging: π = 2L / (P · D). If we drop N needles and C cross
a line, then P ≈ C/N, giving π ≈ 2LN / (CD).
Convergence
The estimate converges as 1/√N, which is typical for Monte Carlo methods. To get one more digit of accuracy, you need roughly 100 times more needles. This is why Monte Carlo estimation of π is a beautiful demonstration but a terrible algorithm — it takes millions of needles to match what a series can compute in seconds.
The long needle case
When L > D, the needle can cross multiple lines. The expected number of crossings is still 2L / (πD) — a remarkable result that follows from linearity of expectation. This generalization is due to Laplace. Adjust the L/D slider above 1.0 to see this regime.
Historical significance
Buffon’s needle (1777) is the oldest problem in geometric probability. It connects a physical experiment to a transcendental number through an integral that depends on nothing but the geometry of randomness. It anticipates Monte Carlo methods by two centuries.