Sie sind auf Seite 1von 30

C1

Introduction to
Simulation
C
Uncertainty and Risk in Decision Making C2
Simulation Overview and Software C2
Simulation Modeling Process C3
Random Number Generation in Excel C4
Continuous Probability Distributions C8
Application of Simulation to Decision Making C12
Other Applications of Simulation C21
Simulation within OM: Putting It All Together C21
Introduction to
Simulation
WHAT S IN FOR ME? OM
S U P P L E M E N T
ACC FIN MKT OM HRM MIS
After completing this supplement you should be able to
Explain why simulation is a valuable tool for decision making.
Dene the steps involved in the simulation modeling process.
Generate random numbers from various distributions in Excel.
Develop and run a simulation model in Excel.
Analyze the results from a simulation in Excel. 5
4
3
2
1
LEARNING OBJECTIVES
SUPPLEMENT OUTLINE
ancmat03.qxd 11/16/06 3:28 PM Page C1
UNCERTAINTY AND RISK IN DECISION MAKING
C2 SUPPLEMENT C INTRODUCTION TO SIMULATION
Computer simulation
A methodology that evaluates
the performance of a system
when one or more input
values are uncertain.
H
ow do you deal with uncertainty in your everyday life? For example, you need to
complete several assignments for different classes. You might estimate the time
that each assignment will take in order to budget your time. You have probably en-
countered a situation in which an assignment actually took longer than you or your
instructor estimated. This may have had an effect on your performance on other as-
signments.
When there is uncertainty present, such as uncertainty in the amount of time nec-
essary to complete an assignment, decisions become more complex. No longer can we
rely on xed values. We must be willing to consider variation in estimates. For exam-
ple, you might estimate that an assignment will take between two and four hours. If
you do this for several assignments, the key question is how long it will take to com-
plete all assignments. Simulation is a tool that can directly take into account the un-
certainty in a situation, incorporating the uncertainties from multiple sources. It has
become one of the most useful analytical techniques in operations management for
analyzing facility layouts, testing scheduling methods, and other important questions.
Managers face decisions every day involving uncertainty. If a company is considering
expanding a facility, there is uncertainty about whether future demand will be high
enough to make the expansion nancially attractive. The decision to expand, however,
must be made before it is known what future demand will be. The uncertainty in de-
mand implies the risk that the company will be hurt nancially. Quantitative models
can provide tremendous insight and assistance in decision making. Unfortunately,
many quantitative models ignore the uncertainty present in the real situations. Some-
times this uncertainty is taken into account after a model is built when some different
what-if scenarios are considered, or a sensitivity analysis is conducted, using methods
similar to those discussed in Supplement A. However, oftentimes there is uncertainty
about a number of factors, and it is difcult to do a complete scenario analysis. Com-
puter simulation is a methodology that allows one to model the uncertainty directly
and obtain a clear picture of the effect of that uncertainty on the output quantities
of a model. That is, simulation allows a decision maker to accurately determine the ef-
fects of the uncertainty present in a situation.
A computer simulation is a model that mimics what might happen in reality. In the
broadest sense, every mathematical model is really a simulation. However, in this
supplement we restrict ourselves to situations in which there is some uncertainty or
randomness about some aspect of the system under consideration and we want to
model that uncertainty directly. For example, future demand is uncertain in most
business planning situations. Customers arrive to a restaurant drive-through window
according to some random process rather than being equally spaced in time. Simula-
SIMULATION OVERVIEW AND SOFTWARE
ancmat03.qxd 11/16/06 3:28 PM Page C2
tion allows us to model this random behavior and compute system performance
measures, providing valuable information for decision makers. Simulation is one of
the most commonly used analytical tools for complex systems.
This supplement focuses on spreadsheet-based simulation models. Spreadsheet
simulation is well suited to analyze many operational problems. We will apply Monte-
Carlo Simulation, which repeatedly takes samples from known probability distribu-
tions for the random parameters in a problem and computes the resulting output
measures. Examples of decision situations amenable to Monte-Carlo Simulation in-
clude location and expansion decisions, inventory analyses, project planning, and rela-
tively simple waiting line (queuing) systems. All of these situations typically involve
uncertainty. In this supplement we will develop, run, and analyze these simulation
models using only built-in Excel functionality. However, you should be aware that
there are Excel add-ins available for simulation that provide more functions for prob-
ability distributions and analysis of the simulation results and eliminate some of the
routine tasks involved in running the simulation model. Two leading Excel add-ins are
Crystal Ball (http://www.decisioneering.com) and @Risk (http://www.palisade.com).
Although relatively complex systems can be analyzed in spreadsheets, there are
many software products available that are better able to handle large, complex sys-
tems. Many of these products employ what is known as discrete-event simulation,
which is a methodology for modeling how the state of the system under investigation
changes as different events (such as customer arrivals or departures) occur. For exam-
ple, if you were planning the layout and operation of an entire new production or ser-
vice facility, modeling the supply chain of a company, or reengineering complex
business processes, a stand-alone simulation product using discrete-event simula-
tion would be a better choice than a spreadsheet model. Products more suitable for
complex systems modeling include ProModel (http://www.promodel.com), Extend
(http://www.imaginethatinc.com), and ProcessModel (http://www.processmodel.com).
OR/MS Today (http://www.lionhrtpub.com/ORMS.shtml), a publication of the Insti-
tute for Operations Research and Management Science (INFORMS), periodically
publishes simulation software surveys.
SIMULATION MODELING PROCESS C3
Monte-Carlo Simulation
A simulation that repeatedly
samples from probability
distributions and computes
the resulting performance
measures of the system.
Discrete-event simulation
A methodology that models
the state of a system as it
changes as a result of certain
events that occur randomly
in time.
SIMULATION MODELING PROCESS
The process of developing and using a spreadsheet-based simulation model is similar
to that for a regular spreadsheet model (see Supplement A). The key difference is that
a simulation model directly incorporates the randomness or uncertainty present in
the situation. Therefore, the output of a simulation model is not a single number, but
rather a probability distribution. Figure C-1 shows a schematic of a simulation model.
Typically, there are certain inputs that are xed, that is, not subject to uncertainty.
For example, we may know for certain the price we must pay for a product. In addi-
tion, there are also one or more inputs that are random. For example, we may not
know the exact level of demand, but we can use our knowledge of the situation to de-
scribe the possible values of demand using a probability distribution (just as we do
not know the outcome of a single roll of a die beforehand, but we can describe the
probability distribution of possible outcomes). Since at least one of the inputs is ran-
dom, this implies that the output of the model is also random. The output of a simu-
lation analysis is really the probability distribution of possible output values, rather
than a single number. This gives the decision maker a much clearer picture of the risk
involved in a situation than is possible with a regular model.
ancmat03.qxd 11/16/06 3:28 PM Page C3
Briey, the simulation modeling process in a spreadsheet involves the following
steps. Just as in any modeling and analysis activity, sometimes it is necessary to loop
back to a previous step.
Develop a deterministic spreadsheet model.
Determine the appropriate probability distributions to use for the random in-
puts to the model.
Modify the deterministic model by incorporating the random inputs using the
probability distributions.
Recalculate the model many times to generate many possible values of the model
output(s). Each single recalculation is called a trial or replication.
Analyze the possible output values by considering the summary statistics and the
probability distribution of the output(s).
C4 SUPPLEMENT C INTRODUCTION TO SIMULATION
Random (Uncertain)
Inputs
Outputs/Performance
Measures
Fixed (Known) Inputs
Simulation
Model
Decision
Variables
Simulation model schematic
FIGURE C-1
Deterministic
spreadsheet model
A logically correct and
complete model, but without
any randomness built into it.
RANDOM NUMBER GENERATION IN EXCEL
The foundation of any simulation model is random number generation. In order to
create simulations of real systems, we must have a way to mimic how they behave in
the real world. For example, consider the act of tossing a coin. There are two possible
outcomes, heads and tails, with equal probability. How can we simulate this activity,
generating outcomes that mimic what might happen if we tossed a real coin? While
this is a very simple situation, the basic concept applied here is exactly the same as is
used for more complex situations.
The key to modeling any random event hinges on generating random values uni-
formly distributed between 0 and 1. Well let X be a specic random value from this
distribution between 0 and 1, denoted U(0, 1). If we can generate values of X, then
logic and mathematics can be applied to convert these values into the real outcomes.
For example, if X is between 0.0 and 0.5, we would consider that to be a heads, and if
X is between 0.5 and 1.0, we would consider it to be tails (the reverse denition of
heads and tails also works because of the equal probability of the event).
Fortunately, Excel has a built-in function to generate values from the U(0, 1) distri-
bution. This function is written RAND(), where the parentheses are required and
nothing is put between them. The parentheses are there to indicate to Excel that we
are entering a function. Each time the RAND function is calculated, a different num-
ber between 0 and 1 is the result.
ancmat03.qxd 11/16/06 3:28 PM Page C4
Figure C-2 shows fty numbers generated using the RAND function. The function
was entered into one cell and copied to all the others. So, although exactly the same
function is entered into each of these cells, each resulting value is different. To recalcu-
late the set of numbers again, press the F9 key. Excel independently calculates each one
of the functions. Therefore, we can use each of these values to determine a heads or
a tails.
Problem-Solving Tip: If you are working through this supplement at the computer, your numeri-
cal results for all the examples will differ from what is shown in the text. This is the nature of ran-
dom numbers and simulation.
A histogram of values from the RAND function should show the values to be ap-
proximately uniformly distributed between 0 and 1. Figure C-3 shows a histogram
based on fty values of the RAND function. There are ten bins in this histogram,
and the labels on the horizontal axis are the upper end point of each bin. Therefore,
the column for 0.2 indicates there were four values 0.10 but 0.20. If the values
RANDOM NUMBER GENERATION IN EXCEL C5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
A B C D E
50 Random Numbers Between 0 and 1
Using =RAND() Function
0.0315 0.6994 0.9362 0.7039 0.8702
0.7175 0.2131 0.4071 0.2706 0.6158
0.4030 0.1604 0.6318 0.4906 0.9260
0.7933 0.7953 0.9929 0.7353 0.8710
0.0286 0.9634 0.3228 0.7877 0.9788
0.1769 0.8939 0.6887 0.4608 0.1845
0.0933 0.0601 0.9990 0.9388 0.7421
0.0493 0.0077 0.6724 0.8535 0.8682
0.2417 0.4332 0.2643 0.7290 0.1131
0.8998 0.6985 0.2092 0.5859 0.8812
A4: =RAND()
Copied to A4:E13
Fifty U(0,1) random numbers
FIGURE C-2
0.1
Upper End of Category
F
r
e
q
u
e
n
c
y
8
7
6
5
4
3
2
1
0
Histogram
(50 Random Values from = RAND() function)
0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Histogram of fty values from
RAND() function
FIGURE C-3
ancmat03.qxd 11/16/06 3:28 PM Page C5
were perfectly uniformly distributed, there would be ve observations in each of these
ranges. However, as you know, if you ip a coin fty times, you will generally not get
exactly twenty-ve heads and twenty-ve tails.
As more values from RAND are generated, the resulting histogram should become
more and more uniform. Figure C-4 is a histogram generated from 5000 values of the
RAND function. Notice that these columns are much more even in height than for the
50-value histogram. Just as a pollster obtains a better representation of the views of
the entire population by interviewing more people, we obtain a truer picture of the
real system if we compute many replications of a simulation model.
Bernoulli Distribution: Simulating the Flip of a Coin
Returning to the coin ip, how do we simulate this? Taking one value from U(0, 1), if
that value is 0.5, we can consider that a heads; otherwise, well consider it a tails.
This can be done in Excel using the IF function, as shown in Figure C-5. This gure
also shows the results from 100 coin ips, by copying the respective formulas down
and counting the numbers of heads and tails. Note that in this gure some of the rows
have been hidden (Format/Row/Hide). We use the COUNTIF function to count the
numbers of heads and tails. The rst argument in this function is the count range and
C6 SUPPLEMENT C INTRODUCTION TO SIMULATION
Spreadsheet for coin ip
example: Bernoulli
distribution
FIGURE C-5
0.1
Upper End of Category
F
r
e
q
u
e
n
c
y
600
500
400
300
200
100
0
Histogram
(5000 Random Values from = RAND() function)
0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
1
2
3
4
5
6
7
8
9
10
11
102
103
A B C D E F G H
Coin Toss Simulation
U(0,1) H/T
0.010 Heads
0.031 Heads
0.908 Tails
0.936 Tails
0.196 Heads Number Heads 43
0.667 Tails Number Tails 57
0.713 Tails Total 100
0.355 Heads
0.151 Heads
0.757 Tails
A4: =RAND()
B4: =IF(A4<0.5,"Heads","Tails")
E8: =COUNTIF(B$4:B$103,"Heads")
E9: =COUNTIF(B$4:B$103,"Tails")
Histogram of 5000 values from
RAND function
FIGURE C-4
ancmat03.qxd 11/16/06 3:28 PM Page C6
the second is the criteria. In this particular set of 100 coin ips, we had 43 heads and
57 tails. If we recalculate the spreadsheet (by hitting the F9 key), we will generate 100
new coin ips, and our total heads and tails will probably be different.
There is nothing special about the 0.5 probability used in the coin flip situation.
We might be simulating a customer service operation, where the probability of a
customer making a complaint is 0.01. In a model, a complaint would likely trigger a
conflict-resolution process, which would involve additional employee resources,
time, and costs. Any situation involving two outcomes can be modeled in this way.
Another example is if we have a process that produces defective items with some
probability. A random variable that can have two outcomes is called a Bernoulli
random variable.
Discrete Uniform Distribution: Simulating the Roll of a Die
What if there are more than two outcomes? For example, how would we model the
outcome from a normal six-sided die? The outcomes from a single die come from a
discrete uniform distribution, since there is a finite number of outcomes, each
having the same probability. Conceptually, the random number generation process
is the same as for the coin flip. We generate a U(0,1) random number (say, X) and
then translate that number into one of the numbers 1, 2, . . . , 6 with equal likeli-
hood. Therefore, if 0 X 0.167 (i.e., 1/6), then the die outcome is 1. If 0.167
X 0.333, then the die outcome is 2, and so on, up through if 0.833 X 1, the
die outcome is 6. This could be accomplished in Excel by modifying the IF state-
ment used for the coin flip example. However, we would need to nest multiple IF
functions to accomplish this.
Fortunately, there is a better way using Excels VLOOKUP function. The
VLOOKUP (vertical lookup) function looks up a value in a table and returns a corre-
sponding value from the same row. For example, we could use it to look up a cus-
tomer number and return the number of items that customer has purchased. The
VLOOKUP function has the form
The lookup_value is the value to be found in the rst column of the table_array. The
table_array is the table of information in which data is looked up. The col_index_num
is the column number in the table_array from which the matching value is returned.
A col_index_num of 1 returns the value in the rst column in table_array; a
col_index_num of 2 returns the value in the second column in table_array, and so
on. For more information, see the Excel help system.
Figure C-6 shows how the simulation of a die roll can be conducted. As before, we
have copied the logic down to represent 100 rolls of the die (some rows have been
hidden) and counted the number of each outcome. We know in a limited sample we
will not have exactly 16.67 percent of the rolls corresponding to each possible out-
come. The VLOOKUP function in cell B4, VLOOKUP(A4,E$7:G$12,3), converts
the U(0,1) random number in cell A4 (the lookup_value) to a simulated outcome of
the die. It looks in the rst column of the table_array E$7:G$12. Specically, it looks
in cells E$7:E$12 for the greatest value that is less than or equal to the value in A4.
Since A4 contains the value 0.607, the VLOOKUP function stops at the 0.500 in cell
E10, this being the greatest value that is also less than or equal to 0.607. Then, since
3 is the col_index_num, the VLOOKUP function returns the value in column 3 of
the table, in the same row as the value 0.500 (i.e., the value 4 in cell G10). Similarly,
VLOOKUP(lookup_value, table_array, col_index_num)
RANDOM NUMBER GENERATION IN EXCEL C7
Bernoulli random
variable
A random variable that can
assume only two values.
Discrete uniform
distribution
A probability distribution
in which there are a nite
number of equally spaced
outcomes, each with equal
probability.
ancmat03.qxd 11/16/06 3:28 PM Page C7
General discrete
distribution
A probability distribution
with (usually) a nite
number of possible
outcomes, not necessarily
with equal probabilities.
cell B5 has the value of 1, since the value in A5 is 0.127. The VLOOKUP functions
stops at E$7 and returns the value in the third column, G$7.
General Discrete Distribution
Just as there was nothing special about the 0.5 probability for the coin ip example,
there is nothing special about the equal probability of each outcome in the roll of the
die. The outcomes could be the demand for a product with different probabilities for
each. Figure C-7 shows an example. The only difference is that there are now seven
possible outcomes, and the probabilities for the outcomes are not all the same. Such a
distribution is called a general discrete distribution. Demand can be one of the val-
ues 100, 150, . . . , 400, with individual probabilities shown in cells D7:D13. Obviously,
an important thing to do is to make sure the probabilities sum to 1.
C8 SUPPLEMENT C INTRODUCTION TO SIMULATION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
102
103
A B C D E F G
Die Roll Simulation
U(0,1) Roll
0.607 4
0.127 1 Cumulative Probability Distrib
0.005 1 Probability Begin End Outcome
0.911 6 0.167 0.000 0.167 1
0.533 4 0.167 0.167 0.333 2
0.505 4 0.167 0.333 0.500 3
0.496 3 0.167 0.500 0.667 4
0.167 2 0.167 0.667 0.833 5
0.198 2 0.167 0.833 1.000 6
0.294 2
0.631 4
0.924 6 Results of Simulation
0.421 3 Roll Frequency Fraction
0.245 2 1 18 0.18
0.453 3 2 15 0.15
0.556 4 3 24 0.24
0.663 4 4 20 0.20
0.077 1 5 10 0.10
0.711 5 6 13 0.13
0.776 5 100
0.385 3
0.468 3
0.352 3
0.668 5
0.440 3
0.008 1
0.503 4
0.614 4
A4: =RAND()
(copied down)
E17: =COUNTIF(B$4:B$103,D17)
(copied down)
F17: =E17/E$23
(copied down)
E8: =F7
F7: =E7+D7
(copied down)
B4: =VLOOKUP(A4,E$7:G$12,3)
E23: =SUM(E17:E22)
CONTINUOUS PROBABILITY DISTRIBUTIONS
The three examples so far have been of discrete distributions, which are distributions
that have a countable number of possible outcomes. Loosely speaking, most people
think of discrete distributions as having a nite number of possible outcomes, but a
Spreadsheet for die roll example:
discrete uniform distribution
FIGURE C-6
ancmat03.qxd 11/16/06 3:28 PM Page C8
Discrete distribution
A distribution that has a
countable number of
possible outcomes.
Continuous distribution
A probability distribution
that can take on any
fractional or whole value.
distribution with outcomes 0, 1, 2, . . . is also considered to be discrete. Discrete distri-
butions are valuable for simulating events such as whether we get awarded a contract
or not, the number of days required for some task, or the number of customers arriv-
ing in a store in some given period of time.
The other major type of probability distribution is a continuous distribution,
which can take on any value, perhaps within some range. Actually, the RAND function
generates a continuous uniform distribution between 0 and 1. There are many contin-
uous distributions, but some common ones used in simulation include the uniform
distribution, the normal distribution, and the exponential distribution. Figure C-8 il-
lustrates these types of distributions.
Simulating Continuous Probability Distributions
The RAND function is a continuous uniform probability distribution between 0 and
1, or U(0,1). In general, a continuous uniform distribution can be between any two
values, for instance, a and b. We would refer to this as U(a, b). To generate a U(a, b)
random number in Excel, we can use the formula
The quantity (b a) is the total range of the distribution. Multiplying by RAND() is
essentially taking a fraction of this range. Adding a to this value then results in a
a (b a)*RAND()
CONTINUOUS PROBABILITY DISTRIBUTIONS C9
Continuous uniform
distribution
A probability distribution that
ranges between a minimum
and maximum value, with any
value in between equally likely
to occur.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
102
103
A B C D E F G
General Discrete Distribution
U(0,1) Demand
0.034 100
0.549 250 Cumulative Distribution
0.039 100 Probability Begin End Demand
0.356 200 0.05 0.00 0.05 100
0.569 250 0.10 0.05 0.15 150
0.207 200 0.25 0.15 0.40 200
0.139 150 0.30 0.40 0.70 250
0.049 100 0.15 0.70 0.85 300
0.534 250 0.10 0.85 0.95 350
0.477 250 0.05 0.95 1.00 400
0.036 100 1.00
0.470 250
0.772 300
0.066 150 Results of Simulation
0.682 250 Demand Frequency Fraction
0.389 200 100 10 0.10
0.450 250 150 8 0.08
0.962 400 200 18 0.18
0.502 250 250 36 0.36
0.651 250 300 18 0.18
0.738 300 350 5 0.05
0.644 250 400 5 0.05
0.419 250 100
0.545 250
0.800 300
A4: =RAND()
B4: =VLOOKUP(A4,E$7:G$13,3)
Spreadsheet for general discrete
distribution
FIGURE C-7
ancmat03.qxd 11/16/06 3:28 PM Page C9
number between a and b. For example, if the time to complete a task was uniformly
distributed between 10 and 50 minutes, we would generate a U(10, 50) random
number to represent this time. Then the corresponding formula would be
If RAND() equals 0, this formula results in a time of 10 minutes; if RAND() equals
1, the formula computes to 50 minutes. Similarly, if RAND() equals 0.5, the formula
computes to 30, which is halfway between 10 and 50. Essentially, RAND() is acting like
a fraction, and adding a fraction of the value (b a) to the minimum value a. Figure
C-9 shows a histogram of 250 simulated values from a U(10, 50) distribution. Note
the general shape of this distribution is rectangular, indicating a relatively even distri-
bution of values across this range.
The previous section showed how to generate values from a general discrete distri-
bution using the VLOOKUP function. If a discrete distribution is between two inte-
gers, with each value equally likely, a simpler approach is possible. This approach
takes advantage of the logic for the continuous uniform distribution but rounds the
10 (50 10)*RAND()
C10 SUPPLEMENT C INTRODUCTION TO SIMULATION
Normal Distribution, mean = 80, stdev = 10
40 60 100 120 80
Uniform Distribution, minimum = 10,
maximum = 50
Exponential Distribution, mean = 10
10 10 50 70 30
0 10 50 60 20 30 40
Examples of continuous probability
distributions
FIGURE C-8
ancmat03.qxd 11/16/06 3:29 PM Page C10
result down to the nearest integer. If we want to generate a discrete uniform distribu-
tion between 10 and 50, with only integer values possible, we can use the following
formula:
The INT function rounds any value down to the nearest integer. Besides the use of
this function, the only change is in the (50 10 1) portion. The 1 is needed be-
cause of this rounding down, so that all values between 10 and 50 (including 10 and
50 themselves) are possible.
Simulating other distributions is conceptually the same as we have seen. First a
U(0, 1) random number is generated, and this number is transformed into a random
number from the desired distribution. For other distributions, the mathematics of the
process becomes more difcult, but for two additional distributions Excel functions
can be readily used.
The normal distribution is often used to model many real-world phenomena,
such as the delivery time from a supplier, the demand for a product or service, or the
cost of raw material. To generate normally distributed random numbers in Excel, you
need to know the mean, , and standard deviation, s. Then the following formula gen-
erates a normal random number, denoted N(, ):
The NORMINV function is the inverse normal function. RAND() acts like a prob-
ability in this function (note that it is between 0 and 1), and the NORMINV function
returns the value of the distribution corresponding to the point at which the area
under the curve is equal to the value from RAND. Figure C-10 shows a histogram
from 250 simulated values from a N(80, 10) distribution. Note the familiar bell
shape of this histogram.
The exponential distribution is a very common distribution in the modeling of
customer arrivals to service systems, such as a call center or a drive-through window.
Specically, it is used to represent the time between successive customer arrivals,
called the interarrival time. The mean interarrival time is denoted , and we would
refer to such a distribution as EXP(). To generate exponentially-distributed random
numbers, the following formula should be used:
*LN(RAND())
NORMINV(RAND(), , )
INT (10 (50 10 1)*RAND())
CONTINUOUS PROBABILITY DISTRIBUTIONS C11
12.08
Midpoint of Range
14.0%
12.0%
10.0%
8.0%
6.0%
4.0%
2.0%
0.0%
Frequency (%, n = 250)
16.04 19.99 23.95 27.90 31.86 35.82 39.77 43.73 47.68
Histogram of 250 simulated
values from a U(10, 50)
distribution
FIGURE C-9
Normal distribution
A distribution characterized
by a mean and standard
deviation, indicated by the
familiar bell shape with a
large density around the
mean and with diminished
density as one moves further
from the mean.
Exponential distribution
A distribution characterized
by a mean, with possible
outcomes all positive.
ancmat03.qxd 11/16/06 3:29 PM Page C11
In this formula, LN is the Excel function for the natural logarithm. The minus sign
is needed because the natural logarithm of a number between 0 and 1 is negative. Fig-
ure C-11 shows a histogram of 250 simulated values from an EXP(10) distribution. All
values are greater than zero. The distribution starts off with a high frequency of obser-
vations near zero, but quickly tails off. This tends to match the arrival behavior of
many service systems, where frequently the time between successive customer arrivals
is quite small.
For reference, Table C-1 summarizes the formulas needed to generate the probabil-
ity distributions discussed here. Commercial add-ins such as Crystal Ball and @Risk
can generate many other distributions, but the ones provided here are some of the
most common.
C12 SUPPLEMENT C INTRODUCTION TO SIMULATION
55.45
Midpoint of Range
30.0%
25.0%
20.0%
15.0%
10.0%
5.0%
0.0%
Frequency (%, n = 250)
61.44 67.42 73.41 79.40 85.38 91.37 97.36 103.34 109.33
2.45
Midpoint of Range
50.0%
40.0%
10.0%
30.0%
20.0%
0.0%
Frequency (%, n = 250)
7.30 12.15 17.00 21.86 26.71 31.56 36.41 41.26 46.12
Histogram of 250 simulated
values from an EXP(10)
distribution
FIGURE C-11
Histogram of 250 simulated
values from a N(80, 10)
distribution
FIGURE C-10
APPLICATION OF SIMULATION TO DECISION MAKING
In this section we show how spreadsheet-based simulation can be used to analyze a situ-
ation involving uncertainty and risk. We will set up and solve a relatively simple
newsvendor problem. The newsvendor problem is one in which a retailer, for instance,
needs to purchase some quantity of an item prior to demand being known. If too few
are ordered, it will forgo potential prot. However, if too many are ordered, the excess
over the amount demanded must be heavily discounted. This fundamental problem
commonly occurs in retailing, such as when a store needs to order seasonal or perishable
merchandise. However, it also exists for manufacturers of products that decline in value
ancmat03.qxd 11/16/06 3:29 PM Page C12
after they are produced. For example, in the fast-changing electronics industry, if a com-
pany commits to manufacturing too many handheld computers, it will be left with
product that is worth only a fraction of what it was worth when produced. Even trans-
portation services such as airlines face a form of this problem, since airlines must decide
ahead of time how frequently to y a given route and which type of aircraft to use.
APPLICATION OF SIMULATION TO DECISION MAKING C13
Bernoulli IF(RAND()p,1,0) Returns the result, either 0 or 1,
of a single Bernoulli trial, where
p is the probability of success.
Used to model random events
with only two outcomes.
General Discrete VLOOKUP(RAND(), Returns one of the values
Lookup_Array,3) in the third column of the
Lookup_Array. The rst two
columns must contain the ranges
corresponding to the cumulative
probability distribution, as
shown in the examples.
Continuous Uniform a (b a)*RAND() Returns a value in the range
from a to b. Each value in this
range is equally likely to occur.
Exponential *LN(RAND()) Returns a value from an
exponential distribution with
mean . Often used to model
the time between events or the
lifetime of a device with a
constant probability of failure.
Normal NORMINV(RAND(),,) Returns a value from a normal
distribution with mean and
standard deviation .
Discrete Uniform INT (a (b a 1) Returns one of the integers
*RAND()) between a and b, inclusive. Each
value is equally likely to occur.
Excel Formulas to
Generate Common
Probability Distributions
TABLE C-1
Distribution Excel Function Description
EXAMPLE C.1
DG Outerwear
DG Outerwear must decide how many of a particular style and size of winter coat to order for the
coming season. Lead times in the industry are such that the order must be placed in June, well before
the actual realization of demand. Coats cost $75 for DG to purchase, and the planned sales price is
$100. If not enough coats are ordered, assume that the potential customer leaves without purchasing
a substitute coat. If too many coats are ordered, DG must discount the coats in order to sell them at
the salvage value. The demand for this size and style of coat is estimated to be between 20 and 40,
with each possibility equally likely. If coats must be salvaged, the salvage price may be $15, $20, $25,
or $30 with probabilities 0.05, 0.30, 0.50, and 0.15, respectively. Assume that all remaining coats will
sell at this salvage price. The approach DG has used in the past is to estimate the expected demand
and to order somewhat more than that number of coats. For this year, DG is considering ordering 35
coats, but wonders if that is really the best decision.
ancmat03.qxd 11/16/06 3:29 PM Page C13
Deterministic Model
We know several things in this problem: The purchase price is $75, and the regular
sales price is $100. The salvage price can be one of four quantities. Before the season
begins we do not know which value will be necessary to liquidate any remaining coats.
Demand is also uncertain, but we estimate that it will be between 20 and 40. We need
a model to be able to evaluate different purchase quantities. That is, purchase quantity
is the decision variable.
The rst step in setting up a simulation model is to build the model logic. We initially
ignore the uncertainty and focus on the spreadsheet logic. In particular, the logic needs
to compare the quantity purchased with the demand. The quantity sold at the regular
price, $100, will necessarily be the smaller of these two quantities, since we cannot sell
more than we purchase and we also cannot sell more than what customers are willing to
buy at the regular price. Once the quantity sold at the regular price is determined, we
can compute the number (if any) of remaining coats. These coats will be sold at the sal-
vage price. The model can then compute the total revenue, the total costs, and the prot.
Figure C-12 shows a deterministic model of this situation. For the demand and sal-
vage price cells (cells D17 and G17), we have just entered sample values. The focus
here is developing the correct logic for the situation. The formulas are listed here:
H17 B$5*E17
F17 B$8 E17
E17 MIN(B$8,D17)
Deterministic model for
DG Outerwear problem
FIGURE C-12
Before You Begin: In this problem, determine how many of a particular winter coat to
order for the coming season. You can place only one order because of the long lead time for this coat.
Your objective is to order the number of this type of coat that will provide the highest expected pay-
off. There is considerable uncertainty to model. Demand is represented by a uniform distribution,
with a low of 20 coats up to a maximum of 40. Salvage value for the coats is also uncertain, with val-
ues ranging from $15 up to $30. Use a simulation model to provide insight into what might happen
if 35 coats are ordered.
C14 SUPPLEMENT C INTRODUCTION TO SIMULATION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
A B C D E F G H I J
DG Winter Coats
Fixed Inputs Demand Distribution (Discrete Uniform)
Purchase Price of Coat $75 Minimum 20
Regular Sales Price $100 Maximum 40
Decision Variable Salvage Price Distribution (Discrete)
Purchase Quantity 35 Cumulative Distribution
Probability Begin End Price
0.05 0.00 0.05 $15
0.30 0.05 0.35 $20
0.50 0.35 0.85 $25
0.15 0.85 1.00 $30
1.00
Simulation Logic
Demand
Reg
Sales
Qty
Salv
Sales
Qty
Salv
Price
Reg
Rev
Salv
Rev Profit
30 30 5 $25 $3,000 $125 $500
ancmat03.qxd 11/16/06 3:29 PM Page C14
The formula in cell E17 results in 30, since there were only 30 customers willing to
purchase the coat at the regular price. Cell F17 computes the amount remaining as the
purchase quantity less the number sold at the regular price. Then the regular and sal-
vage revenues can be computed, followed nally by the prot. This model can cer-
tainly be used to do what-if analysis, but it does not take into account the uncertainty
of demand and salvage price.
Simulation Model
The model becomes a simulation model when we directly incorporate the uncertainty
of demand and salvage price. Figure C-13 shows this additional logic. Notice that we
have added columns for Replication and RN1, and RN2. for two random num-
bers from the U(0, 1) distribution. Other changes to the model are in the demand and
salvage price cells. The demand cell now generates a random integer uniformly dis-
tributed between 20 and 40, and the salvage price cell generates a random price from
the salvage price distribution. The new formulas are listed here:
Replicating the Model
Figure C-13 shows one replication of the simulation logic. A replication consists of
a single sampling of the random values from the applicable distributions, calculat-
ing the output of the model, and recording that result. That is, a single replication
represents one possible value of the profit. Just as a political pollster would never
G17: VLOOKUP(C17,E$10:G$13,3)
D17: INT(E$4 (E$5 E$4 1)*B17)
C17: RAND()
B17: RAND()
J17 H17 I17 (B$8*B$4)
I17 G17*F17
APPLICATION OF SIMULATION TO DECISION MAKING C15
Replication
Replication of a simulation
model consists of sampling
inputs from respective
probability distributions,
computing the logic of the
model, and recording the
resulting output value.
Simulation logic for
DG Outerwear problem
(one replication)
FIGURE C-13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
A B C D E F G H I J
DG Winter Coats
Fixed Inputs Demand Distribution (Discrete Uniform)
Purchase Price of Coat $75 Minimum 20
Regular Sales Price $100 Maximum 40
Decision Variable Salvage Price Distribution (Discrete)
Purchase Quantity 35 Cumulative Distribution
Probability Begin End Price
0.05 0.00 0.05 $15
0.30 0.05 0.35 $20
0.50 0.35 0.85 $25
0.15 0.85 1.00 $30
1.00
Simulation Logic
Replication RN1 RN2 Demand
Reg
Sales
Qty
Salv
Sales
Qty
Salv
Price
Reg
Rev
Salv
Rev Profit
1 0.003 0.992 20 20 15 $30 $2,000 $450 ($175)
ancmat03.qxd 11/16/06 3:29 PM Page C15
consider speaking to a single person to develop predictions on how the public at
large will vote, a simulation model never consists of just one replication. Rather, we
must perform many replications of the model in order to get a clearer picture as to
the likelihood of different profit levels. In Figure C-14, we have copied the logic for
a single replication down to generate 250 replications. Notice that the random num-
bers change for each replication, resulting in different demand, salvage price, and
profit values. We are really simulating the upcoming winter sales season 250 times in
order to obtain more insight into the likelihood of profit levels, assuming we pur-
chase 35 coats.
Problem-Solving Tip: How many replications should you run for a simulation? We have used 250
as a sample size. However, there is no simple answer to this question, although more is always better
in terms of the precision of the estimates. This is a statistical question, no different from the question
pollsters face in determining how many people to interview in order to achieve some level of preci-
sion in a survey. Obviously, it is easy to run additional replications of a simple model, but for com-
plex simulation models, the computation time of additional replications can become signicant.
(Some simulations can run for hours or even days.)
C16 SUPPLEMENT C INTRODUCTION TO SIMULATION
Completed simulation
model for DG Outerwear
problem
FIGURE C-14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
265
266
267
268
269
270
271
272
273
274
275
A B C D E F G H I J
DG Winter Coats
Fixed Inputs Demand Distribution (Discrete Uniform)
Purchase Price of Coat $75 Minimum 20
Regular Sales Price $100 Maximum 40
Decision Variable Salvage Price Distribution (Discrete)
Purchase Quantity 35 Cumulative Distribution
Probability Begin End Price
0.05 0.00 0.05 $15
0.30 0.05 0.35 $20
0.50 0.35 0.85 $25
0.15 0.85 1.00 $30
1.00
Simulation Logic
Replication RN1 RN2 Demand
Reg
Sales
Qty
Salv
Sales
Qty
Salv
Price
Reg
Rev
Salv
Rev Profit
1 0.911 0.701 39 35 0 $25 $3,500 $0 $875
2 0.279 0.724 25 25 10 $25 $2,500 $250 $125
3 0.064 0.585 21 21 14 $25 $2,100 $350 ($175)
4 0.595 0.355 32 32 3 $25 $3,200 $75 $650
5 0.404 0.405 28 28 7 $25 $2,800 $175 $350
6 0.932 0.302 39 35 0 $20 $3,500 $0 $875
249 0.544 0.795 31 31 4 $25 $3,100 $100 $575
250 0.084 0.823 21 21 14 $25 $2,100 $350 ($175)
Average $435
Standard Deviation $392
Minimum ($325)
Maximum $875
95% Confidence Interval on Average
Lower CL $386
Upper CL $483
ancmat03.qxd 11/16/06 3:29 PM Page C16
Recall from statistics that as the sample size is increased, precision improves, but at a decreasing
rate. This is because in the formula for the condence interval for the mean of a population, the
square root of the sample size appears in the denominator. Therefore, as this sample size increases,
the benet of increased precision takes more and more samples to obtain. For the problems covered
here, a sample size of 250 is usually sufcient, but 500 or even 1000 is even better. You should experi-
ment and see how much the width of the condence interval changes with a larger sample size.
Commercial add-in products allow you to specify a precision level, with the simulation automati-
cally stopping when this level is reached.
Analyzing the Results
After we have replicated the model, we need to compute summary statistics. These are
shown in Figure C-14. Generally speaking, it is a good idea to compute the average,
standard deviation, minimum, and maximum values of the simulation output(s). We
have also calculated a condence interval for the true average prot. Formulas for
these summary statistics are provided here:
If we purchase 35 coats, we see that our average, or expected, prot is $435. How-
ever, there is a relatively large standard deviation of $392. This implies that in any
given year, there is a signicant amount of uncertainty in the prot we will earn. Over
the course of 250 replications, the worst case is a loss of $325 and the best case a prot
of $875. We are 95 percent condent that the true average prot lies somewhere in the
interval from $386 to $483. Our estimate of the average prot is based on these 250
trials; if we were to perform additional replications, our estimate would become more
precise.
Problem-Solving Tip: After running a simulation model for the number of replications you desire,
oftentimes it is a good idea to freeze the random numbers upon which the simulation is based. If
you dont do this, the entire simulation will recalculate any time you change a value in a cell or even
open or close the le. To freeze the random numbers, rst highlight the cells to be frozen, choose
Edit/Copy and then Edit/Paste Special. In the Paste Special dialog box, select Values, and click OK.
Any functions, such as RAND(), in the cells you selected, will be replaced by the values that were
in there when you did the copy/paste operation. In this way you can run a simulation, freeze the re-
sults, and then perform more detailed analysis on the results.
That being said, sometimes you will want to leave the results of a simulation live so that every
time you make a change to a cell, the results will update. This is the case if you want to try out differ-
ent values for a decision quantity, for example.
J275: J$26811.96*J$269/SQRT(250)
J274: J$26821.96*J$269/SQRT(250)
J271: MAX(J$17:J$266)
J270: MIN(J$17:J$266)
J269: STDEV(J$17:J$266)
J268: AVERAGE(J$17:J$266)
APPLICATION OF SIMULATION TO DECISION MAKING C17
ancmat03.qxd 11/16/06 3:29 PM Page C17
We now have valuable information for DG, if it decides to purchase 35 coats. In
making this decision, DG must be willing to accept the uncertainty in profit as out-
lined. Is this the best order quantity? Since we have a flexible simulation model, it is
quite easy to try different quantities. The simulation results will automatically cal-
culate, along with the summary statistics. For the sake of simplicity, suppose DG
can order in increments of 5 coats. Therefore, DG will consider order quantities of
20, 25, 30, 35, and 40 coats. Summary statistics for these values are provided in
Table C-2.
From the table, we see that if 20 coats are ordered, a guaranteed $500 prot can be
achieved. This is not surprising, since we assume that demand is between 20 and 40
coats. For a 25-coat purchase quantity, average prot increases to $568, but standard
deviation of prot also increases, to $117. Simultaneously, minimum prot gets worse,
and maximum prot gets better. This should be intuitive after considering that we are
investing additional money in inventory, so there is a greater potential gain, but at the
same time the possibility of doing worse. If we purchase 30 coats, average prot de-
clines from the 25-coat option, but the standard deviation continues to rise. As we
move to the 35- and 40-coat purchases, average prot continues to decline, with the
standard deviation increasing.
Problem-Solving Tip: To recalculate a spreadsheet, press the F9 key. In a simulation model, this
will force all cells involving the RAND() function to recalculate, as well as any cells that depend on
them.
In light of these values, it would appear that purchasing 20 or 25 coats is the best al-
ternative. Purchasing 20 coats involves no uncertainty, and purchasing 25 allows max-
imizing expected prot. Surprisingly, even though 30 coats is the average of the
demand distribution, it is better in this case (because of the revenues and costs) to
purchase somewhat less than this quantity.
Suppose we decide to purchase 25 coats. What does the actual distribution of possi-
ble prot values look like? To determine this, we can generate a histogram of the prot
values, using the Tools/Data Analysis/Histogram tool. If Data Analysis does not appear
in the Tools menu of Excel, go to Tools/Add Ins, and put a check beside the Analysis
Tool Pack item. This histogram is shown in Figure C-15.
The histogram is really the probability distribution of prot, after considering the
uncertainty in demand and salvage price. At rst, this histogram appears very odd.
The vast majority (193 out of 250) of the observations have prot values greater than
$598, with the remainder being spread out rather evenly over the range from $225 to
C18 SUPPLEMENT C INTRODUCTION TO SIMULATION
20 $500 $0 $500 $500
25 $568 $117 $225 $625
30 $551 $264 $50 $750
35 $435 $392 $325 $875
40 $230 $460 $600 $1000
Summary Statistics of
Prot for DG Outerwear
Coat Problem
TABLE C-2
Purchase Standard
Quantity Average Deviation Minimum Maximum
ancmat03.qxd 11/16/06 3:29 PM Page C18
$598. Why is this? Recalling that the distribution of demand is uniform, it would seem
that the prot distribution should be uniform as well. However, this is clearly not the
case. The key point is that since we are purchasing 25 coats, there is sufcient demand
to sell all of those coats most of the time. In fact, demand will be 25 coats or more ap-
proximately 75 percent of the time (since demand ranges from 20 to 40 coats). As we
see, 193 times out of 250 (77 percent of the time) we appear to be earning the maxi-
mum possible prot of $625. The other 23 percent of the time (when demand is be-
tween 20 and 24 coats), prot is spread across the other possible values.
Using a Data Table to Run a Simulation
In this example, we developed the logic for a single replication and then copied that
entire logic down in order to run 250 replications. This worked because the logic for
this model was relatively simple and could be put into a single row. Most models are
more complex. Another way to run many replications is to use Excels Data Table fea-
ture, covered in Supplement A, where it is used for sensitivity analysis. Here we use it
to have Excel recalculate the logic many times, each time with different random num-
bers, and store the results in a table.
Figure C-16 shows the model with a Data Table used to do the replications. To do
this, we have started with the single-replication model, which was shown in Figure C-
13. The steps involved in using a Data Table for the simulation are as follows, assum-
ing the logic for a single replication is already complete:
1. Label two columns, one for replications and one for prot. In the replications
column, from A22 to A271, enter the numbers 1 . . . 250. This is done easily with
the Edit/Fill/Series command, with Series in Columns, Step value of 1, and Stop
value of 250. Note that we do not put anything in cell A21.
2. In cell B21, enter the formula J17. This simply references the prot value from
the simulation logic.
3. Select the range A21:B271. Be sure to include the top row in the selection. It is
really the formula in cell B21 that tells the Data Table what value youre inter-
ested in.
APPLICATION OF SIMULATION TO DECISION MAKING C19
Histogram of prot
values for a purchase
quantity of 25
FIGURE C-15
Bin Frequency
$225 3
$252 13
$278 1
$305 3
$332 5
$358 1
$385 5
$412 6
$438 2
$465 4
$492 4
$518 0
$545 6
$572 4
$598 0
More 193
Histogram of Profit Values for Purchase Quantity = 25
(250 total replications)
0
50
100
150
200
250
$
2
2
5
$
2
5
2
$
2
7
8
$
3
0
5
$
3
3
2
$
3
5
8
$
3
8
5
$
4
1
2
$
4
3
8
$
4
6
5
$
4
9
2
$
5
1
8
$
5
4
5
$
5
7
2
$
5
9
8
M
o
r
e
Upper End of Category
F
r
e
q
u
e
n
c
y
ancmat03.qxd 11/16/06 3:29 PM Page C19
4. Keeping the range from #3 selected, go to Data/Table in the Excel menu. In the re-
sulting dialog box, leave the Row Input Cell eld blank, and click on cell A21 (or
any blank cell on the worksheet) for the Column Input Cell. Click OK. The results
from 250 replications should now be showing in cells B22:B271. Note: Recall in
Supplement A the Column Input Cell was set to vary an input parameter of the
model, but here we are using it simply to force Excel to recalculate the model.
5. If all the values in B22:B271 are the same, press the F9 key to force recalculation
of the worksheet. This can occur if Excels recalculation settings have been
changed. You can change these settings at Tools/Options/Calculation. Supple-
ment A and the Excel help system contain additional information about the
Data Table command.
6. Compute summary statistics from the results in cells B22:B271.
7. If desired, freeze the results from the simulation in cells B22:B271 using
Edit/Copy, Edit/Paste Special/Values.
Using the Data Table command to run simulations is normally easier, once you get the
hang of it, than copying all of the simulation logic. It also allows you to run more
complex models.
Recap
In this example we have begun to see the power of spreadsheet simulation. Simulation
models allow us to incorporate our uncertainty directly into the model, run the model
many times, and compute summary statistics. Rather than relying on a single point es-
C20 SUPPLEMENT C INTRODUCTION TO SIMULATION
DG Outerwear
simulation using
Data Table
FIGURE C-16
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
270
271
A B C D E F G H I J
Decision Variable Salvage Price Distribution (Discrete)
Purchase Quantity 35 Cumulative Distribution
Probability Begin End Price
0.05 0.00 0.05 $15
0.30 0.05 0.35 $20
0.50 0.35 0.85 $25
0.15 0.85 1.00 $30
1.00
Simulation Logic
RN1 RN2 Demand
Reg
Sales
Qty
Salv
Sales
Qty
Salv
Price
Reg
Rev
Salv
Rev Profit
0.425 0.255 28 28 7 $20 $2,800 $140 $315
Data Table for Simulation Replications
Replications Profit
315 $ Summary Statistics
1 875 $ Average 413 $
2 35 $ StdDev 403 $
3 795 $ Minimum (400) $
4 (325) $ Maximum 875 $
5 75 $
6 (100) $ 95% Confidence Interval
7 200 $ Lower CL 363 $
8 200 $ Upper CL 463 $
9 (35) $
10 (250) $
11 (400) $
249 200 $
250 715 $
B21: =J17
ancmat03.qxd 11/16/06 3:29 PM Page C20
timate of prot, we can actually determine the uncertainty of prot (or whatever the
output of our model is). This quantication of uncertainty is extremely important in
managerial decision making.
SUPPLEMENT HIGHLIGHTS C21
OTHER APPLICATIONS OF SIMULATION
There are almost limitless ways the power of simulation can be used to bring insight
into managerial decision making, both in traditional OM areas and throughout the
organization. A few decision situations in which simulation can and has been used ef-
fectively are listed here.
Financial analysis for new products, expansions, or any effort involving the expen-
diture of funds now in the hope of future (but uncertain) payoffs.
Project planning and scheduling. Activity times are almost always uncertain, which
causes the actual completion time of the project to be uncertain.
Determining the customer service impacts of adding or removing serving capacity.
For example, what will be the effect of adding a second drive-through window at
a banking facility?
Evaluating different inventory policies while taking into account demand uncer-
tainty.
Evaluating different plant and supply chain policies, such as scheduling and route
assignments.
SIMULATION WITHIN OM: PUTTING IT ALL TOGETHER
Simulation is truly an analytical tool with applications across the enterprise. Consider
a capital investment situation such as the launch of a new product. Engineering is in-
volved in the product design, during which simulation can be used to compare differ-
ent design congurations without having to actually build the product. For example,
automakers use computer simulation of cars to test design concepts. Operations is in-
volved in facility design, supply chain conguration and management, manufactur-
ing, and distribution. All of these areas lend themselves to simulation, which is
probably the most common tool used in comparing different facility layouts and op-
erating plans. Marketing is involved in the market development, distribution, sales,
and customer support aspects of the new product. Since there is typically much un-
certainty in the launch of a new product, simulation is a valuable tool for analyzing
the effects of uncertainties in market size, price sensitivities, and other factors. Of
course, nance is involved in the overall nancial attractiveness of the launch of the
new product, as well as in questions relating to the nancing of the capital investment.
These decisions involve much uncertainty, and simulation is a tool to help evaluate
the risk level of the project.
Supplement Highlights
A computer simulation is a model that mimics what might
happen in reality.
Computer simulations model the uncertainty present
in a system by generating random numbers from known
probability distributions.
Simulation is a valuable tool because it can simultaneously
consider the uncertainty present in many factors of a
3
2
1 problem and provide outputs that show how the input
uncertainty translates into uncertainty in the output
measure.
Monte-Carlo Simulation can be conducted using Excel
without any add-ins. Commercial add-ins such as Crystal
Ball and @Risk provide additional functionality that is
more difcult to employ using stand-alone Excel.
4
ancmat03.qxd 11/16/06 3:29 PM Page C21
C22 SUPPLEMENT C INTRODUCTION TO SIMULATION
Simple discrete-event simulations can be conducted in
Excel, but separate software products, such as ProModel,
ProcessModel, and Extend, are better suited to modeling
systems whose state and behavior change over time.
The simulation modeling process in spreadsheets consists
of developing a deterministic model with correct logic,
determining the appropriate probability distributions to use
for the random inputs, incorporating those distributions in
the model itself, running many replications of the simulation
model, and analyzing the simulation results by computing
and interpreting summary statistical measures.
Each time Excels RAND() function calculates, it generates
a uniformly distributed random number between 0 and 1,
denoted U(0, 1).
Random numbers from probability distributions (e.g.,
Bernoulli, discrete uniform, general discrete, continuous
8
7
6
5 uniform, normal, and exponential, among others)
are derived from a U(0, 1) random number through
mathematical calculations.
Replications of simulation models in Excel can be
performed by copying the entire logic itself or by using
Excels Data Table feature. For simple models where
the logic ts into a single row, copying the logic itself
is acceptable. However, for more complex models, the
Data Table feature should be used.
At a minimum, one should consider basic summary
statistics such as the average, standard deviation, minimum,
and maximum when interpreting results from a simulation.
One should also compute a condence interval to assess the
precision of the estimate for the mean and to determine
whether additional replications should be run. It is also a
good idea to generate a histogram of the results to see the
actual probability distribution of the output measure.
10
9
Key Terms
computer simulation C2
Monte-Carlo Simulation C3
discrete-event simulation C3
deterministic spreadsheet model C4
Bernoulli random variable C7
normal distribution C11
exponential distribution C11
replication C15
discrete uniform distribution C7
general discrete distribution C8
discrete distribution C8
continuous distribution C9
continuous uniform distribution C9
Solved Problems
Problem 1
Cables By Us has recently decided to introduce a new product.
It will use space in its current facility that is not now in use. The
activities required to launch the product have been identied,
along with the precedence relationships among them (some ac-
tivities must be performed by others). Figure C-17 shows the
precedence relationship, a table of the activities, and minimum
and maximum possible times (in weeks) for each activity.
(a) Develop a simulation model to determine the total time
the project will take.
(b) Use the simulation model with 500 replications to estimate
the average, standard deviation, minimum, and maximum
time the project will take. Also determine the probability
that the project will be completed within 41 weeks, the
companys target time frame.
Before You Begin
For this problem, simulate the length of each path through the
network. Generate random activity times for each of the activi-
ties, compute the total time needed to complete each connected
path, and then determine the critical path. Figure C-19 shows
the results of one such simulation. Your results can vary based
on the random numbers selected.
Solution
(a) The time to complete each activity is random. Here we as-
sume that the time in weeks is distributed as discrete uni-
form between the minimums and maximums shown in
the gure. The key to this problem is realizing that the
total length of the project is dened by the longest path
through the activities. This is traditionally called the criti-
cal path. However, when activity times are random, we
cannot tell ahead of time which path will be the longest.
Therefore, we need to simulate the length of each path and
choose the largest one as the time required for the project
in one replication.
We need to generate random activity times for each of
the activities, compute the total length of each path, and -
nally determine the longest of these path lengths. This will
be one replication of the simulation. Figure C-18 shows the
completed logic.
(b) To run the simulation model, we construct a data table with
500 replications. After running the simulation, we freeze the
results and compute summary statistics. Note that if you
work through this problem on your own, you will obtain
somewhat (but not drastically) different results. This is the
nature of simulation. Figure C-19 shows the results.
ancmat03.qxd 11/16/06 3:29 PM Page C22
SOLVED PROBLEMS C23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
A B C D E
Simulating the Critical Path of a Project
Precedence Diagram of Activities
Activity Descriptions and Probability Distributions
All Probability Distributions Assumed to be Discrete Uniform
Min Max
A Develop Product Specifications 3 5
B Design Manufacturing Process 4 8
C Source and Purchase Materials 2 4
D Source and Purchase Tooling & Equipment 5 7
E Receive and Install Tooling & Equipment 11 17
F Receive Materials 2 8
G Pilot Production Run 1 3
H Evaluate Product Design 1 3
I Evaluate Process Performance 2 4
J Write Documentation Report 3 5
K Transition to Manufacturing 1 3
A
B D E
C F
G
H
I
J K
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
A B C D E F G
Simulating the Critical Path of a Project
Precedence Diagram of Activities
Activity Descriptions and Probability Distributions
All Probability Distributions Assumed to be Discrete Uniform
Min Max RN Sim Time
A Develop Product Specifications 3 5 0.088 3
B Design Manufacturing Process 4 8 0.296 5
C Source and Purchase Materials 2 4 0.075 2
D Source and Purchase Tooling & Equipment 5 7 0.412 6
E Receive and Install Tooling & Equipment 11 17 0.701 15
F Receive Materials 2 8 0.877 8
G Pilot Production Run 1 3 0.655 2
H Evaluate Product Design 1 3 0.769 3
I Evaluate Process Performance 2 4 0.455 3
J Write Documentation Report 3 5 0.380 4
K Transition to Manufacturing 1 3 0.545 2
Path Time
ABDEGHJK 40
ABDEGIJK 40
ACFGHJK 24
ACFGIJK 24
Critical Path Length (Length of Project) 40
A
B D E
C F
G
H
I
J K
C27: =F14+F15+F17+F18+F20+F21+F23+F24
C28: =F14+F15+F17+F18+F20+F22+F23+F24
C29: =F14+F16+F19+F20+F21+F23+F24
C30: =F14+F16+F19+F20+F22+F23+F24
E14: =RAND() (copied down)
F14: =INT(C14+(D14-C14+1)*E14) (copied down)
C32: =MAX(C27:C30)
Precedence diagram and activities
for Cables by Us
FIGURE C-17
Model logic for
project planning
problem
FIGURE C-18
ancmat03.qxd 11/16/06 3:29 PM Page C23
The average completion time of the project is 40.9 weeks,
which appears promising regarding our deadline. However,
the standard deviation is 3.24 weeks, and the total time in the
500 replications ranged from 32 to 50 weeks. The probability
of meeting the deadline can be computed directly using
Excels PERCENTRANK function, as shown in cell G41. The
PERCENTRANK function returns the percentage of items
that fall below a given value. Unfortunately, the probability
that we will meet the deadline is only 0.46, so it may be neces-
sary to somehow speed up some of the activities and/or re-
duce the uncertainty in the time of some activities in order to
increase this probability to an acceptable level.
34
35
36
37
38
39
40
41
42
43
44
45
46
535
536
B C D E F G H I J
Data Table
Replication Length Summary Statistics
40 Average 40.906
1 42 StdDev 3.24
2 44 Minimum 32
3 38 Maximum 50
4 39
5 42 Deadline (weeks) 41
6 43 Prob(Meet Deadline) 0.46
7 42
8 42
9 43
10 39
499 38
500 42
C35: =C32
G36: =AVERAGE(C$37:C$536)
G37: =STDEV(C$37:C$536)
G38: =MIN(C$37:C$536)
G39: =MAX(C$37:C$536)
G41: 41
G42: =PERCENTRANK(C37:C536,G41)
Project planning simulation results
FIGURE C-19
C24 SUPPLEMENT C INTRODUCTION TO SIMULATION
Problem 2
Since graduating from college, JB has been saving money to-
ward a down payment on a house. Currently, JB has $20,000
and wants to invest the money over the next year. Desiring
some growth in the investment but also concerned about the
risk, JB has selected four investments and has tentatively
planned to invest $5000 in each. Figure C-20 shows informa-
tion about the investments. JB knows that there is always uncer-
tainty in the investing world, so has estimated some parameters
for probability distributions. JB believes the money market and
bond investments follow the continuous uniform distribution,
with minimums and maximums as shown in the gure, under
the Parameter1 and Parameter2 columns. Similarly, the growth-
and-income and aggressive growth funds are assumed to follow
a normal distribution, where Parameter1 corresponds to the
mean and Parameter2 the standard deviation.
(a) Build a simulation model for a one-year investment pe-
riod. The primary outputs of the model should be the
overall portfolio gain (or loss), in both dollar and percent-
age terms.
(b) Run the simulation for 500 replications. What is the aver-
age return (dollar and percentage) JB can expect over the
next year, and what is the 95 percent condence interval?
JB is concerned about the possibility of losing money.
What dollar amount does JB stand to lose with probability
.05 if the portfolio is allocated as done here and the invest-
ments behave according to the probability distributions
selected?
Before You Begin
For this problem, simulate the return on different investments.
Figure C-20 shows the distribution to be used for each invest-
ment option as well as the mean investment return value and
the investment return standard deviation. Simulate one years
activity and calculate the average return that JB can expect over
the next year.
1
2
3
4
5
6
7
8
A B C D
Portfolio Allocation Model
Investment Alternatives
Investment Distribution Parameter1 Parameter2
Money Market Fund Uniform 1.5% 3.0%
Bond Fund Uniform -4.0% 10.0%
Growth & Income Fund Normal 7.0% 12.0%
Aggressive Growth Fund Normal 11.0% 18.0%
Investment information for the portfolio
problem
FIGURE C-20
ancmat03.qxd 11/16/06 3:29 PM Page C24
Solution
(a) The logic for this model is relatively straightforward. We
need to create a section that lists the amount invested in
each fund, simulate the return from each investment, and
calculate the ending value of each investment and the port-
folio. From this, we can calculate the overall portfolio gain
(loss) in dollar and percentage terms. Figure C-21 shows
the simulation logic for one replication. The key formulas
are provided. Cells C12:C15 simulate the returns of each
investment. The money market and bond investments fol-
low the uniform distribution, and the growth-and-income
and aggressive growth investments follow the normal
distribution.
(b) As with Solved Problem 1, the Data Table command is used
to run 500 replications. Here, however, we have two out-
puts of the model to track. We create another column of
the Data Table for this and include this column in the se-
lection before going to the Data/Table dialog box. After
running the 500 replications, we freeze the results and
compute summary statistics, condence intervals, and per-
centiles. See Figure C-22.
From the summary statistics, we see the average return
of the portfolio is $1204 or 6.02 percent (again, your values
will differ somewhat from these due to the nature of simu-
lation). Computing the 95 percent condence interval, we
are 95 percent condent the true average return is some-
where in the interval from $1107 to $1301. We could im-
prove the precision of the estimate of the average return by
running additional replications.
Certainly, knowing the average return is helpful, but it
tends to oversimplify the investment decision. JB is con-
cerned about losing money, since this is money earmarked
for a down payment on a house. A useful way to quantify
the risk of losing a certain amount of money is through
using percentiles of the returns distribution. The value
($610) (i.e., a loss of $610) in cell F35 means that the port-
folio is predicted to lose $610 or more approximately 5 per-
cent of the time. This is termed the 5
th
percentile of the
returns distribution. Literally, it is the 5
th
percentile of the
cumulative distribution of portfolio returns. Using per-
centiles of the returns distribution is a very common prac-
tice in risk analysis. Similarly, the 25
th
percentile is $503.
This means that the portfolio should have a return $503
about 25 percent of the time, or conversely, a return $503
about 75 percent of the time. The 50
th
percentile is really
the median, with a 50 percent chance of falling above/
below this value. Going to the extreme upper end, the 95
th
percentile is similar to the 5
th
percentile. We should have a
one-year return $2960 with .95 probability; stated an-
other way, there is only a .05 probability of having a return
$2960. Do not confuse the percentiles with the con-
dence interval. The percentiles provide us with probabili-
ties of a given dollar (or percentage) return for a single
one-year period. The condence interval provides infor-
mation about the precision of the estimate of the average
(mean) portfolio return that would be obtained if we in-
vested in this way over a very long period of time. Both
concepts are important, but they are not the same!
Finally, Figure C-23 shows a histogram of the dollar
portfolio return. Notice that even though we had two in-
vestments whose returns were uniformly distributed, the
overall return of the portfolio looks very much like a nor-
mal distribution. Actually, this should not be a surprise, as
the central limit theorem suggests that this distribution
should be normal. The histogram adds a graphical perspec-
tive to the results and complements the summary statistics
and the percentile results. The cumulative distribution
function is also plotted and uses the scale on the right side
of the graph. Additional percentiles can be approximated
using the cumulative distribution function graph.
10
11
12
13
14
15
16
17
18
19
A B C D
Simulation Logic for Portfolio
Investment Invested % Return EndingBal
Money Market Fund $5,000 1.54% $5,077
Bond Fund $5,000 -1.87% $4,907
Growth & Income Fund $5,000 21.12% $6,056
Aggressive Growth Fund $5,000 27.92% $6,396
Totals $20,000 $22,435
Gain (loss) on Investment $2,435
Portfolio Return 12.18%
Key Formulas
C12: C5 (D5 C5)*RAND() (copied to C13)
C14: NORMINV(RAND(),C7,D7) (copied to C15)
D12: B12*(1 C12) (copied to D13:D15)
D16: SUM(D12:D15)
B18: D16B16
B19: B18/B16
SOLVED PROBLEMS C25
Simulation logic for portfolio problem
FIGURE C-21
ancmat03.qxd 11/16/06 3:29 PM Page C25
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
523
524
A B C D E F G
Data Table for Simulation Replications
Replication Gain (Loss) Return Summary Statistics
$2,435 12.18% Gain (Loss) Return
1 ($791) -3.96% Average $1,204 6.02%
2 $712 3.56% StdDev $1,109 5.55%
3 $1,637 8.18% Minimum ($2,480) -12.40%
4 $520 2.60% Maximum $5,091 25.45%
5 $5,091 25.45%
6 $1,361 6.80% 95% Confidence Interval on Average
7 ($291) -1.45% Lower CL $1,107 5.53%
8 $77 0.38% Upper CL $1,301 6.51%
9 $227 1.13%
10 $613 3.07% Percentiles
11 $3,194 15.97% 5% ($610) -3.05%
12 $836 4.18% 25% $503 2.52%
13 $847 4.23% 50% $1,197 5.99%
14 $1,602 8.01% 75% $1,957 9.78%
15 $1,585 7.93% 95% $2,960 14.80%
16 $596 2.98%
17 ($102) -0.51%
499 $273 1.36%
500 $859 4.30%
B24: =B18
C24: =B19
F35: =PERCENTILE(B$25:B$524,$E35)
(copied to F35:G39 to compute percentiles of the
results distributions)
C26 SUPPLEMENT C INTRODUCTION TO SIMULATION
Simulation results for portfolio problem
FIGURE C-22
Upper Endpoint of Category
F
r
e
q
u
e
n
c
y
80
70
60
50
40
30
20
10
0
100.00%
90.00%
80.00%
70.00%
60.00%
50.00%
40.00%
30.00%

$
2
,
4
8
0

$
1
,
7
9
2

$
1
,
1
0
3

$
4
1
5
$
2
7
3
$
9
6
1
$
1
,
6
5
0
$
2
,
3
3
8
$
3
,
0
2
6
$
4
,
4
0
3
M
o
r
e
$
3
,
7
1
4
20.00%
10.00%
.00%
Histogram of Portfolio Gain (Loss) (n = 500 replications)
Frequency Cumulative %
Histogram of portfolio
dollar returns
FIGURE C-23
Problem 3
HiLo Bank is concerned about customer waiting times in its
drive-through facility. There is a single line for the live teller (a
separate line forms for the ATM, which is not a concern at this
point). Customers arrive to the live teller at a rate of about 10 per
hour, or one every 0.10 hour (one every 6 minutes). The teller is
able to serve about 15 customers per hour, so the average service
time is 0.0667 hour (4 minutes). Obviously if customers truly ar-
rived exactly every 6 minutes, and each customer took 4 minutes
ancmat03.qxd 11/16/06 3:29 PM Page C26
to serve, no line would ever form. There is variability in both the
arrival and service patterns, however. The bank has heard of their
competitors using simulation to help analyze their service and
processing facilities, so it would like to use simulation here.
Assume that both the time between customer arrivals and
the service times are exponentially distributed, with the means
of 0.10 hour and 0.0667 hour, respectively. Develop a simula-
tion model that allows one to analyze customer waiting time
and the number of customers waiting. Consider 500 customers
that arrive over time to the drive-through service facility. For a
single set of 500 customers, what are the average waiting time
and the average number waiting in line? What are the maxi-
mum waiting time and maximum number waiting?
Before You Begin
In this problem, simulate customer waiting times at a drive-
through banking facility. Identify the customer arrival rate
and the tellers service rate. The mean values are needed to
simulate the waiting line system. Calculate the average waiting
time per customer and the average number of customers wait-
ing in line.
Solution
This problem is designed to illustrate a different type of simula-
tion model. This is really a discrete-event problem, because the
state of the system changes over time, having customer arrivals
(number in the system increases by 1) and customer depar-
tures (number in the system decreases by 1). This is an example
of a queuing, or waiting line, situation, which is obviously very
common in the real world. Simulation is a powerful and exible
tool able to help analyze these situations and improve decision
making. Although an Excel spreadsheet approach will be pro-
vided here, discrete-event simulations are best created in a
product specically designed for that purpose, as noted earlier
in the chapter.
Figure C-24 shows the input and output sections of this
model. The arrival and service rates are entered and converted
into the average time between arrivals and the average service
time, respectively. Results for over 500 customers include the
average number in the queue, the maximum number in the
queue, the average waiting time, the maximum waiting time,
and the percent of time the teller is idle. Perhaps surprisingly,
the maximum queue length was 16 cars at some point in the
process of serving 500 customers, even though the average
number in the queue was a reasonable 1.48 cars. The average
waiting time for a customer was 0.15 hour, or about 9.2 min-
utes, which is probably a bit on the high side. The maximum
waiting time for a customer was 1.33 hours, or 80 minutes (as-
suming the customer would have stuck around, which is highly
unlikely!). Despite these somewhat disappointing performance
measures, the teller was idle 36 percent of the time. The average
performance doesnt seem too bad, but for the worst-case cus-
tomer, it is are clearly unacceptable, and a system operating like
this would likely generate customer complaints. These perfor-
mance measures are somewhat surprising, since a customer ar-
rives, on average, every 6 minutes, and we can serve a customer,
again on average, every 4 minutes. The key, of course, is the on
average. It is the variability in the randomness of customer ar-
rivals and service times that causes these disappointing perfor-
mance measures. The bank should probably consider ways to
either speed up service or encourage existing drive-through
customers to complete business another way, such as inside the
bank, at the ATM, or over the Internet.
The actual simulation model (for the rst 10 customers) is
shown in Figure C-25 (based on Evans and Olson, 1998). Be-
fore presenting the formulas for this model, well describe the
columns from left to right. Each row of the logic corresponds to
one customer. Each customer goes through a standard process:
a customer arrives to the system, waits in the line if the teller is
busy, starts service either upon arrival or when the teller n-
ishes with the previous customer, nishes business at the bank,
and departs. The columns of the model take each customer
through this process, with some additional columns to keep
track of system performance. Column D generates a random
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
A B
HiLo Bank Drive-Through
Input Parameters
Mean arrival rate (per hour) 10
Mean service rate (per hour) 15
Mean time between arrivals (hr) 0.1
Mean service time (hr) 0.0667
Simulation Results (500 customers)
Average Num in Queue 1.4772
Max Num in Queue 16
Average Waiting Time (hr) 0.1534
Max Waiting Time (hr) 1.3287
% idle time 36%
Input and output sections of HiLo model
FIGURE C-24
SOLVED PROBLEMS C27
ancmat03.qxd 11/16/06 3:29 PM Page C27
interarrival time, or the time of the customers arrival after the
previous customers arrival. This approach is very common in
modeling queuing systems. Column E computes the customers
actual arrival time (in hours since the drive-through opened).
Column F determines the number of people waiting in the
queue after the customer arrives. If the server is idle when the
customer arrives, the queue remains empty (since service can
start immediately). On the other hand, if the server is busy, the
customer joins the queue and the number in the queue statistic
increases by 1. Column G computes the time the customer ac-
tually starts service, again depending on whether she had to
wait for the customer ahead of her to nish or whether she
could start service immediately upon arrival. Column H gener-
Clearly, there is a lot of bookkeeping in modeling a system
such as this. Although it is possible to model these systems in
spreadsheets, they are not the best choice for highly dynamic
systems. Actually, the system here is quite simple compared to
the complexity present in the real world. Here there is only one
server; most real-world systems have multiple servers, and the
ates the random service time from the service time distribution.
Column I computes the time that service gets completed. Col-
umn J computes the time the customer waited as the difference
between the starting time and the arrival time. Column K com-
putes the time, if any, that the server was idle since the last cus-
tomer (which happens only if the queue is empty). Columns
LQ are used to keep track of the performance measures of the
system.
Key formulas are provided. These formulas correspond to
customer #2 and are all copied down in the model through cus-
tomer #500. Some formulas for customer #1 are slightly differ-
ent since the rst customer is assumed to arrive to an empty
system.
customer (or the product in a manufacturing simulation) goes
through several processes with different servers or machines.
Discrete-event simulation products such as those mentioned in
this chapter are ideally suited for these complex systems, because
they have all of the bookkeeping functions built in already, and
the modeler can focus on dening how the process works.
Simulation model for HiLo teller problem (based on Evans and Olson, 1998)
FIGURE C-25
1
2
3
4
5
6
7
8
9
10
11
12
13
C D E F G H I J K L M N O P Q
TimeBetw Arrival No. In Start Service Completion Wait Idle Cum. No. Avg. No. Cum. Wait Avg. Wait Cum. Idle Avg. %
Customer Arrivals Time Queue Time Time Time Time Time in Queue in Queue Time Time Time Idle Time
0.00
1 0.1089 0.1089 0 0.1089 0.0832 0.1921 0.0000 0.1089 0.0000 0.0000 0.0000 0.0000 0.1089 57%
2 0.1565 0.2654 0 0.2654 0.0321 0.2975 0.0000 0.0734 0.0000 0.0000 0.0000 0.0000 0.1823 61%
3 0.0341 0.2995 0 0.2995 0.1196 0.4191 0.0000 0.0020 0.0000 0.0000 0.0000 0.0000 0.1843 44%
4 0.0772 0.3767 1 0.4191 0.1165 0.5356 0.0424 0.0000 0.0772 0.2049 0.0424 0.0106 0.1843 34%
5 0.0304 0.4071 2 0.5356 0.0323 0.5679 0.1285 0.0000 0.1380 0.3390 0.1709 0.0342 0.1843 32%
6 0.0097 0.4168 3 0.5679 0.0223 0.5903 0.1512 0.0000 0.1670 0.4006 0.3221 0.0537 0.1843 31%
7 0.1707 0.5875 1 0.5903 0.0022 0.5924 0.0028 0.0000 0.3377 0.5748 0.3249 0.0464 0.1843 31%
8 0.1996 0.7871 0 0.7871 0.0035 0.7906 0.0000 0.1946 0.3377 0.4290 0.3249 0.0406 0.3789 48%
9 0.0567 0.8438 0 0.8438 0.0395 0.8833 0.0000 0.0532 0.3377 0.4002 0.3249 0.0361 0.4321 49%
10 0.0429 0.8867 0 0.8867 0.0069 0.8936 0.0000 0.0034 0.3377 0.3808 0.3249 0.0325 0.4355 49%
C28 SUPPLEMENT C INTRODUCTION TO SIMULATION
Key Formulas (all copied down)
Time Between Arrivals D5: B$7*LN(RAND())
Arrival Time E5: E4D5
Number in Queue F5: C5MATCH(E5,$I$3:I4,1)
Start Time G5: MAX(E5,I4)
Service Time H5: B$8*LN(RAND())
Completion Time I5: G5H5
Wait Time J5: G5E5
Idle Time K5: G5I4
Cumulative Number in Queue L5: F5*(E5E4)L4
Average Number in Queue M5: L5/E5
Cumulative Wait Time N5: N4J5
Average Wait Time O5: N5/C5
Cumulative Idle Time P5: P4K5
Average % Idle Time Q5: P5/I5
ancmat03.qxd 11/16/06 3:29 PM Page C28
PROBLEMS C29
Discussion Questions
1. Give an example of a situation you faced that involved un-
certainty. How did you deal with the uncertainty?
2. What decisions do operations managers face that involve
uncertainty? How could simulation be used to assess the effects
of that uncertainty?
3. How might a decision maker use the information pre-
sented in a histogram of simulation results, such as that shown
in Figure C-15?
Problems
1. (a) Generate 50 random numbers from a normal distribu-
tion with mean 10 and standard deviation 2. Compute summary
statistics (average, standard deviation, minimum, maximum)
and a 95 percent condence interval for the mean. Also generate
a histogram.
(b) Repeat (a), except with 500 random numbers.
(c) Compare the results from (a) and (b). How does the sam-
ple size affect the results? Are you surprised at any of the
ndings?
2. Repeat (a)(c) of Problem 1, except with a continuous uni-
form distribution between 3 and 8.
3. Repeat (a)(c) of Problem 1, except with an exponential
distribution with a mean of 20.
4. SaveMart is a super-center discount store. For the upcom-
ing year, the various departments have submitted their sales
growth forecasts. The store manager needs to produce an overall
sales forecast for the entire store. Data for the departments are
given.
(a) Build a spreadsheet model to simulate SaveMarts total
sales for the upcoming year.
(b) Run 500 replications of the model and calculate sum-
mary statistics. What is the expected total revenue?
(c) What are the 25
th
, 50
th
, and 75
th
percentiles of revenue?
Interpret these values in meaningful language to present
to SaveMarts management.
5. Chris is responsible for staffing a 911 operation. During
any given night, the number of calls received is uniformly dis-
tributed between 92 and 145. The average time each call re-
quires of a 911 operator is normally distributed with a mean of
6.2 minutes and a standard deviation of 1.2 minutes. This time
includes time on the phone as well as certain administrative
duties associated with each call. Due to the stress level of the
position, operators must take a number of breaks during their
shifts, so a full-time shift consists of no more than six hours
taking calls.
Growth Rates
Department Current Sales Minimum Maximum
Grocery $4,257,000 3% 5%
Hardware & $876,000 0% 7%
Automotive
Toys $2,354,000 8% 12%
Apparel 1,278,000 4% 9%
(a) Build a spreadsheet model to simulate the total phone
time required in a given night. Run 500 replications of
the model and compute summary statistics.
(b) How many operators should be scheduled if Chris needs
to be 90 percent sure there will be enough operators to
handle all the calls?
6. A 100-seat airplane is used on a particular route on FlyFast
Airlines. Seats sell for $400, and this cost is refundable. Therefore,
revenue is received only from passengers actually boarding the
airplane. At this price, there is sufcient demand to sell more
than 100 seats, because some passengers do not show up for the
ight. Therefore, FlyFast typically overbooks the ight. On aver-
age, 15 percent of the ticketed passengers do not show up to y,
but this varies uniformly from 5 percent to 25 percent for indi-
vidual ights. In the event that more ticketed passengers show up
for the ight than there are seats available, FlyFast must pay an-
other airline to y the passenger and in some cases must provide
a voucher to the passenger for meals or lodging. Assume the cost
per passenger bumped is $600. FlyFast wants to determine the
number of tickets to sell in order to maximize net revenue (total
revenue minus the bumping costs).
(a) Develop a spreadsheet model to simulate one occurrence
of this ight.
(b) Assume 100 tickets are sold. Run a simulation (with 250
replications) to determine the average net revenue.
(c) Vary the number of tickets sold, and determine the num-
ber to sell that will maximize the average net revenue.
7. Jamie is saving money in hopes of purchasing a house in
ve years. Jamie has no money saved now, but each month Jamie
can invest $220 toward the down payment. A $15,000 down pay-
ment is desired. Two investment options are available. One, fund
A, is relatively low risk with a monthly average rate of return of
0.5 percent, and a monthly standard deviation of 0.58 percent,
normally distributed. The other fund, B, has a monthly average
return of 0.83 percent with a monthly standard deviation of 4.33
percent, again normally distributed.
(a) Create a model to simulate sixty months of investment
activity for each fund.
(b) Run 250 replications of this model, and compute sum-
mary statistics. Also compute the probability that Jamie
will reach the goal of $15,000 with each investment.
(c) Which investment should be chosen if Jamie wants to
maximize the average balance at the end of sixty months?
Which should be chosen if the probability of meeting the
goal is to be maximized? Explain these ndings.
ancmat03.qxd 11/16/06 3:29 PM Page C29
C30 SUPPLEMENT C INTRODUCTION TO SIMULATION
CASE: Car Replacement Decision
RG faces a car decision dilemma. Currently, RGs 10-year-old car
is in need of major repairs, at a cost of $2000. RG is trying to de-
cide whether to x this car, purchase a used car (at a cost of
$8000), or purchase a new car ($16,000). If RG purchases a used
or new car, the old car will be donated to charity. RG plans to
keep any car until it is virtually unusable. Uncertainty is present
in the lives of the cars. If RGs current car is repaired, RG esti-
mates that the useful remaining life is uniformly distributed be-
tween 0.5 and 3 years. With a used car, the estimated life is
uniformly distributed between 2 and 8 years, and with a new car,
between 8 and 15 years.
To compare the purchase or, in the case of the current car, re-
pair costs, RG has decided to focus on the rst year of owner-
ship. However, to do this, the purchase/repair costs must be
fairly allocated. Since a new car will last longer than a repaired
old car, the useful life must be part of the cost calculation. RG
has decided that a 4 percent annual interest rate is reasonable,
applied over the useful life of the car. For example, if RG xes
the current car, and it ends up lasting 1.2 years, the cost allo-
cated to the rst year is calculated using Excels PMT function,
as PMT(0.04, 1.2, 2000), resulting in $1740. That is, the
costout of the $2000 total repair cost allocated to the rst year
and adjusted for the 4 percent interest rateis $1740.
Other costs include repairs outside of normal maintenance,
which should be the same for all three choices. RG expects extra
repair costs for the year on the currently owned car to be uni-
formly distributed between $200 and $1000. For a used car, they
would vary uniformly between $0 and $800, and for a new car,
there would be no repair costs.
RG wants to use simulation to help determine the best alter-
native. Whereas the average cost of ownership is important, so is
the uncertainty of that cost as well. Develop and use a simula-
tion model to address this issue, and provide a recommendation
to RG.
On-Line Resource
1. Spreadsheets for Figures C-2, C-5, C-6, C-7, C-12, C-13, C-14, C-15, C-16; Example C.1; and Solved Problems
1, 2, and 3 are available on the Cd.
2. The Retirement Income Calculator provided by T. Rowe
Price Investment Services uses Monte-Carlo Simulation
to estimate the probability of achieving your retirement
financial goals. The tool can be found at http://www3.
troweprice.com/ric/RIC/.
3. Financial Engines (http://www.nancialengines.com) offers
nancial planning assistance based upon simulations of fu-
ture economic scenarios.
4. Read the latest Simulation Software survey from OR/MS Today,
which can be found at http://www.lionhrtpub.com/orms/
surveys/Simulation/Simulation.html. Get information from at
least two of the rms listed there regarding their simulation
products. Compare their capabilities and the types of prob-
lems they are designed to address. Find a site that discusses
some of their case studies, and prepare a summary. Find a site
offering a trial version and/or tutorial of their product. Install
the product and run an example model.
Selected Bibliography
Evans, J., and D. Olson. Introduction to Simulation and Risk
Analysis. Upper Saddle River, N.J.: Prentice Hall, 1998.
Ragsdale, Cliff T. Spreadsheet Modeling & Decision Analysis,
Fourth Edition. Stamford, Conn.: Thomson, 2004.
Winston, Wayne L., and S. Christian Albright. Practical Man-
agement Science (with CD-ROM Update), Second Edition.
Duxbury, 2003.
ancmat03.qxd 11/16/06 3:29 PM Page C30

Das könnte Ihnen auch gefallen