← Back to all activities한국어 → 📖 Read the article
🎯 Monte Carlo Pi Lab

Can you find pi
just by scattering random points?

Draw a circle inside a square, and scatter points across that square completely at random. Just from the fraction of points that land inside the circle, you can astonishingly estimate the value of pi (π). This way of finding π through probability, instead of calculation, is called the Monte Carlo method.

Draw a circle of radius 1 filling a square with side length 2, and the square's area is 4, while the circle's area is π. So circle's area ÷ square's area = π/4. Scatter points completely evenly at random across the square, and the probability of a point landing inside the circle also gets closer to this same ratio (π/4). So you can estimate π ≈ 4 × (points inside the circle ÷ total points).

🎯 Scatter points inside the circle

Press the button to scatter random points. Points that land inside the circle show up violet; points outside show up gray.

Total points 0 Inside circle 0 Estimated π ≈ -
📈 Watch it get more accurate as points pile up

Every time you scatter points above, check on the graph how close the estimate up to that point gets to the true value of π (3.14159...).

You haven't scattered any points yet. Scatter some above!
🧮 How efficient is the Monte Carlo method, really?

Unfortunately, the Monte Carlo method converges very slowly. To cut the error down to a tenth, you have to increase the number of points by a hundredfold (10² times) — this is called the "1/√n rule." Getting π accurate to 6 decimal places would take scattering literally billions of points.

Methods like "circumference ÷ diameter" or Leibniz's series, which you saw on the special numbers page earlier, reach an accurate π far faster. Even so, the Monte Carlo method matters because for problems like complex shapes or high-dimensional spaces, where setting up an exact formula is difficult, this "scatter randomly and count the ratio" approach is often practically the only solution available.

In practice, the Monte Carlo method is used across a huge range of fields — nuclear reactor design, pricing financial products, weather forecasting, drug-development simulations, and more. Estimating π is just about the easiest example for experiencing this powerful method firsthand.

🧩 Monte Carlo Pi Quiz

Question 1/10 · Correct 0