This systems model estimates the value of an integral by finding the average value of a function over a specified domain. Upon user direction, the excel sheet will generate random numbers within the domain of the first quadrant of a unit circle. These numbers will then be used to find the average value of the function (y-value) and, after multiplying by four, provide an estimate for pi. From this model, students should learn how to calculate the value an integral without algorithmic methods, but rather with experimental and computational methods.
The area of a unit circle is known to be pi. Therefore, four times the area of the first quadrant of the unit circle should be pi as well. This model works by simulating Monte Carlo integrals. Random numbers are chosen in the domain of the function and the average value of the function is calculated. The first sheet of this model works by finding the average value of one quadrant of the unit circle and multiplying it by four. The value obtained should be an approximation of pi. The second sheet works by using different form of Monte Carlo integration. A series of random points are found in a square that encompasses a unit circle. The ratio of the number of points within the unit circle to those outside the unit circle will give an estimate of the area contained by one quadrant of the unit circle. Due to the Law of Large numbers, factoring in more random numbers to the calculation provides a more accurate estimate of pi. In order to demonstrate this, the model displays the values of pi calculated from increasing amounts of random numbers.
The fundamental principle behind this model is HAVE = HAD + CHANGE. For each run of the simulation on the first sheet, the following things are calculated and displayed:
The second sheet similarly demonstrates the equation HAVE = HAD + CHANGE, but it does so through the second Monte Carlo integration method with an analogy of darts hitting a dartboard. The following things happen for every run of the second simulation.
The best way to introduce this model is by first reviewing integration. After review, the following topics and ideas should be discussed:
The following activity might help introduce the idea of Monte Carlo integration:
This activity is basically the method that the simulation uses to calculate the area of a unit circle. While the area of the dartboard cannot be found by simply taking the integral of the circle's equation, this method allows for a rough approximation. When students attempt to work with the model, they will be more familiar with the idea of Monte Carlo integration and how it works.
While there are no parameters that can be changed, this model allows the user to refresh the
random variables and run the calculations again. In order to do both of these, simply press [F9]
(on PC) or [Command][=] (on Mac). Immediately, new random numbers will be calculated, run through
the equations, and recorded on the table.
A simulation is also available on Sheet 2 with a different form of Monte Carlo integration and new
random numbers. To get to the second sheet, click the "Integral as area under curve" tab in the
bottom left hand corner of Excel. The calculations are initiated in the same manner as the first
sheet.
**Note: Make sure that under Excel-> preferences-> calculation: be sure to select calculate sheets
"Manually", to check the box marked "Limit Iteration" and set "Maximum Iterations" = 1. For more
information on Excel, reference the Excel tutorial at:
To accomplish this objective, students should run the model and study the process through which it calculates the each data point. After understanding the process, the model should be run again with different random variables in order to understand the accuracy of the model. Ask the following questions to guide the students:
This objective uses the second sheet in the Excel file, "Integral as area under curve." Students should run the model and again attempt to understand the process through which it calculates each variable. After running the simulation once, a second run will help to understand the accuracy of the model. Ask the following questions to guide the students:
Each of the two models uses differing amounts of random numbers in order to calculate pi. The first sheet uses samples of 100, 200, 500, 1000, 2000, and 5000 to calculate pi and the second uses samples of 100, 200, 500, 1000, 2000, 5000, and 10000. The Law of Large Numbers states that with an increased number of trials come increased accuracy in predictions. Therefore, the predictions with an increased number of samples should show a closer estimation to the actual number of pi (~3.14159). Students should study the patterns in the outputs with differing number of samples. Ask the following questions to guide their discovery:
Have students research the topic of Monte Carlo integration and its application to cystic fibrosis studies. Cystic fibrosis is a genetic disorder as a result of a rare, recessive allele passed on by both parents. A method is used for estimating the age of an allele by collecting data about the frequency and the extent of variation that each allele displays. Monte Carlo integration is used to find the maximum estimate of the age of the allele. Ask the following questions to guide the students
This extension deals with the random number aspect of the Monte Carlo method. Since random numbers from a random number generator are traditionally not random, the integral could be affected by bias in the computer program that is generating numbers. Give students the following links to research this idea and supply the HotBits Genuine Random Number Generator for comparison. Ask the following question:
Supplemental Materials:
http://www.shodor.org/refdesk/Resources/Algorithms/RandomNumbers/ http://www.fourmilab.ch/hotbits/ http://www.randomnumbergenerator.com