42
Simulation Simulation

Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Embed Size (px)

Citation preview

Page 1: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

SimulationSimulation

Page 2: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Functions

• Actually, we’ve already done this with the normal distribution.

Page 3: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Normal

• Actually, we’ve already done this with the normal distribution.

x

3.0

0.1

x = + z

= 3.0 + 0.3 x 1.282

= 3.3846

XZ

Page 4: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

0

Inverse ExponentialExponential Life

0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

1.6

1.8

2.0

0 0.5 1 1.5 2 2.5 3

Time to Fail

Den

sit

y

a

f x e x( )

f(x)F a X a( ) Pr{ }

e dxxa

0

e x a

1 e a

Page 5: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Exponential

xF Xe

1 -)(F(x)

x

Page 6: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Exponential

aF ae

= 1 - )(F(x)

x

F(a)

a

Page 7: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Exponential

Suppose we wish to find a such that the probability of a failure is limited to 0.1.

F(x)

x

F(a)

a

Page 8: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Exponential

Suppose we wish to find a such that the probability of a failure is limited to 0.1.

0.1 = 1 -

ae

F(x)

x

F(a)

a

Page 9: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Exponential

Suppose we wish to find a such that the probability of a failure is limited to 0.1.

0.1 = 1 -

ln(0.9) = -a

F(x)

x

F(a)

a

ae

Page 10: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Exponential

Suppose we wish to find a such that the probability of a failure is limited to 0.1.

0.1 = 1 -

ln(0.9) = -a

ae

F(x)

x

F(a)

a

a = - ln(0.9)/

Page 11: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Inverse Exponential

Suppose a car battery is governed by an exponential distribution with = 0.005. We wish to determine a warranty period such that the probability of a failure is limited to 0.1.

a = - ln(0.9)/

= - (-2.3026)/0.005

= 21.07 hrs.

F(x)

x

F(a)

a

Page 12: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Model

Customers arrive randomly in accordance withsome arrival time distribution. One server services customers in order of arrival. The service time is random following someservice time distribution.

Page 13: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue

M/M/1 Queue assumes exponential interarrival times and exponential service times

A eiAi

S eiSi

Page 14: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue

M/M/1 Queue assumes exponential interarrival times and exponential service times

A eiAi

S eiSi

South Dakota

School of Mines & Technology

Expectations for ExponentialExpectations for Exponential

Exponential Review

Expectations

Introduction toProbability & Statistics

Exponential ReviewExponential Review

Page 15: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue

2.032 1.951 1.349 .795 .539 .347

0.3050.0740.0350.5201.5350.159

Page 16: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue

2.032 1.951 1.349 .795 .539 .347

0.3050.0740.0350.5201.5350.159

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873 0.795 0.795 0.830 0.000 0.0354 1.349 1.349 1.869 0.000 0.5205 1.951 1.951 3.486 0.000 1.5356 2.032 3.486 3.646 1.454 1.613

Avg = 0.261 0.699

Page 17: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue

.347

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.34723456

Avg = #DIV/0! #DIV/0!

Page 18: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue.347

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.34723456

Avg = #DIV/0! #DIV/0!

Page 19: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 0

Sum =TimeAvg

Page 20: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue.539 .347

0.305

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.3472 0.5393456

Avg = #DIV/0! #DIV/0!

Page 21: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 00.539 2 arrive 1 2 1 0.1920.6520.7260.7950.8301.3491.8691.9512.0323.4863.646

Sum = 0.192TimeAvg 0.053

Page 22: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue.539 0.652

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.5393456

Avg = 0.000 0.305

.795

Page 23: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue.539

0.074

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.6523456

Avg = 0.000 0.305

0.652.795

Page 24: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 00.539 2 arrive 1 2 1 0.1920.652 1 depart 0 1 1 0.1130.7260.7950.8301.3491.8691.9512.0323.4863.646

Sum = 0.305TimeAvg 0.084

Page 25: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue

0.726

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873456

Avg = 0.056 0.246

.795

Page 26: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 00.539 2 arrive 1 2 1 0.1920.652 1 depart 0 1 1 0.1130.726 2 depart 0 0 0 0.0740.7950.8301.3491.8691.9512.0323.4863.646

Sum = 0.379TimeAvg 0.104

Page 27: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873 0.795456

Avg = 0.056 0.246

.795

Page 28: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 00.539 2 arrive 1 2 1 0.1920.652 1 depart 0 1 1 0.1130.726 2 depart 0 0 0 0.0740.795 3 arrive 0 1 1 0.000

Sum = 0.379TimeAvg #DIV/0!

Page 29: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue.795

0.035

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873 0.795456

Avg = 0.056 0.246

0.8301.349

Page 30: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue

0.830

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873 0.795 0.795 0.830 0.000 0.035456

Avg = 0.038 0.176

1.349

Page 31: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 00.539 2 arrive 1 2 1 0.1920.652 1 depart 0 1 1 0.1130.726 2 depart 0 0 0 0.0740.795 3 arrive 0 1 1 0.0000.830 3 depart 0 0 0 0.035

Sum = 0.414TimeAvg #DIV/0!

Page 32: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue1.349

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873 0.795 0.795 0.830 0.000 0.0354 1.34956

Avg = 0.038 0.176

Page 33: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 00.539 2 arrive 1 2 1 0.1920.652 1 depart 0 1 1 0.1130.726 2 depart 0 0 0 0.0740.795 3 arrive 0 1 1 0.0000.830 3 depart 0 0 0 0.0351.349 4 arrive 0 1 1 0.000

Sum = 0.414TimeAvg #DIV/0!

Page 34: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue1.349

0.520

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873 0.795 0.795 0.830 0.000 0.0354 1.34956

Avg = 0.038 0.176

1.8691.951

Page 35: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Queue1.8691.951

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873 0.795 0.795 0.830 0.000 0.0354 1.349 1.349 1.869 0.000 0.52056

Avg = 0.028 0.262

Page 36: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 00.539 2 arrive 1 2 1 0.1920.652 1 depart 0 1 1 0.1130.726 2 depart 0 0 0 0.0740.795 3 arrive 0 1 1 0.0000.830 3 depart 0 0 0 0.0351.349 4 arrive 0 1 1 0.0001.869 4 depart 0 0 0 0.520

Sum = 0.934TimeAvg #DIV/0!

Page 37: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 QueueM/M/1 Queue2.032 1.951 1.349 .795 .539 .347

0.3050.0740.0350.5201.5350.159

Time of Start Depart Time in Time inPart No. Arrival Service Time Queue System

0 -- -- 0 -- --1 0.347 0.347 0.652 0.000 0.3052 0.539 0.652 0.726 0.113 0.1873 0.795 0.795 0.830 0.000 0.0354 1.349 1.349 1.869 0.000 0.5205 1.951 1.951 3.486 0.000 1.5356 2.032 3.486 3.646 1.454 1.613

Avg = 0.261 0.699

Page 38: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Event Calendar

Event Event BusyTime Part No. Type Q(t) S(t) B(t) Time

0 -- start 0 0 0 00.347 1 arrive 0 1 1 00.539 2 arrive 1 2 1 0.1920.652 1 depart 0 1 1 0.1130.726 2 depart 0 0 0 0.0740.795 3 arrive 0 1 1 0.0000.830 3 depart 0 0 0 0.0351.349 4 arrive 0 1 1 0.0001.869 4 depart 0 0 0 0.5201.951 5 arrive 0 1 1 0.0002.032 6 arrive 1 2 1 0.0813.486 5 depart 0 1 1 1.4543.646 6 depart 0 0 0 0.160

Sum = 2.629TimeAvg 0.721

Page 39: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Performance Measures

Number in Queue

0

3

0 1 2 3 4

Time

Q(t

)

Page 40: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Performance Measures

Number in System

0

3

0 1 2 3 4

Time

S(t

)

Page 41: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

M/M/1 Performance Measures

Busy/Idle

0

2

0 1 2 3 4

Time

B(t

)

Page 42: Simulation. Inverse Functions Actually, we’ve already done this with the normal distribution

Applications; Financial