A classic Monte Carlo simulation is to approximate
pi. Take a 2
unit square, its
area is 4. Within this square, a circle of
radius 1 can be
inscribed.
The area of this
circle is pi. So, for the approximation...
- Take two 10, 20, or 100 sided dice.
One for X, one for Y.
For future reference, the number of sides is called N
- Draw a one quadrant of the 2 unit square.
- Divide this quadrant up into the number of sides on the selected dice.
- Roll the two dice and plot this spot on the paper
- Calculate if its a hit or miss:
If X2 + Y2 < N2, it is
a "hit".
Otherwise its a "miss".
- Repeat Z times.
Higher values of Z result in increased precision
- 4 * (number of hits)/Z is approximately pi.
Monte Carlo simulations are also used in climatology. One example
of a SETI@Home like project that plans to use Monte Carlo simulations
can be found at http://www.climate-dynamics.rl.ac.uk/. Because
of the number of variables in climate dynamics, you select one set of
variables, run it and see if its right. In this model, the data is
started at 1950, and run for 50 years to see if it matches present conditions.
If it does, it is then run for another 50 years to form an approximation of
what 2050 will be like.