WOLFRAM|DEMONSTRATIONS PROJECT

Monte Carlo Estimate for Pi

​
random seed
sample size
1
large format
inside: 0 outside: 1 total: 1
π ≈ 4 × 0/1 = 0.
A simple Monte Carlo estimate for the value of
π
can be found by generating random points on a square and counting the proportion that lie inside an inscribed circle. The probability of a point landing in the circle is proportional to the relative areas of the circle and square. However this method converges slowly, with many sample points needed to get an accurate approximation.