Extracting a constant from randomness
Throw millions of points blindfolded into a unit square. Then count the ones that land inside the quarter circle. How many will there be? Surprisingly, the ratio of this number to the total number of throws approaches π/4. So:
That is all: you can find π just by rolling dice.
Why does it work?
The area of the unit square is 1. The area of the quarter circle inside it is π/4 (a circle's area is πr²; a quarter is πr²/4 = π/4 here, with r=1). If the points are spread uniformly at random, the fraction landing in any region equals that region's area. This is a basic property of probability.
| Region | Area | Expected share |
|---|---|---|
| Unit square | 1 | 100% (all of them) |
| Quarter circle | π/4 ≈ 0.785 | ~78.5% (inside) |
| Corner region | 1 − π/4 ≈ 0.215 | ~21.5% (outside) |
If you throw n points, on average 78.5% land inside the circle; multiply the ratio by 4 and you reach π.
Speed of convergence: the limit of Monte Carlo
The method is powerful but slow. The accuracy improves at a rate of 1/√n:
| n (throws) | Typical error |
|---|---|
| 100 | ±0.2 |
| 10,000 | ±0.02 |
| 1,000,000 | ±0.002 |
100 times the accuracy needs 10,000 times as many points. That is why π is not calculated with Monte Carlo but with formulas such as Machin's formula or the Chudnovsky algorithm (each term of the Chudnovsky series adds about 14 correct digits).
So why do we still use it?
The real strength of Monte Carlo lies in high-dimensional integrals. With classical integration methods (Simpson, trapezoid and so on), the number of points needed grows exponentially with the number of dimensions; in 10 dimensions even millions of points may not be enough. With Monte Carlo, the convergence rate does not depend on the dimension: it is the same 1/√n in any number of dimensions.
That is why, in the real world, Monte Carlo is king in:
- Physics simulations: Brownian motion, neutron transport
- Quantum chemistry: molecular integrals
- Financial derivative pricing: beyond Black-Scholes
- Artificial intelligence: Bayesian inference, MCMC
- Computer graphics: path tracing (Pixar, the Cycles renderer)
The story
The first person to use the method systematically was Stanisław Ulam (1946, at Los Alamos after the Manhattan Project). While recovering from an illness he played solitaire and tried to work out the chance of winning a game theoretically; at some point he thought, "why not just play it thousands of times and observe?" The idea was adapted to problems of neutron diffusion.
The name comes from Monaco's famous Monte Carlo casino, a symbol of chance and money.
By the numbers
- Speed of convergence: O(1/√n)
- n needed for 6 correct digits: ~10¹³–10¹⁴ (error ≈ 1.64/√n)
- Modern calculations of π (Chudnovsky): more than 100 trillion digits (records since 2022)
- Playing on this page: 100K points ≈ π correct to about 2 digits
"Whoever understands randomness understands half the universe."


Rate Estimating π (Monte Carlo)
What did you think of this content? Click the stars to leave your rating.
Leave a Comment and Rating
Sign in to comment and rate. Membership is free.