Monte Pi

Set Framerate

Start

Enter the number of times you want the experiment in the box above and click on Simulate

Method

The Monte Carlo method relies on repeated random sampling to simulate some process or compute a value.

Pi can be computed using Monte Carlo simulation through a series of experiments. Here is a single experiment:

Now suppose you do m experiments and in n of those experiments, the random point chosen falls within the upper right quarter of the unit circle. Since the area of a circle is known to be pi * r^2 and the area of a square is r^2 (and here we are dealing with a radius/square side of length 1), the following equations hold:

formula

Built with

p5 logo