6-simulation.pdf
TRANSCRIPT
![Page 1: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/1.jpg)
DSC1007 Lecture 6Simulation
![Page 2: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/2.jpg)
War Simulation
![Page 3: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/3.jpg)
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.
![Page 4: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/4.jpg)
![Page 5: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/5.jpg)
![Page 6: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/6.jpg)
![Page 7: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/7.jpg)
What is Simulation?
• A simulation model is a computer model that imitates a real-life situation.
• The fundamental advantage of a simulation model is that it provides an entire distribution of results, not simply a single bottom-line result.
• Each different set of values for the uncertain quantities can be considered a scenario. – Simulation models allow the company to generate many
scenarios, each leading to a particular outcome.
![Page 8: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/8.jpg)
Introduction Continued
• Simulation models are also useful for determining how sensitive a system is to changes in operating conditions.
• Another benefit of a computer simulation is that it enables managers to answer what-if question without actually changing (or building) a physical system.
• Simulations are used in a variety of business settings.
![Page 9: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/9.jpg)
SimulationinBusinessSimulation models are widely used in many management settings:
•Modeling of manufacturing operations•Modeling of service operations where queues form•Modeling of investment alternatives•Analyzing and pricing of sophisticated financial instruments
![Page 10: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/10.jpg)
Aircraft Boarding Strategy
How to board all passengers in the shortest possible time?
![Page 11: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/11.jpg)
SimulationModeling
ProbabilisticSimulation
MonteCarlosimulationisatechniquethatallowspeopletoaccountforuncertainty inquantitativeanalysisanddecisionmaking.
![Page 12: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/12.jpg)
SimulationModeling
WhousesMonteCarlosimulation?ManycompaniesuseMonteCarlosimulationasanimportantpartoftheirdecision‐makingprocess.
• GM, ProctorandGamble,Pfizer,Bristol‐MyersSquibb,andEliLilly:toestimateboththeaveragereturnandtheriskfactorofnewproducts.
• EliLilly : todeterminetheoptimalplantcapacityforeachdrug.
• ProctorandGamble: tomodelandoptimallyhedgeforexrisk.
• Sears :todeterminehowmanyunitsofeachproductlineshouldbeorderedfromsuppliers.
• Oilanddrugcompanies:tovalue"realoptions,"suchasthevalueofanoptiontoexpand,contract,orpostponeaproject.
![Page 13: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/13.jpg)
Simulating a Random Variable
• The fundamental technique in simulation modeling is to simulate a random variable following certain probability distribution.
![Page 14: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/14.jpg)
UniformRandomNumbers
Uniformrandomnumbersrefertoasequenceofnumbersthatareindependent andobeytheuniformdistributionU[0,1]
EXCELrandomnumbergenerator:RAND()
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.
![Page 15: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/15.jpg)
UniformDistributionU[a,b]
Q : HowtogenerateU[a,b]randomnumbers?
IfX U[0,1]
thenY =a +(ba)X U[a,b]
GeneratingU[0,1]randomnumbersiseasy– useRAND()
A:
GeneratingU[a,b]randomnumbers– usea +(ba)RAND()
![Page 16: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/16.jpg)
OtherDistributions
GeneratingU[0,1]randomnumbers – RAND()
GeneratingU[a,b]randomnumbers – a +(ba)RAND()
Next:howtogeneraterandomnumbersthatobey– adiscrete probabilitydistribution
– acontinuous probabilitydistribution
![Page 17: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/17.jpg)
Discrete Distribution
• Example: Let X be a random variable representing race of a randomly selected Singaporean.
X ProbabilityChinese 74.2%Malay 13.3%Indian 9.2%Others 3.3%
* Data from Department of Statistics, Singapore
![Page 18: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/18.jpg)
RouletteWheel
![Page 19: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/19.jpg)
Using RAND() to Generate X[0,1]uniformrandomnumber assigned X
0.00―0.742 Chinese0.742―0.875 Malay0.875―0.967 Indian0.967―1.00 Others
Trial RandomNumber X1 .6622 .9233 .3004 .8125 .999
Chinese
IndianChineseMalayOthers
andsoon...
![Page 20: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/20.jpg)
GentleLentilCaseLOOKUPfunction– generatingvaluesofX
![Page 21: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/21.jpg)
• Mostsimulationsoftwarepackages(e.g.,CrystalBall)cangeneraterandomnumbersfromdiscrete andavarietyofcontinuous distributions,suchastheNormal distribution,theuniform distribution,etc.
• Theuserneedtospecifythetypeofdistributionandtheparameters( and fortheNormal,a andb fortheuniform)
• However,itisworthwhiletopointouthowthecomputeraccomplishesthistask.
• WillfocusonusingEXCELformulatogeneraterandomnumbers
GeneratingRandomNumberswithagivenContinuous ProbabilityDistribution
![Page 22: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/22.jpg)
GeneratingRandomNumberswithagivenContinuous ProbabilityDistribution
0.0
0.1
0.2
0.3
0.4
0.5
2.0 3.0 4.0 5.0 6.0 7.0 8.0
Series1
PDFf(y) oftheRandomVariable
Example
![Page 23: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/23.jpg)
GeneratingRandomNumberswithagivenContinuous ProbabilityDistribution
0.0
0.2
0.4
0.6
0.8
1.0
2.0 3.0 4.0 5.0 6.0 7.0 8.0
Series1
CDF F(y) oftheRandomVariable
Example
![Page 24: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/24.jpg)
StepstogenerateaRNthatfollowsagivenCDFF(y)
GeneratingRandomNumberswithagivenContinuous ProbabilityDistribution
1. Usearandomnumbergeneratortogenerateanumberu thatobeysauniform distributionbetween0.0and1.0.
2. Placethenumberu ontheverticalaxisofthegraphoftheCDFF(y)ofthegivendistribution.Thenfindthepointy onthehorizontalaxiswhoseCDFvalueF(y) isequaltou.
3. Thenumbery generatedthiswayhasthedesiredCDFF(y).
![Page 25: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/25.jpg)
0.0
0.2
0.4
0.6
0.8
1.0
0 1 2 3 4 5 6 7 8 9 10
F(y)
Supposethe[0,1]uniformRNwegethappenstobeu =0.826
y = 6.851
StepstogenerateaRNthatfollowsagivenCDFF(y)
y
F(y) u = 0.826
F(y) =u
![Page 26: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/26.jpg)
StepstogenerateaRNthatfollowsagivenCDFF(y)
1. Usearandomnumbergeneratortogenerateanumberu thatobeysauniform distributionbetween0.0and1.0.
2. Placethenumberu ontheverticalaxisofthegraphoftheCDFF(y)ofthegivendistribution.Thenfindthepointy onthehorizontalaxiswhoseCDFvalueF(y) isequaltou.
3. Thenumbery generatedthiswayhasthedesiredCDFF(y).
GeneratingRandomNumberswithagivenContinuous ProbabilityDistribution
Example: SupposewewanttogenerateRNsthatfollowtheNormaldistributionN(,)
y =NORMINV(u,,)F(y) =u
![Page 27: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/27.jpg)
Case – Ordering Calendars at Walton Bookstore
• In August, Walton Bookstore must decide how many of next year’s nature calendars to order.
• Each calendar costs the bookstore $7.50 and sells for $10. After January 1, all unsold calendars will be returned to the publisher for a refund of $2.50 per calendar.
• Walton believes that the number of calendars it can sell by January 1 follows some probability distribution with mean 200.
• How many calendars should Walton order in order to maximize the expected profit?
![Page 28: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/28.jpg)
Decision by Common SenseWalton's bookstore - deterministic model
Cost dataUnit cost $7.50Unit price $10.00Unit refund $2.50
Uncertain quantityDemand (average shown) 200
Decision variableOrder quantity 200
Profit modelDemand Revenue Cost Refund Profit
200 $2,000.00 $1,500.00 $0.00 $500.00
Is it correct?
![Page 29: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/29.jpg)
Simulation Model
![Page 30: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/30.jpg)
Simulation with Excel
![Page 31: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/31.jpg)
Histogram
• Step 1. Initiate “Analysis ToolPak” in Excel.
![Page 32: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/32.jpg)
Histogram
• Step 2. Define bins in Excel worksheet.
![Page 33: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/33.jpg)
Histogram
• Step 3. Launch Analysis ToolPak and select “Histogram”.
![Page 34: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/34.jpg)
Histogram
• Step 4. Define inputs to create the histogram.
![Page 35: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/35.jpg)
Histogram
• Step 5. Create histogram chart with the result.
0
100
200
300
400
500
600
700
Frequency
Frequency
![Page 36: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/36.jpg)
Find Optimal Order with “Goal-Seek”
![Page 37: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/37.jpg)
Configure “Goal-Seek”
![Page 38: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/38.jpg)
What-if with “Data Table”Step 1. Build a list of possible order quantities
![Page 39: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/39.jpg)
What-if with “Data Table”Step 2. Add formula of “Expected Profit” to the top of the table
![Page 40: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/40.jpg)
What-if with “Data Table”Step 3. Highlight the table and choose “Data Table” button
![Page 41: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/41.jpg)
What-if with “Data Table”Step 4. Specify B13 as the cell to be replaced by the list of options.
![Page 42: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/42.jpg)
Result
Press F9 if the result doesn’t show.
![Page 43: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/43.jpg)
Simulation with @Risk
![Page 44: 6-Simulation.pdf](https://reader034.vdocuments.us/reader034/viewer/2022051517/5695d1061a28ab9b0294d9ed/html5/thumbnails/44.jpg)
Task
• Please try to do the problem by yourself for the cases where demand follows different probability distributions.