Top Banner
DSC1007 Lecture 6 Simulation
44
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 6-Simulation.pdf

DSC1007 Lecture 6Simulation

Page 2: 6-Simulation.pdf

War Simulation

Page 3: 6-Simulation.pdf

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
Page 5: 6-Simulation.pdf
Page 6: 6-Simulation.pdf
Page 7: 6-Simulation.pdf

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

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

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

Aircraft Boarding Strategy

How to board all passengers in the shortest possible time?

Page 11: 6-Simulation.pdf

SimulationModeling

ProbabilisticSimulation

MonteCarlosimulationisatechniquethatallowspeopletoaccountforuncertainty inquantitativeanalysisanddecisionmaking.

Page 12: 6-Simulation.pdf

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

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

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

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

OtherDistributions

GeneratingU[0,1]randomnumbers – RAND()

GeneratingU[a,b]randomnumbers – a +(ba)RAND()

Next:howtogeneraterandomnumbersthatobey– adiscrete probabilitydistribution

– acontinuous probabilitydistribution

Page 17: 6-Simulation.pdf

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

RouletteWheel

Page 19: 6-Simulation.pdf

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

GentleLentilCaseLOOKUPfunction– generatingvaluesofX

Page 21: 6-Simulation.pdf

• 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

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

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

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

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

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

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

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

Simulation Model

Page 30: 6-Simulation.pdf

Simulation with Excel

Page 31: 6-Simulation.pdf

Histogram

• Step 1. Initiate “Analysis ToolPak” in Excel.

Page 32: 6-Simulation.pdf

Histogram

• Step 2. Define bins in Excel worksheet.

Page 33: 6-Simulation.pdf

Histogram

• Step 3. Launch Analysis ToolPak and select “Histogram”.

Page 34: 6-Simulation.pdf

Histogram

• Step 4. Define inputs to create the histogram.

Page 35: 6-Simulation.pdf

Histogram

• Step 5. Create histogram chart with the result.

0

100

200

300

400

500

600

700

Frequency

Frequency

Page 36: 6-Simulation.pdf

Find Optimal Order with “Goal-Seek”

Page 37: 6-Simulation.pdf

Configure “Goal-Seek”

Page 38: 6-Simulation.pdf

What-if with “Data Table”Step 1. Build a list of possible order quantities

Page 39: 6-Simulation.pdf

What-if with “Data Table”Step 2. Add formula of “Expected Profit” to the top of the table

Page 40: 6-Simulation.pdf

What-if with “Data Table”Step 3. Highlight the table and choose “Data Table” button

Page 41: 6-Simulation.pdf

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

Result

Press F9 if the result doesn’t show.

Page 43: 6-Simulation.pdf

Simulation with @Risk

Page 44: 6-Simulation.pdf

Task

• Please try to do the problem by yourself for the cases where demand follows different probability distributions.