Begin2.DVI
ben green
(Ben Green)
#1
to determine the area Aof the circle. If H denotes the number of hits inside the
circle and N represents the total number of darts thrown, the area of the circle is
determined by H
N
=A
1
=A.
Figure 11-15. Average areas from Monte Carlo simulation.
Perform the above experiment K-times to calculate a set of approximate areas
{A 1 , A 2 ,... , A K}having an average area A=K^1
∑K
i=1 Ai. Put all of the above computer
code in a loop and calculate M-averages {A 1 ,A 2 ,... ,AM}. The central limit theorem
tells us that the set of averages must be normally distributed. By calculating the
mean and standard deviation associated with all these averages it is possible to
determine very accurate bounds on the area of the circle. Using the values N= 1000
throws, K= 100 areas, and M= 500 area averages, modern laptop computers can
calculate the results in less than one minute.
The data generated for the above values of N,K and M is presented in figure
11-15 as a bar chart having a mean 0. 7853974 and standard deviation 0. 001282.