- Choose one method and keep the default inputs for your first run.
- Compare the estimate and error, then read the chart and sampled step table together.
- Load another example or copy the URL when you want to reuse the setup.
Increase the side count of an inscribed polygon to see a geometric approximation of pi.
Convergence chart
Read the chart with the sampled table below. The red dashed line marks the reference value of pi.
Sampled steps
| Step | Estimate | Absolute error | Relative error |
|---|
Teacher notes
- Start with polygon when you want a geometric picture of why pi is tied to circles.
- Gregory is deliberately slow, so students can feel what “convergence” means instead of just hearing the word.
- Nilakantha is useful right after Gregory because the same idea suddenly looks much more efficient.
- Monte Carlo shows a different lesson: randomness can still move toward a stable average, but not in a perfectly smooth way.
FAQ
Why is Monte Carlo not exact?
Monte Carlo uses random points inside a square. More points usually improve the estimate, but each run is still a simulation rather than an exact formula.
Why does Gregory converge so slowly?
The Gregory-Leibniz series is simple, but every new term changes the estimate only a little. That makes it a good teaching tool and a poor speed contest.
Why do more polygon sides help?
An inscribed polygon fits the circle more closely as the side count increases, so its perimeter becomes a better approximation of the circumference.
What do matching digits mean?
Matching digits count how many leading digits of the estimate agree with the reference value of pi before the first mismatch.
Which method should I try first?
Start with polygon, then compare Gregory and Nilakantha, and finally use Monte Carlo to talk about randomness and reproducibility.