Estimation of Pi


Description

This applet is designed to approximate the value of Pi. It accomplishes this purpose by firing random data points at a circle inscribed within a square. The probability of a data point landing within the circle is a ratio of the circle's area to the area of the square.

Where r equals the length of the radius of the circle, the area of the circle is then Pi*r*r. The diameter of the circle is the same as the length of each side of the square. Since the diameter of the circle, twice the radius, equals (2*r), the area of the square is equal to (2*r)*(2*r).

The probability of a point landing within the circle equals (Pi*r*r)/(2*r*2*r). By then performing algebra and removing (r*r) from the numerator and the denominator the simplified equation becomes P(landing in circle) = Pi/4.

Next, multiply both sides by 4.

Pi is now equivalent to four times the probability of a data point landing in the circle.


Simulation


Applet Source, Written by Nicholas Exner.

Please Send comments to

MSTE Webmaster

Last Revised: 7/27/98