CHAPTER
10
Simulation
Introduction
Instead of studying actual situations that sometimes might be too costly, too
dangerous, or too time consuming, researchers create similar situations using
random devices so that they are less expensive, less dangerous or less time
consuming. For example, pilots use flight simulators to practice on before
they actually fly a real plane. Many video games use the computer to simulate
real life sports situations such as baseball, football, or hockey.
Simulation techniques date back to ancient times when the game of chess
was invented to simulate warfare. Modern techniques date to the mid-1940s
when two physicists, John von Neuman and Stanislaw Ulam developed si-
mulation techniques to study the behavior of neutrons in the design of atomic
reactors.
Mathematical simulation techniques use random number devices along
with probability to create conditions similar to those found in real life.
177
Copyright © 2005 by The McGraw-Hill Companies, Inc. Click here for terms of use.
Random devices are items such as dice, coins, and computers or calculators.
These devices generate what are called random numbers. For example, when a
fair die is rolled, it generates the numbers one through six randomly. This
means that the outcomes occur by chance and each outcome has the same
probability of occurring.
Computers have played an important role in simulation since they can
generate random numbers, perform experiments, and tally the results much
faster than humans can. In this chapter, the concepts of simulation will be
explained by using dice or coins.
The Monte Carlo Method
The Monte Carlo Method of simulation uses random numbers. The steps are
Step 1: List all possible outcomes of the experiment.
Step 2: Determine the probability of each outcome.
Step 3: Set up a correspondence between the outcomes of the experiment
and random numbers.
Step 4: Generate the random numbers (i.e., roll the dice, toss the coin,
etc.)
Step 5: Repeat the experiment and tally the outcomes.
Step 6: Compute any statistics and state the conclusions.
If an experiment involves two outcomes and each has a probability of
1
2
,
a coin can be tossed. A head would represent one outcome and a tail the
other outcome. If a die is rolled, an even number could represent one
outcome and an odd number could represent the other outcome. If an
experiment involves five outcomes, each with a probability of
1
5
, a die can be
rolled. The numbers one through five would represent the outcomes. If a six
is rolled, it is ignored.
For experiments with more than six outcomes, other devices can be used.
For example, there are dice for games that have 5 sides, 8 sides, 10 sides,
etc. (Again, the best device to use is a random number generator such as a
computer or calculator or even a table of random numbers.)
EXAMPLE: Simulate the genders of a family with four children.
SOLUTION:
Four coins can be tossed. A head represents a male and a tail represents
a female. For example, the outcome HTHH represents 3 boys and one girl.
CHAPTER 10 Simulation
178
Perform the experiment 10 times to represent the genders of the children of 10
families. (Note: The probability of a male or a female birth is not exactly
1
2
;
however, it is close enough for this situation.) The results are shown next.
Trial Outcome Number of boys
1 TTHT 1
2 TTTT 0
3 HHTT 2
4 THTT 1
5 TTHT 1
6 HHHH 4
7 HTHH 3
8 THHH 3
9 THHT 2
10 THTT 1
Results:
No. of boys 01234
No. of families 14221
In this case, there was one family with no boys and one family with four
boys. Four families had one boy and three girls, and two families had two
boys. The average is 1.8 boys per family of four.
More complicated problems can be simulated as shown next.
EXAMPLE: Suppose a prize is given under a bottle cap of a soda; however,
only one in five bottle caps has the prize. Find the average number of bottles
that would have to be purchased to win the prize. Use 20 trials.
CHAPTER 10 Simulation
179
SOLUTION:
A die can be rolled until a certain arbitrary number, say 3, appears. Since the
probability of getting a winner is
1
5
, the number of rolls will be tallied. The
experiment can be done 20 times. (In general, the more times the experiment
is performed, the better the approximation will be.) In this case, if a six is
rolled, it is not counted. The results are shown next.
Trial Number of rolls until
a 3 was obtained
11
26
35
44
511
65
71
83
97
10 2
11 4
12 2
13 4
14 1
15 6
16 9
17 1
18 5
19 7
20 11
Now, the average of the number of rolls is 4.75.
CHAPTER 10 Simulation
180
EXAMPLE: A box contains 3 one dollar bills, 2 five dollar bills, and 1 ten
dollar bill. A person selects a bill at random. Find the expected value of the
bill. Perform the experiment 20 times.
SOLUTION:
A die can be rolled. If a 1, 2, or 3 comes up, assume the person wins $1. If a
4 or 5 comes up, assume the person wins $5. If a 6 comes up, assume the
person wins $10.
Trial Number Amount
13$1
2 6 $10
33$1
4 6 $10
54$5
61$1
7 6 $10
84$5
94$5
10 3 $1
11 6 $10
12 1 $1
13 2 $1
14 5 $5
15 5 $5
16 3 $1
17 1 $1
18 2 $1
19 6 $10
20 3 $1
The average of the amount won is $4.25.
CHAPTER 10 Simulation
181