What is it about?
You can find the number with chance. Place random points in the unit square (side length 1) and count how many of them lie inside the quarter circle of radius 1.
The areas compare like this:
If the points fall uniformly at random, about the fraction lands inside the quarter circle. If of points lie inside, then
A point lies inside the quarter circle if its distance from the origin is at most 1: (Pythagorean theorem). In the simulation, points inside the circle are round and points outside are small squares.
The estimate is itself random. Two runs with the same number of points almost always give different values. As grows, the spread gets smaller, but only slowly: the typical deviation from is roughly proportional to .
Methods that compute something with many random trials are called Monte Carlo methods, after the casino in Monaco. They are used, for example, in physics, climate research and financial mathematics.
Try it
- Add single points. How much does the estimate change at first?
- Add 1000 points or press Play. How many decimal places are correct? Compare your values in class – almost everyone gets a different estimate.
- Switch to the full circle in a square. Why is the factor still 4? Full circle
- Set 1000 points per second, press Play and watch the funnel. Does the curve sometimes leave it? Fast
Exercises
Exercise 1: Where does the 4 come from?
Explain why you have to multiply the fraction of points inside the circle by 4.
Show solution
The fraction of points inside the circle estimates the area ratio (quarter circle to square). Multiplying by 4 gives an estimate for .
Exercise 2: Same factor for the full circle
For the full circle of radius 1, the points lie in a square with side length 2. Show that the area ratio is again .
Exercise 3: How accurate does it get?
For an estimate that differs from by at most with about 95 % certainty, you need roughly points. Roughly how many points do you need for a deviation of at most ?
Show solution
The typical deviation shrinks like . More precisely, with about 95 % certainty the deviation is at most
For this gives . A deviation ten times smaller needs times as many points, so about million. Monte Carlo methods are therefore rather slow for – their strength shows in problems that are hard to solve any other way.
Exercise 4: Class experiment
Everyone adds 1000 points and writes down and . How do you combine all results of the class into a better estimate?
Show solution
Add all hits and all points: . With 25 people that makes points. The typical deviation is then about times smaller than for one person. Single people can still be closer to than the whole class – that is chance.
Ideas for the classroom
- Use: Lower secondary (simulating random experiments, the number π). Links probability, the area of a circle and the Pythagorean theorem.
- Display: The first points are drawn; counting continues without limit. For each , the funnel shows the range containing about 95 % of the estimates after points (). It is based on a normal approximation and is only rough for small (below about 50). A single curve may leave it now and then: on average it lies outside for about 5 % of all .
- Common pitfalls:
- “With more points the value gets more accurate at every step.” – The estimate keeps fluctuating, just less and less.
- “With 1000 points two decimal places are always correct.” – With 1000 points the typical deviation is about ; often only the first decimal place is correct.
- Computer random numbers are “truly random” – in fact they are pseudo-random numbers, which are good enough for this purpose.
- Collecting estimates: It can be exciting to let each group add 1000 points and collect the estimates on the board. The values visibly scatter around – a good starting point for the question of how accurate an estimate is.