Pi Generator

Pi Generator

The applet below generates random points in a square. P is the number of points within the circle inscribed in the square while Q is the number of points outside the circle. As the probability that a point lie within the circle is Pi / 4, we can estimate the value of pi by taking the observed percentage of points within the circle and multiplying that value by 4.