🎯 Monte Carlo π Estimator
Throw random darts at a unit square with an inscribed circle of radius 1. The ratio of hits inside the circle to total darts converges to π/4, so π ≈ 4 × (inside / total). A classic demonstration of random sampling.
π Estimate
—
actual π = 3.141592653…
Controls
Statistics
Total darts0
Inside circle0
Error—
Convergence—
Tip: The error shrinks roughly as 1/√N. You need ~4× more
darts to halve the error. The bottom chart shows the π estimate
converging over time.