Finding Pi With Randomness
Here's something that shouldn't work but does: you can calculate pi by throwing darts randomly at a wall.
No protractor, no string-around-a-circle, no formula. Just randomness. And yet, from pure chaos, one of the most precise numbers in mathematics emerges.
The Setup
Draw a square on a wall. Inscribe a circle inside it so the circle touches all four sides. Now throw darts at the square completely at random. Blindfolded, no aiming.
Some darts will land inside the circle. Some will land in the corners, outside the circle but inside the square. Count the ratio.
That's it. That ratio, multiplied by 4, converges on pi. The more darts you throw, the closer you get.
Why Does This Work?
If the square has side length 2, the inscribed circle has radius 1.
- Area of the square: 2 × 2 = 4
- Area of the circle: π × 1² = π
- Ratio of circle to square: π / 4
A randomly thrown dart is equally likely to land anywhere in the square. So the fraction that land inside the circle should approach the ratio of the areas, which is π/4. Multiply by 4 and you get π.
The dart doesn't know about pi. It's landing at random. But randomness, aggregated over thousands of trials, reveals the geometric truth hidden in the shape.
Throw Some Darts
Watch It Converge
The chart below tracks the estimate over time. Notice how it bounces wildly at first, then gradually settles toward the true value. This is the nature of randomness: noisy in small samples, reliable in large ones.
How Many Darts Do You Need?
Not many to get close. A lot to get precise. This is the cruel truth of Monte Carlo methods. Accuracy improves with the square root of the number of samples. To get 10x more precise, you need 100x more darts.
| Accuracy | Typical darts needed | Status |
|---|---|---|
| Within 1.0 (2.1 to 4.1) | ~10 | -- |
| Within 0.1 (3.04 to 3.24) | ~100 | -- |
| Within 0.01 (3.131 to 3.151) | ~10,000 | -- |
| Within 0.001 (3.1406 to 3.1426) | ~1,000,000 | -- |
What This Is Really About
This technique is called a Monte Carlo method, named after the casino. The idea: if a problem is too complex to solve with a formula, just simulate it randomly a million times and measure the result.
It's how we:
- Price financial derivatives. Options on Wall Street are priced by simulating thousands of possible futures for a stock.
- Predict weather. Run many slightly different simulations and see which outcomes are most common.
- Train AI. Reinforcement learning agents explore randomly before learning which actions work.
- Design nuclear reactors. The original use case, simulating how neutrons scatter through shielding.
There's something I find appealing here: randomness can be a path to precision rather than the opposite of it. Throw enough darts, and the chaos gradually resolves into something exact.
The Transferable Insight
Most of us treat randomness as noise to be filtered out. But Monte Carlo methods reveal something deeper: sometimes the fastest way to understand a complex system is not to model it perfectly, but to sample it randomly and let the answer emerge.
This principle applies beyond math. When you can't predict which blog post will resonate, publish many and measure. When you can't design the perfect product, ship variations and see what sticks. When you can't reason your way to the right career, try things and observe what energizes you.
The dart doesn't know about pi, and it doesn't need to. It just lands somewhere. The insight comes from accumulation, from having enough samples for the underlying truth to surface through the noise. That's a useful mental model. When a problem is too complex to solve analytically, sometimes the best strategy is to sample widely and let the pattern reveal itself.