If you don't know the value of PI, but you do know:
- The area of a circle is PI * r * r, if r is the circle's radius
- The area of a square is 2r * 2r, if r is 1/2 of the length of
the square's side
- How to throw darts so they land randomly in a square (they must
land somewhere in the square, so you have to be a good dart thrower)
then you can compute PI right in your own dorm room by throwing darts.
How?
- Build a square that is 2 feet on each side.
- Centered in this square, place a dart board (a circle) that is
2 feet in diamater.
- The square has area 2 * 2 = 4 square feet
- The circle has area PI square feet
- The probability of a randomly thrown
dart landing in the circle is the ratio of
the circle's area to the square's area.
- Throw a bunch of darts randomly into the square.
- Count the fraction of them that land in the circle.
- That number approaches PI / 4 as you throw lots and lots of darts.
This is a good example to
- Show how computers can simulate real life
- Show that computers can, well..., compute things
However, it is not a particularly good way to compute PI.
Last modified 10:37:43 CST 22 January 1999
by Ron K. Cytron