OMGT 3223 - Lecture 7: Simulation
OMGT 3223
Lecture 7: Simulation
Lecture Objectives
Become familiar with the concept of simulation
Learn to classify simulation models
Understand how random number generators work
Learn to set up basic simulation problems for a variety of business problems
Learn to solve simulation problems in Excel using the Analytic or Risk Solver Platform add-in
Simulation
What is simulation?
“The imitative representation of the functioning of one system or process by means of the functioning of another
(a computer simulation of an industrial process)”
“The examination of a problem often not subject to direct experimentation”
Simulation refers to the imitation of some real life system or process, and involves representing certain key characteristics
or behaviors of a specific physical or abstract system.
In Business Decision Modeling, Simulation is defined as a descriptive modeling technique that enables a decision maker
to evaluate the behavior of a model under various conditions. Simulation applications in business include: Finance (e.g.
derivative valuation), Project Management, Reliability Analysis, HR Planning, and Marketing Plan Analysis.
Advantages of Simulation Disadvantages of Simulation
Allows experimentation without risk to the actual Does not produce optimal solutions
system Model development may be difficult
Reduces the time required to show long-term effects Computer run time may be substantial
Simplifies the evaluation of alternatives
Makes sensitivity analysis easy
Serves as training tool
Classification of Simulation Systems
We can classify optimization models along four different dimensions:
i. Physical vs. Computer Simulations
ii. Interactive vs. Non-interactive Simulations
iii. Stochastic vs. Deterministic Simulations
iv. Dynamic vs. Static Simulations
-1-
OMGT 3223 - Lecture 7: Simulation
i. Physical vs. Computer Simulations
A physical simulation refers to a simulation in which physical objects replace real life objects or systems. These
physical objects are often used because they are smaller or cheaper than the actual object or system. Examples of
physical simulations include mechanical flight simulators, space simulators, etc.
A computer simulation is an attempt to model a real life or hypothetical situation on a computer in order to analyze
how the real life system works. By changing different model variables, predictions may be made about the future
behavior of the system. Computer simulation has become a useful part of modeling in many disciplines (e.g., physics,
engineering, and economics). We will focus our efforts on computer simulations in this class.
ii. Interactive vs. Non-interactive Simulations
In an interactive simulation, the user interacts with the simulation in a direct manner during the simulation process.
Physical simulations are most often interactive (e.g., space simulators) though computer simulations can also be
interactive (e.g., flight simulation games).
In a non-interactive simulation, the simulation proceeds with no direct user interaction during the simulation. The
simulation models we will build will be non-interactive (i.e., we will be able to make changes to the model between
simulation runs, but not during the simulation).
iii. Stochastic vs. Deterministic Simulations
In a deterministic simulation model all parameters have known values. In a stochastic simulation model one or more
parameters are random variables described by probability distributions (The term ‘Monte Carlo’ is sometimes used to
refer to stochastic models). The simulation models we will develop in our class will be stochastic simulations.
-2-
OMGT 3223 - Lecture 7: Simulation
iv. Dynamic vs. Static Simulations
Dynamic simulation models track the state of a system as it evolves over time. A dynamic simulation models a
sequence of events over time. The most common type of dynamic simulation models in business applications involves
some sort of queuing system. A queuing system is a system where some flow unit must wait an unspecified time
waiting before it can be processed (Examples of queuing systems include: Checkout lines at a grocery store, airport
security check-in lines, etc.). Dynamic systems are often modeled using specialized simulation software applications.
A static simulation model does not track the state of a system as it evolves over time (i.e., static simulation models do
not have an explicit changing time component). Static simulation models can be used for analyzing the relationship
between different input and output variables. Static simulations are well suited to be modeled in Excel.
For the remainder of the lecture we will focus on building simulation models in Excel. We will focus on building and
analyzing simulation models that are:
i. Computer-based, ii. Non-interactive, iii. Stochastic, and iv. Static.
Monte Carlo Simulation
A Monte Carlo Method is a technique that involves using random sampling and random numbers to solve problems. The
term ‘Monte Carlo Method’ was coined in reference to games of chance, a popular attraction in Monte Carlo.
Monte Carlo Simulation is a stochastic simulation technique used when a system or process has a random component.
This method is used for iteratively evaluating an analytical model using sets of random numbers as inputs and is often
employed when the model is complex, nonlinear, or involves uncertain parameters.
Recall that an analytical model maps one or more inputs into one or more outputs using some transformation function.
In a deterministic analytical model fixed outputs In a stochastic analytical model inputs are random
can be derived from a set of fixed inputs. variables drawn from specific probability
distributions. The outputs then become random
variables because they are derived from random
inputs.
-3-
OMGT 3223 - Lecture 7: Simulation
It is relatively easy to implement a Monte Carlo simulation in Excel by extending an existing deterministic model…
To implement a Monte Carlo Simulation in Excel we need some technique to iteratively generate random inputs. Random
inputs can be generated in Excel and then be used to evaluate the model repeatedly using formulas or data tables. The
model can be solved for each set of random inputs, and the resulting outputs can then be collected and analyzed. Excel
add-ins such as the Analytic or Risk Solver Platform can simplify the process of Monte Carlo simulation in Excel!
General Approach to Monte Carlo Simulation:
Step 1: Create a model
y = f(x1, x2, ... , xq)
Step 2: Generate a set of random inputs
x1i, x2i, ... , xqi
Step 3: Evaluate the model and store the results as yi
Step 4: Repeat steps 2 and 3 for i = 1 to n
Step 5: Analyze the results using histograms, summary statistics, etc.
Simulation Example
Consider a very simple marketing application: Coupon Redemption. Consumer products companies send out ‘cents-off’
coupons. The proportion of coupons redeemed is a random variable. Some portion of the coupons that are redeemed
represent incremental sales (i.e., sales that would not have occurred without the coupon) while some other portion would
have occurred anyway. The portion of incremental sales is not known with certainty. ‘Incremental unit sales’ is therefore a
random variable.
Assume a company sends out 500,000 coupons. In the past, redemption rates have been around 2%, while 50% of the
coupons redeemed represented incremental sales. A simple deterministic model can be easily developed…
Number of Coupons Mailed
Redemption Rate
Total Coupons Redeemed
% Incremental Sales
Incremental Units Sold
We can use simulation to test this model in Excel. We simply need to extend our deterministic model and specify
probability distributions for the random inputs (‘Redemption Rate’ and ‘% incremental sales’), and track the behavior of
the random output (‘Incremental Units Sold).
Assume that past redemption rates have ranged between 0.3% and 5%, but usually around 2%. On the other hand, the
proportion of incremental sales related to redeemed coupons is most likely 50%, but can vary between 30% and 60%.
-4-
OMGT 3223 - Lecture 7: Simulation
Simulation Example Solution
Number of Coupons Mailed 500,000
Redemption Rate 2%
Total Coupons Redeemed 10,000
% Incremental Sales 50%
Incremental Units Sold 5,000
Random Inputs and Outputs:
Random inputs represent random variables defined before the simulation model is run. Random inputs are
characterized by a probability distribution (e.g., a normal distribution) specified by the user before running the model.
Random outputs represent output measures calculated by the model. These outputs are random variables with an
unknown distribution shape and are often represented as a histogram.
Random Number Generators
The generation of random inputs is a major consideration in simulation. A Random Number Generator (RNG) is a
mathematical function that randomly generates (returns) a value from a particular probability distribution. The random
numbers generated in a simulation are really, pseudo-random numbers. These numbers appear to be random but are
actually generated from a mathematical formula or algorithm!
Random Number Generation in Excel
There are multiple ways to generate random numbers in Excel:
1. Data Analysis Add-In: the Data Analysis add in can generate a static set of random numbers from a limited set
of probability distributions
2. Analytic or Risk Solver Platform Add-In: the Excel add-in can generate random numbers from a large number
of probability distributions
3. Rand Function: the Excel function Rand() can generate random numbers between 0 and 1 that can then be
converted using different probability distributions
-5-
OMGT 3223 - Lecture 7: Simulation
Regardless of what tool is used, the basic process for generating random numbers is the same:
Step 1: Randomly generate a number uniformly distributed between 0 and 1.
Step 2: Use an inverse function to transform the random number between 0 and 1into the appropriate distribution.
Tools like Data Analysis and the Analytic or Risk Solver Platform handle the entire process automatically. If we use
the Rand formula in Excel we need to manually execute the second step.
Random Number Generation Example
Assume we want to randomly generate outcomes from a normally distributed variable with a mean equal to 500
and a standard deviation equal to 50.
Find the approximate outcome (X) value for the following random numbers:
a) 0.2
b) 0.8
1. The Rand Function
The random number function in Excel is called Rand. The Rand function takes no arguments, and generates a random
number between 0 and 1. The number changes every time the spreadsheet recalculates. An inverse function (e.g., the
Norminv function) can then be used to transform the random number to a normally distributed random variable.
-6-
OMGT 3223 - Lecture 7: Simulation
Example 1: Simulating the toss of a Fair Coin
Suppose we want to simulate the act of tossing a fair coin…
The Rand() function returns uniformly distributed random numbers between 0.0 and 0.999999. The following excel
statement can simulate the act of tossing a fair coin!
Example 2: Simulating the roll of a Fair Die
Suppose we now want to simulate the act of rolling a fair die…
In this case, we want the values 1, 2, 3, 4, 5 and 6 to occur randomly with equal probability of occurrence. The
following two excel statements can simulate the act of rolling a fair die:
The Excel statement above will
If 6*RAND( ) falls in the interval:
return the following value:
0.0 to 0.999 1
1.0 to 1.999 2
2.0 to 2.999 3
3.0 to 3.999 4
4.0 to 4.999 5
5.0 to 5.999 6
Example 3: Generating Normal Random Numbers
To generate a normally distributed random number we must first generate a probability using the Rand() function.
We must then convert the output to a normal random variable using the Norminv function.
We can execute those two steps using only one formula. For example, if we want to generate a random draw from a
normally distributed variable with a mean equal to 80 and a standard deviation equal to 10 we can use the following
statement:
2. The Data Analysis Add-In
The Data Analysis add-in can generate a set of static random numbers from several different probability distributions:
Uniform, Normal, Binomial, Poisson, Discrete
-7-
OMGT 3223 - Lecture 7: Simulation
3. The Analytic or Risk Solver Platform Add-In
The Analytic or Risk Solver Platform is an Excel add-in/companion tool that supports Simulation in Excel. In the The
Analytic or Risk Solver Platform the user must: i) define probability distributions for the input parameters, ii)
identify the model outputs and iii) specify the number of iterations of the model to run.
The add-in will run the model (generating the random numbers) and collect detailed statistics on outputs. A wide
range of summary statistics will be calculated for each output. Output results are generated in both tabular and
graphical formats. Analysis can be performed inside of the add-in or the results can be easily exported to Excel for
additional analysis. The Analytic or Risk Solver Platform also supports advanced analysis such as sensitivity analysis
to help determine which variables have the biggest impact on the output variables.
Analytic or Risk Solver Platform Examples:
Example 1 - Solar System
Assume you can spend 11,600 to install a new solar hot water system for your business.
Your monthly electric bill ranges between $290 and $575, but is typically around $450.
The proportion of that bill related to hot water is most likely 40%, but varies between 30% and 50%.
The savings from the solar heater are most likely 70%, but could vary between 50% and 80%.
Download the file Example 1 Shell.xls and complete the following tasks:
1. Build an Excel model to calculate the cost savings and associated payback period for this investment.
2. Use the Analytic or Risk Solver Platform to simulate the situation and plot a histogram of the expected
savings and the payback period.
-8-
OMGT 3223 - Lecture 7: Simulation
Model Implementation in Excel:
To see the simulation results, just double-click on the output cells (‘Payback Period’ and ‘Savings’). A frequency
chart of the outcomes (shown above) will be displayed. The Statistics section (shown below) includes summary
statistics for the output cells ‘Payback Period’ and ‘Savings’. We can see that the worst case outcome was a Payback
Period of 223.5 months with Savings of $53.24, while the best case was a Payback Period of 57.6 months with
Savings of $206.71. The average Payback Period was 105.8 months and the Expected Savings were $116.89.
-9-
OMGT 3223 - Lecture 7: Simulation
Example 1 - Solar System with Incentives
Now consider the possibility of government incentives to support the proliferation of solar technology. The federal
government would offer a 35% discount on the price of the heater, while the state government would offer a flat
$1,400 discount on the unit. Recalculate the payback period if both of these incentives are enacted.
Example 2 – HR Staffing Problem
Offshore Outsourcing is an India based provider of call center operations. Each year they hire a new class of fresh
college recruits. The proportion of offers accepted follows a triangular distribution with parameters (20%, 30%, 60%).
The proportion of new hires who wash out of the initial training program follows a triangular distribution with
parameters (5%, 15%, 20%). The number of new recruits required at the end of the training program is normally
distributed with a mean of 4,000 and standard deviation of 750.
Download the file Example 2 Shell.xls and complete the following tasks:
1. Develop an Excel model that calculates the number of recruits completing the training program. Compare that
number to the number of recruits required.
2. Use the Analytic or Risk Solver Platform to run 10,000 iterations of this model. Calculate the average number
of excess recruits available and the probability of having enough recruits for the following two scenarios:
15,000 and 20,000 initial offers.
Model Implementation in Excel:
- 10 -