Monte Carlo Simulation To Estimate Pi

Monte Carlo methods, or simulations, are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results.

One method to estimate the value of π (3.141592…) is by using a Monte Carlo method. This methods consists of drawing a square with an inner circle. Then counting how many fall in the enclosed circle.

The area of the circle is 𝐴 = 𝜋𝑟2

The area of the square is 𝐴 = 𝑙𝑒𝑛𝑔𝑡h2 = (2𝑟)2

If we divide the area of the circle, by the area of the square we get π/4. The same ratio can be used between the number of points within the square and the circle

Hence we can use the following formula to estimate Pi:

π ≈ 4 x (number of points in the circle / total number of points)





Pi History
# Pi Number of Points