Method 2 · ~1940s

Throwing darts at π

No clever geometry. No formulas. Just toss random points and count. Patience does the rest.

Throws0
Inside0
Outside0
π estimateThrow some darts to start
π (true)3.14159265358979323846…

Random points land all over the square evenly. The fraction that lands inside the circle approaches π / 4 — multiply by 4 and you've got π. The catch: it converges painfully slowly. To get an extra digit right, you typically need 100× more throws.

The setup

Picture a square with a circle drawn perfectly inside it. The circle just touches all four sides. Now imagine throwing darts at this square completely at random — you're equally likely to hit any spot.

Some darts land inside the circle. Others land in the four little corners outside it. Count both. The ratio of "inside" to "total" approaches a specific number — and that number, times 4, is π.

Why it works

The square has area (2r)² = 4r² if its sides are length 2r. The inscribed circle has area πr². So the circle takes up πr² / 4r² = π / 4 of the square.

When you throw points uniformly across the square, the probability of any one landing inside the circle is exactly that ratio: π / 4. With enough throws, the observed fraction converges to the true probability — the law of large numbers. Multiply by 4 and you've got π.

That's the trick: probability is just area in disguise. Every probabilistic π estimator is secretly measuring an area without telling you.

It's slow. Really slow.

Random methods like this converge at a rate of about 1 / √N, where N is your number of throws. To get one more correct digit, you need roughly 100 times more throws. To pin down π to 4 decimal places: about 100 million darts. To get to 10 decimal places: 10²⁰ darts. (Don't.)

Compared to Archimedes' polygon method or the series methods coming up, Monte Carlo is the slowest way to find π that's still kind of cool. Try it in the simulator — even with 100,000 darts, you typically only get the first two digits right.

So why do we use it?

Not for π. Almost nobody computes π this way. Monte Carlo is named after the casino, and it was developed in the 1940s at Los Alamos to model neutron diffusion — a physics problem nobody could solve with formulas. Stanislaw Ulam's insight was that random sampling could estimate things that resisted direct calculation.

Today Monte Carlo methods sample everything from molecular interactions to stock prices to climate models to the rendering of light in 3D animation. Pixar's Renderman uses Monte Carlo every time it draws a frame. The π demo is the smallest possible example of a giant idea: when math gets hard, throw enough random samples and the answer falls out.

Try this

  • Hit Auto-throw for a few seconds, then watch how the estimate jitters and slowly settles.
  • Reset and throw just 10 darts. Then 100. Notice how unreliable small samples are.
  • See how many throws it takes to consistently nail "3.1". Now try for "3.14". (Bring patience.)

Sources & further reading