6 Simulation
6 Simulation
Simulation
War Simulation
Graf Helmuth von Moltke
• Regarded as the grandfather of
modern military simulation.
• Although not the inventor of
Kriegspiel, he was greatly
impressed by it as a young
officer
• As Chief of Staff of the Prussian
Army promoted its use as a
training aid.
• Kriegspiel is sometimes credited
with the Prussian victory in the
Franco-Prussian War.
What is Simulation?
Probabilistic Simulation
Monte Carlo simulation is a technique that allows people to
account for uncertainty in quantitative analysis and decision
making.
Simulation Modeling
Who uses Monte Carlo simulation?
Many companies use Monte Carlo simulation as an important part of their
decision-making process.
• GM, Proctor and Gamble, Pfizer, Bristol-Myers Squibb, and Eli Lilly :
to estimate both the average return and the risk factor of new products.
• Eli Lilly : to determine the optimal plant capacity for each drug.
• Oil and drug companies : to value "real options," such as the value of
an option to expand, contract, or postpone a project.
Simulating a Random Variable
Properties of RAND():
•Uniform property: All numbers between 0 and 1 have the same
chance of occurring.
•Independence property: Different random numbers are
probabilistically independent. A number generated previously has no
effect on the values of the following random numbers.
Uniform Distribution U[a,b]
A : If X U[0,1]
X Probability
Chinese 74.2%
Malay 13.3%
Indian 9.2%
Others 3.3%
• The user need to specify the type of distribution and the parameters
( and for the Normal, a and b for the uniform)
Example
0.4
0.3
Series1
0.2
0.1
0.0
2.0 3.0 4.0 5.0 6.0 7.0 8.0
Generating Random Numbers with a
given Continuous Probability Distribution
Example
0.8
0.6
Series1
0.4
0.2
0.0
2.0 3.0 4.0 5.0 6.0 7.0 8.0
Generating Random Numbers with a
given Continuous Probability Distribution
Steps to generate a RN that follows a given CDF F(y)
2. Place the number u on the vertical axis of the graph of the CDF F(y)
of the given distribution. Then find the point y on the horizontal
axis whose CDF value F(y) is equal to u.
3. The number y generated this way has the desired CDF F(y).
Steps to generate a RN that follows a given CDF F(y)
Suppose the [0, 1] uniform RN we get happens to be u = 0.826
1.0
F(y) u = 0.826
0.8
0.6
F(y)
0.4
F(y) = u
0.2
y = 6.851
0.0 y
0 1 2 3 4 5 6 7 8 9 10
Generating Random Numbers with a
given Continuous Probability Distribution
Steps to generate a RN that follows a given CDF F(y)
2. Place the number u on the vertical axis of the graph of the CDF F(y)
of the given distribution. Then find the point y on the horizontal
axis whose CDF value F(y) is equal to u.
3. The number y generated this way has the desired CDF F(y).
Cost data
Unit cost $7.50
Unit price $10.00
Unit refund $2.50
Uncertain quantity
Demand (average
shown) 200
Decision variable
Order quantity 200
Profit model
Demand Revenue Cost Refund Profit
200 $2,000.00 $1,500.00 $0.00 $500.00
Is it correct?
Simulation Model
Simulation with Excel
Histogram
• Step 1. Initiate “Analysis ToolPak” in Excel.
Histogram
• Step 2. Define bins in Excel worksheet.
Histogram
• Step 3. Launch Analysis ToolPak and select “Histogram”.
Histogram
• Step 4. Define inputs to create the histogram.
Histogram
• Step 5. Create histogram chart with the result.
Frequency
700
600
500
400
300 Frequency
200
100
0
Find Optimal Order with “Goal-Seek”
Configure “Goal-Seek”
What-if with “Data Table”
Step 1. Build a list of possible order quantities
What-if with “Data Table”
Step 2. Add formula of “Expected Profit” to the top of the table
What-if with “Data Table”
Step 3. Highlight the table and choose “Data Table” button
What-if with “Data Table”
Step 4. Specify B13 as the cell to be replaced by the list of options.
Result