Chapter 9
Chapter 9
Chapter 9: Simulation
2
Introduction
What is simulation and how it is useful
3
Defining Simulation
Data Tables
Scenario Manager
4
Simulation
Simulation is a modeling tool which is used to imitate a real-world
process in order to understand system behavior.
Excel offers two simple tools for performing simulation: Data Tables
and the Scenario Manager.
5
Data Tables
Data Tables are used to determine how some outputs vary in response
to changes in input.
Data Tables use the spreadsheet to refer to cells which may contain
formulas or functions for some output and input of some problem.
6
Data Tables (cont)
A list of inputs and outputs should be created first.
Next, you will create a list of the various input values you want to
experiment with.
– If you are creating a one-way data table, you would put these values in a
single column.
– If you are creating a two-way data table, you would create one column and
one row of varying input values for the two inputs of interest.
You must then enter the output formulas you want the Data Table to
calculate for observation.
– For one-way data tables, these output cells would be in the columns
adjacent to the input column.
– For two-way data tables, this output cell would be placed in the upper
corner of the data table.
7
Data Tables (cont)
Select Data > Table from the Excel menu.
If we are creating a one-way data table, the column input cell will be the
only reference we give.
If we are creating a two-way data table, we will reference both a row and
column input since we are varying two inputs.
8
Figure 9.2
We are given a list of inputs and outputs for ticket sales.
The Total Profit is calculated by finding the unit profit (price minus cost
per ticket) and multiplying this value by the number of salespersons and
the average number of tickets sold per person.
9
Figures 9.4 and 9.5
The first data table we want to create will show the different profit values
as we vary the price per ticket. This will be a one-way data table.
10
Figures 9.7 and 9.8
Now suppose we are curious to see how the combination of price per
ticket and number of salespersons affects our total profit; this will now
be a two-way data table.
11
Scenario Manager
The Scenario Manager allows you to vary up to 32 input cells for
various values, or scenarios, and observe the results of several output
cells.
The Scenario Manager will create a Scenario Report which shows the
resulting output values for each scenario of input values.
12
Scenario Manager (cont)
Add a new scenario.
13
Scenario Manager (cont)
Next, specify the values these inputs should take for the scenario we are
creating.
14
Scenario Manager (cont)
Click Summary to create the Scenario Report.
The Scenario Summary dialog box asks us to select the outputs we want
to observe for the various scenarios of inputs.
15
Figure 9.13
We are interested in the company’s after tax profits for each of the five
years as well as their total NPV.
We want to consider three different scenarios for year 1 sales, sales
growth, and year 1 price.
16
Figures 9.14 and 9.15
Create each scenario
17
Figures 9.16 and 9.17
After all three scenarios have been created, create the Summary Report.
18
Figure 9.18
The Scenario Report is complete
19
Generating Random Numbers
Some Excel functions can be used to generate various input data values
for several scenarios, or runs of a simulation.
20
Generating Random Numbers (cont)
The RAND and RANDBETWEEN functions are used to generate
random numbers in Excel.
The RAND function does not have any parameters; it returns a randomly
chosen fractional number between 0 and 1.
– =RAND()
You can manipulate this RAND value if you want to generate values
outside the interval between 0 and 1.
– =RAND()*(n-1) + 1
21
Figure 9.19
To generate heights, widths, and depths to calculate some probable
packaging volumes, we create random numbers between 1 and 10.
– =RAND()*9 + 1
22
Generating Random Numbers (cont)
To generate a random integer, use the INT function with the RAND
function.
23
Generating Random Numbers (cont)
The RANDBETWEEN function takes two parameters, which are the
lower and upper limits of a range.
– =RANDBETWEEN(lower_limit, upper_limit)
24
Generating Random Numbers (cont)
To generate a random number from a particular distribution, we can use
Excel’s inverse distribution functions.
25
Generating Random Numbers (cont)
We will use the RAND function as our value for the probability parameter
to generate some number between 0 and 1.
26
Figure 9.20
We generate a set of numbers from the Normal distribution with mean 50
and standard deviation 15.
– =NORMINV(RAND(), 50, 15)
27
Applications
News Vendor Problem
Game of Craps
Bidding
28
News Vendor Problem
A bookstore must determine how many 2006 comic calendars to order in
September of 2005.
It costs $2.30 to order each calendar, and they sell each one for $4.70.
After January 1, 2006, any unsold calendars are returned to the supplier
for a salvage value of $0.75 each.
29
Figure 9.21
The spreadsheet is prepared using formulas to determine unknown
values.
30
Figure 9.22
The NORMINV function is used with the RAND function to generate a
random number from the Normal distribution.
31
Figure 9.23
Runs can be made to compare profit values for several random input
values.
32
Game of Craps
In the game of Craps, a player rolls two dice.
Otherwise, the player continues rolling the dice until she matches the
value thrown on the first roll or rolls a sum of 7.
Rolling a match for the first roll wins the game, rolling a value of 7 before
a match loses the game.
33
Figure 9.24
The conditions for winning and losing on one or multiple rolls are
summarized on the spreadsheet.
34
Figure 9.25
To perform the simulation, the outcome of rolling two dice for 20 different
games is recorded for random results of each game.
35
Figure 9.26
The number of wins can be recorded when 1, 2, 3, 4, or 5 rolls are
played in a game.
36
Figure 9.26
We can create a summary table below the simulation table by counting
the number of wins for each roll among 20 games, or runs.
37
Bidding
A contractor is planning to make a bid on a construction project.
He believes that it will cost $12,000 to complete the project.
38
Figure 9.27
The inputs and output can be calculated using several formulas.
39
Figure 9.28
Simulation runs can now be generated to find the maximum profit.
40
Summary
Simulation is a modeling tool used for analyzing a process running under
different parameters.
Scenario Analysis performs all possible alternative actions and notes the
varying results from these different situations.
41
Additional Links
(place links here)
42