Estimating π with darts
Throw darts uniformly at random at the unit square. The quarter circle has area π/4 and the square has area 1, so the fraction of darts landing inside is close to π/4 — and four times that fraction is an estimate of π.
From the slides: Why should anyone care about chance?.
Darts thrown
0
Inside the quarter circle
0
Estimate of π = 4 × inside / thrown
—
π = 3.14159…
Error
—
inside outside (the picture shows the first 20,000 darts)
What to notice
- With 100 darts the estimate is often off by 0.1 or more. With 100,000 it is usually right to two decimal places.
- The typical error shrinks like 1.64/√n: every extra correct digit costs a hundred times as many darts. That slow but dependable √n is the price, and the strength, of Monte Carlo methods.
- Nothing here is special to circles: the same idea estimates areas and averages in hundreds of dimensions, where no grid of points could ever work.