Estimating Pi by Throwing Darts
Since the exact area of a unit circle is , we can throw darts to estimate in the following way.
In the figure below, find:
- A square dartboard of side length 2. We'll ignore any dart that misses this dartboard.
- A circle of radius 1 painted on that dartboard.
- Each "dart" is a point chosen at random in the square.
- Its x-coordinate is a random number from -1 to 1 (uniform distribution).
- So is its y-coordinate.
- Note: the circle has equation .
- We compute for the dart.
- If this is less than 1, the dart lands inside the circle.
- Otherwise, the dart lands outside the circle.
My original version of this applet used random numbers from 0 to 1 instead of -1 to 1. Here's how that looked.
In the figure below, find:
- A square of side length 1
- A circle of radius 1.
- Each "dart" is a point chosen at random in the unit square.
- Its x-coordinate is a random number from 0 to 1 (uniform distribution).
- So is its y-coordinate.
- We compute for the dart.
- If this is less than 1, the dart lands inside the circle.
- Otherwise, the dart lands outside the circle.
Which version to you prefer?
See Physics Girl and Veritasium throw darts: https://www.youtube.com/watch?v=M34TO71SKGk