Monte Carlo Estimation of Pi |

Monte Carlo Estimation of Pi |

Suppose we have two arbitrary regions, S_1 and S_2, with S_2 contained within S_1. Since the number of randomly chosen points within a region is approximately proportional to its area, select at random n points within S_1, and let n_s represents the number of points that fall inside S_2, we have

\displaystyle \frac{n_s}{n} \approx \frac{\text{Area of } S_2}{\text{Area of } S_1 }\quad\quad\quad(1)

This expression suggests that the ratio of points falling in S_2 to the total points in S_1 approximates the ratio of their areas.

Let S_1 be a unit square and S_2 a quarter of the unit circle:

Fig. 1

By (1),

\displaystyle \frac{n_s}{n} \approx \frac{\frac{1}{4} \cdot \pi \cdot (1)^2}{1 \cdot 1} \implies \frac{n_s}{n} \approx \frac{\pi}{4}

Therefore,

\displaystyle \pi \approx \frac{n_s}{n}\cdot 4\quad\quad\quad(2)

We have implemented a program to compute an estimate of \pi (see Fig. 2). The program generates a series of pairs (x, y) where each pair represents a point within the unit square. We count the number of points for which x^2+y^2 \le 1, corresponding to points that fall within the quarter of circle. By varying the sample size n, we estimate \pi according to (2). Notably, as the sample size n increases, the accuracy of the estimate improves.

Fig. 2

Computer Algebra, Mathematics

LEAVE A REPLY

Please enter your comment!
Please enter your name here

More like this

Reintroducing the IMplementation Reflection Tool

By Claire Neely, Senior Implementation Specialist Illustrative Mathematics’ redesigned IMplementation Reflection Tool (IRT) is a powerful, non-evaluative resource...

Unizor – Creative Mind through Art of Mathematics: Geometry+...

https://www.youtube.com/watch?v=hAXtrAWNVuI Notes to a video lecture on http://www.unizor.com Geometry+ 10Problem AGiven two parallel lines and a segment AB...

A Little AIME Problem | mathgarage

A Little AIME Problem Posted: May 16, 2022 in Mathematics Tags: AIME, math, Math Contest Solution In general, let By Pythagoras Identity, Solve this...