Learning intentions:
In this section we will examine:
Introduction to simulations
The probability of flipping a coin has long been studied by mathematicians. If we are talking about a fair coin we would say that the probability is 0.5. This is, of course, a reasonable assumption as there are two sides to a coin and they are reasonably symmetrical. You might get slight variations in weight and balance, but on the whole a coin is just as likely to land Heads up as it is to landing Tails up.
Our assertion has also been experimentally tested by several mathematicians by flipping a coin thousands of times. Count Boffin (1707 - 1788) tossed a coin 4040 times resulting in 2048 heads and 1992 tails which gives a percentage of head up of 50.69%. Karl Pearson, a statistician, flipped a coin 24,000 times resulting in 12,012 heads and 11,988 tails which gives a percentage of head up of 50.05%. During World War II, a South African mathematician named John Kerrich was imprisoned, during his incarceration he flipped a coin 10,000 times resulting in 5,067 heads and 4,933 tails which gives a percentage of head up of 50.67%.
Now imagine you want to check the probability of getting a head from a coin for yourself. It would certainly be a painful task to flip a coin thousands of times. With technology now available to us we can perform simulations and lots of them with relative ease. Check out the following simulation for a coin toss:
Simulating a coin is useful; however, the true power of simulations in in modeling of real-world scenarios that we cannot solve directly. Simulations are a useful and legitimate mathematical model for statisticians and are regularly used in the real-world. Simulations are often used when the scenario is inaccessible, dangerous or too expensive to carry out.
Setting up a simulation
When we seek to simulate a scenario we need to make sure we have considered:
While this list may seem long, the procedure of a simulation is relatively simple. Decide how you will simulate the problem, perform the simulation, collect data, and finally interpret the data to approximate the probability.
Simulation methods
We can use a variety of common objects to simulate complex probability problems. In most cases we are using the method to generate a random number which we assign meaning to. The following examples are not exhaustive and others may also be possible:
Coin tosses
When you identify only two possible outcomes in the scenario you wish to model, coin tosses are an excellent choice. For example, you may wish to simulate a family with four children and determine the probability of having at least 2 girls. Here you might define 'Tail' for girl and 'Head' for a boy, then all you need to do is flip 5 coins to determine the gender of each of the five children - easy!
Dice
A six-sided die can be used to simulate a scenario with six possible outcomes, or three outcomes if you assign two numbers to each outcome. If you wish you can use two, or even three, dice to simulate more complex probability problems. While it is possible to get dice with seven sides of even twelve, it is probably easier to use a random number generator. One possible simulation a die can easily perform is the number of people living in a house.
Spinners
Within reason, custom made spinners can be made to simulate any amount of outcomes (numbers); however, the validity of the simulation relies on each outcome having exactly the same area.
Figure 1 - An eight-sided spinner
Spinners can also be found online, such as the one located here. If you wish to simulate more complex systems you can use two spinners. The scenarios that spinners can simulate is very similar to using dice; however, there is more flexibility in the numbers that are generated.
Random number generators
Random number generators are the most versatile way to generate usable data for a simulation. Computers, including calculators, can easily generate hundred or even thousands of random numbers for our simulation. Perhaps the best feature is the ability to set an interval of where the numbers can be generated from; for example, numbers between 12 and 18.
The Casio ClassPad II can be used to generate a list of random numbers using the randList() function from the catalog. The required input is:
randList(<Number to generate>,<lower boundary>,<upper boundary>)
For example, randList(4,1,10) will generate 4 number between 1 and 10 inclusive:
Figure 2 - randList() function on the Casio ClassPad II
Spreadsheets and other software
Spreadsheets are an excellent way of organising data in a simulation. Generally, the data will still be produced using a random number generator (in Microsoft Excel excel we use randbetween(<bottom>,<top>)). The benefits of a spreadsheet is the ability to manipulate the numbers to represent more complex systems.
Other software, such as GeoGebra can also be used for probability simulations. Once again, the basis of the simulation will often be the generation of random numbers. However, GeoGebra also allows for a geometric representation to enhance the simulation. An example simulation using GeoGebra is given below.
Data handling
Once you have performed the simulation for a sufficiently large number of trails (at least 50), you need to interpret the data you have collected. It is generally most efficient if you can organise the data using a spreadsheet; however, if this is not possible use a table or similar. Next, we need to interpret the output data from the simulation. As this is a probability simulation, you will generally need to identify the number of outcomes that satisfy an event and use that number to determine a probability:
More complex data handing is also possible, one possible case is explored in Activity 13G.1.
Complex simulations
The level of complexity at which you can simulate real-world scenarios is limited only by your knowledge and availability of resources. Presented below is an example of a complex systems modeled by computer programs which you can easily use to find probabilities.
Random Walks
Random walks are a mathematical representation of a path resulting from a random succession of steps. Random walks are used in a variety of scientific fields including biology, chemistry, physics, economics, ecology, computer science and psychology. For example, in biology random walks can be used to model a scavengers path in the wild.
Ant in a circle simulation
An ant is sitting in the middle of a circle of radius 3 meters. Every minute, the ant pick a random direction and moves in a straight line for 1 meter. On average, how long does it take for the ant to leave the circle? What is the probability the ant will leave the circle in 8 or less minutes?
Now the mathematics required for this type of is very complex; however, we can use a simulation and rule a number of trials to determine the average amount of time that it takes for the ant to leave the circle. The following GeoGebra worksheet will simulate the ant (we will take the time at the end of the minute in which the ant has left the circle):
Have a go at simulating the ant leaving the circle 20 times. Record the data and calculate the average (mean - link to S15) length of time required for the ant to leave the circle. Using the same 20 data points determine the probability that the ant leaves the circle in 8 or less minutes. You may also like to answer the same questions with more data point (say 50).
The simulation can also be conducted using tessellations and using the edges of the regular polygons as paths. A die can then be used to randomly determine which path is walked along from each junction. Two potential tessellations include hexagons (3 random directions) and triangles (6 random directions):
Figure 3 - Using tessellations to simulate a random walk
13G - Exercises:
Success criteria:
You will be successful if you can: