Chapter 14
Simulation
What Is Simulation?
• Simulation is to mimic a process by using computers.
Simulation and Decision Making
• Simulation helps pre-view a complicated business process to identify possible problems;
• It allows to try different decision alternatives, and select the best alternative as the decision.
Simulation and Uncertainty
• Simulation is particularly useful when there exist uncertainties (demand, processing time, for example) in a process with many correlated factors.
Probable Events andRandom Numbers
• Probable events:– Tossing a coin, it may land on Head (0.5) or Tail
(0.5).– Daily demand of an item can be 4 units (0.3), 5
units (0.45), or 6 units (0.25).
• Computers can randomly generate a number between 0 and 1.
• Monte Carlo Technique is using random numbers to do simulations.
Monte Carlo Process• The Monte Carlo process is an approach of
simulating a physical process with randomly generated numbers. The key idea:
Probability of a possible actual outcome =
Probability of the corresponding possible outcome in the simulation with random numbers
How “Monte Carlo” Works
Step 1. Put all possible outcomes and their probabilities in a table;
Step 2. Calculate cumulative probabilities;Step 3. Use the cumulative probabilities as
the cutting points of random number ranges.
Simulate Tossing Coins
• So, we can simulate the result of tossing a coin by generating a random number T so that if T is between 0 and 0.5, then the result is “Head”; if T is between 0.5 and 1, then the result is “Tail”.
Possible Outcome Probability Cumulative
ProbabilityHead 0.5 0.5Tail 0.5 1.0
Simulate Tossing a Dice
So,(0 to 0.1667) for “landing with 1”;(0.1667 to 0.333) for “landing with 2”;…(0.8333 to 1) for “landing with 6”.
Possible outcome Probability Cumulative Probability
1 1/6 1/6 = 0.1667
2 1/6 2/6 = 0.3333
3 1/6 3/6 = 0.5
4 1/6 4/6 = 0.6667
5 1/6 5/6 = 0.8333
6 1/6 6/6 = 1.0
Simulate Daily Demands
Daily Demand
Probability Cumulative Probability
Random Number Range
40 units 0.250 units 0.560 units 0.3
=RAND()
• =RAND() is an Excel function generating a random number between 0 and 1.
=IF()
• Syntax of =IF() function in Excel:=IF(C,a,b)It means: If condition C is true then the function value is a, otherwise the value is b.
• e.g. For tossing coins: =IF(C4>0.5, ”Head”, ”Tail”)
• =IF() function can be nested, e.g.=IF(B5<0.2, 40, IF(B5<0.7,50, 60))
=VLOOKUP()
• If we use =IF() function to represent six possible outcomes in tossing a dice case, then we have to have get =IF() function nested for five times, which is too awkward.
• =VLOOKUP() facilitates our work in that case.• Syntax of =VLOOKUP():
=VLOOKUP(value to lookup, range table,2)
Range Table for =VLOOKUP()
• 1st column contains separating points of ranges– Start from the smallest allowable number of the
ranges– In ascending order
• 2nd column lists values of =VLOOKUP corresponding to the ranges.
=VLOOKUP() for Tossing Dices (1)
• Set up the table of ranges.– Cumulative probabilities are in the 1st column,
starting from 0– Possible outcomes are in the 2nd column.
B C
5 Cumu. Prob Values6 0 17 0.1667 28 0.3333 39 0.5 4
10 0.6667 511 0.8333 612 1
=VLOOKUP() for Tossing Dices (2)
• Generate the simulation table:– In F5: =RAND()– In G5: =VLOOKUP(F5, $B$6:$C$12, 2)– Copy E5, F5, and G5 down to other rows.
E F G2 Simulation of tossing dices 3
4Tossing
#Random number
Outcome of tossing
5 1 0.618707 46 27
Simulate Demands (1)
• Possible daily demands (from past data):
Demand Probability8 0.01
9 0.0610 0.1111 0.3412 0.3113 0.1014 0.0515 0.02
Simulate Demands (2)
• Calculate Cumulative Probabilities:
Demand Probability Cumulative Probability8 0.01 0.01
9 0.06 0.0710 0.11 0.1811 0.34 0.5212 0.31 0.8313 0.10 0.9314 0.05 0.9815 0.02 1.00
Simulate Demands (3)
• Generate Vlookup range table in Excel
E F
Cumulative Probability Demand
4 0 85 0.02 96 0.07 107 0.18 118 0.52 129 0.83 13
10 0.93 1411 0.98 1512 1
Simulate Demands (4)
• Generate Simulations in Excel– In B4: =RAND() – In C4: =VLOOKUP(B4,$E$4:$F$12,2)– Copy A4, B4, C4 down to other rows
A B C
3Day #
Random number
Demand
4 1 0.575409 125 26 3
Tips of using Excel
• Use cell addresses, relative or absolute, rather than the values in the cells;
• Use Copy / Paste functions as far as possible;• Use multiple columns to decompose
complicated formulas;• Put the parameters to be changed on the top
of the spreadsheet;• Put the summary results on top.
Simulation for Decision Making• A simulation is actually a description of
day-by-day or week-by-week business operations.
• For a decision alternative, the simulation shows its effects on business quality or/and profit.
• After trying alternatives, the manager can pick one that would be best for business.
How Many Cases to Stock? (1)• Product BC-6 costs $56.95/case from the supplier, and is sold
at the price of $91.80/case. For the cases unsold at the end of a week, the store will sell them to a convenient store at price of $12.50/case. Shortage penalty cost is about $4 per case short. Possible demands of a week and their probabilities are as follows from the past records:
• Manager Wendy is considering how many cases of product BC-6 to stock at beginning of each week.
Weekly demand of BC-6 Probability
11 cases 0.45
12 cases 0.35
13 cases 0.2
Simulations of Weekly Business Operations on BC-6
Selling price ($): 91.80 per caseSalvage value ($): 12.50 per case unsolde at the end of a weekOrder cost ($): 56.95 per caseGoodwill penalty ($): 4.00 per case short
Number of cases of BC-6 to stock every week: 12 <- enter your trial order quantity in casesTotal number of cases shortage in 52 weeks: 14Total number of cases surplus in 52 weeks: 18Total profit in 52 weeks: 20,263.00 Average weekly profit of 52 weeks: 389.67
Week #
Number of cases ordered
per week
Random #
Weekly Demand
(case)
Numbr of cases sold in
the week
Revenue of the week from
regular sales ($)
Number of cases
short in the week
Goodwill penalty in the
week due to
shortage ($)
Number of cases
surplus in the week
Revenue of the week
from selling surplus at salvage price ($)
Total revenue of the
week ($)
Total cost of
the week ($)
Total profit of the week
($)
1 12 0.527107 12 12 1101.6 0 0 0 0 1101.6 683.4 418.22 12 0.951569 13 12 1101.6 1 4 0 0 1101.6 687.4 414.23 12 0.059013 11 11 1009.8 0 0 1 12.5 1022.3 683.4 338.94 12 0.967144 13 12 1101.6 1 4 0 0 1101.6 687.4 414.25 12 0.466342 12 12 1101.6 0 0 0 0 1101.6 683.4 418.26 12 0.070006 11 11 1009.8 0 0 1 12.5 1022.3 683.4 338.9
How Simulation Helps Decide How Many Cases to Stock (3)
• The worksheet each time simulates 52 weeks of business operations.
• Given the number of cases to order (green cell), Excel gives the operation results of 52 weeks (yellow cells).
• Decision maker may change the green cell, observe the outcome of 52 weeks in yellow cells, and choose the best order quantity.
Inventory Simulation (1)
• An inventory simulation simulates day-by-day transactions occurred on inventory, such as daily demand of inventoried item, number of units in stock, placing an order, length of lead time, and costs involved.
• An inventory simulation helps determine when to place an order to the supplier and how many units in an order.
Inventory Simulation of 365 days
Ordre Quantity: 150 Cost H per day: 0.05 Total holding: 718.3Reorder Point: 10 Cost S per order: 25 Total setup: 125
Cost L.S. / unit: 20 Total L.S. cost: 500Overall total: 1343.3
Total 750 15099 97.195 758 25 14366 750 3.0048 16 34
DayUnits
receivedBegin on
hand Rand # DemandLost sales
Ending on hand Order?
Order Quantity Rand #
Lead Time
Lead time Remaining
0 0 25 0 0 25 0 01 0 25 0.6682 4 0 21 N 0 0 02 0 21 0.9004 5 0 16 N 0 0 03 0 16 0.5151 4 0 12 N 0 0 04 0 12 0.3733 4 0 8 Y 150 0.5057 3 35 0 8 0.8038 5 0 3 N 0 0 26 0 3 0.9435 6 3 0 N 0 0 17 0 0 0.7776 5 5 0 N 0 0 08 150 150 0.5561 4 0 146 N 0 0 0
How Simulation Helps Make Inventory Decision (3)
• For each “re-order point” and “order quantity” tried, the simulation shows the total inventory cost (including holding cost, ordering cost, and lost sales cost) of a year.
• A good re-order point (showing when to place an order) and a good order quantity (showing many units in an order) can thus be selected from many alternatives.
Other Examples of Business Simulations with Excel
• Minutes-by-minutes waiting lines;• Gambling game;• Production in a workshop;• Transactions in a bank;• Truck transportation;• Department store operations to see
the requirements of resources.