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

Preview:

Citation preview

SimulationSimulation

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

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

Inverse Exponential

xF Xe

1 -)(F(x)

x

Inverse Exponential

aF ae

= 1 - )(F(x)

x

F(a)

a

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

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

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

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)/

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

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.

M/M/1 Queue

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

A eiAi

S eiSi

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

M/M/1 Queue

2.032 1.951 1.349 .795 .539 .347

0.3050.0740.0350.5201.5350.159

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

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!

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!

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

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!

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

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

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

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

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

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

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

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!

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

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

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!

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

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!

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

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

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!

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

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

M/M/1 Performance Measures

Number in Queue

0

3

0 1 2 3 4

Time

Q(t

)

M/M/1 Performance Measures

Number in System

0

3

0 1 2 3 4

Time

S(t

)

M/M/1 Performance Measures

Busy/Idle

0

2

0 1 2 3 4

Time

B(t

)

Applications; Financial