← Back to Gallery

Monte Carlo π Estimation

Estimate π by randomly throwing darts at a square containing a quarter circle. The ratio of points inside the circle to total points converges to π/4.

π ≈ 4 × (points inside) / (total points)
π ≈ 0
Total Darts: 0
Inside Circle: 0
Outside Circle: 0
π Estimate: 0
Actual π: 3.141592653...
Error: 100%

Why it works: A quarter circle of radius r inside a square of side r has area (πr²)/4. The square has area r². The ratio of inside/total converges to π/4.

Convergence: Error decreases as 1/√n, so you need 100× more darts to get 10× more accuracy.