Buffon's Needle

Throw sticks at a striped floor. Count the ones that land across a line. That fraction contains Ļ€ — and nothing in the experiment is round.
dropped  0
crossing 0
error    
Click the floor to throw one needle

Estimate of π

true π = 3.14159265358979
 
needles
0
crossings
0
hit rate
predicted rate
absolute error
correct digits
0

The floor

Convergence

Estimate (pink) closing on Ļ€ (gold). Notice how it improves like 1/√n — a hundred times more needles buys only ten times more accuracy. This is the tax every Monte Carlo method pays.

Georges-Louis Leclerc, Comte de Buffon, 1777

A floor is ruled with parallel lines a distance d apart. You drop a needle of length ā„“ at random. What is the probability it lands touching a line?

P(crossing) = 2ā„“ / (π·d) (when ā„“ ≤ d)

Turn that around and you have a way to measure π by throwing things on the floor:

Ļ€ ā‰ˆ 2ā„“Ā·n / (dĀ·c) n = needles thrown, c = needles crossing a line

This is the first Monte Carlo method ever invented, roughly 170 years before the name existed. No circle is drawn, measured or mentioned. Ļ€ appears purely because the needle's angle is uniformly random over a half-turn — and once you integrate over all angles, you have integrated around a circle whether you meant to or not.

Where does the π actually come from?

A needle at angle Īø covers a horizontal span of ā„“Ā·|sin Īø|. Averaged over every angle from 0 to Ļ€, the mean span is 2ā„“/Ļ€ — and that average is exactly the probability of straddling a line spaced d apart. The Ļ€ is smuggled in by the average of a sine, which is where circles hide.

Things to try

In 1901 an Italian mathematician, Mario Lazzarini, claimed 3,408 tosses gave Ļ€ = 3.1415929 — accurate to seven digits. Statisticians have been politely skeptical ever since; 355/113 is suspiciously exactly the answer he got.