Our favorite simple stochastic process. QUEUING Our favorite simple stochastic process.
SYSTEM DYNAMICS Body of Customers Server queue TIME = 0.0 TOTAL WAIT TIME = 0.0 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 0
I think I’ll get some service SYSTEM DYNAMICS Body of Customers Server queue I think I’ll get some service TIME = 0.0 TOTAL WAIT TIME = 0.0 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 0
SYSTEM DYNAMICS Body of Customers …this service will take 2.3 minutes… Server queue TIME = 0.0 TOTAL WAIT TIME = 0.0 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 1
SYSTEM DYNAMICS …customer departs service Body of Customers Server queue TIME = 2.3 TOTAL WAIT TIME = 0.0 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 1
I think I’ll get some service SYSTEM DYNAMICS Body of Customers Server queue I think I’ll get some service TIME = 3.4 TOTAL WAIT TIME = 0.0 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 1 …this interarrival time is 3.4 minutes…
SYSTEM DYNAMICS …this service will take 5.3 minutes… Body of Customers Server queue TIME = 3.4 TOTAL WAIT TIME = 0.0 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 2
I think I’ll get some service SYSTEM DYNAMICS Body of Customers My departure time is 8.7 Server queue I think I’ll get some service TIME = 4.6 TOTAL WAIT TIME = 0.0 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 2 …this interarrival time is 1.2 minutes…
SYSTEM DYNAMICS Body of Customers Server queue TIME = 4.6 TOTAL WAIT TIME = 0.0 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 3
I think I’ll get some service SYSTEM DYNAMICS Body of Customers Server queue I think I’ll get some service TIME = 4.9 TOTAL WAIT TIME = 0.3 TOTAL OBS. IN QUEUE = 0 ARRIVALS = 3 …this interarrival time is 0.3 minutes…
SYSTEM DYNAMICS Body of Customers Server queue TIME = 4.9 TOTAL WAIT TIME = 0.3 TOTAL OBS. IN QUEUE = 1 ARRIVALS = 4
SYSTEM DYNAMICS Body of Customers Server queue 0.3 + 2x(8.7-4.9) TIME = 8.7 TOTAL WAIT TIME = 7.9 TOTAL OBS. IN QUEUE = 1 ARRIVALS = 4
COMMENTARY Body of Customers Server queue TIME = 8.7 The customer population is considered to be “large” The summed of in-queue and in-service (2 in this case) is sufficient to predict the future Body of Customers Customers can recycle or go away Server queue Our finite-duration simulation surrogates for an infinite length of time TIME = 8.7 TOTAL WAIT TIME = 7.9 TOTAL OBS. IN QUEUE = 1 ARRIVALS = 4 Theses stats are used to calculate important measures of performance
SUMMARY STATS Body of Customers Server queue TIME = 10.0 TOTAL WAIT TIME = 7.9 TOTAL OBS. IN QUEUE = 1 ARRIVALS = 4 arrivals/min. = 4/10.0 = 0.4 wait/cust = 7.9/4 = 1.975 obs in queue = 0.25 These are samples (observations) from an unknown prob. distribution!
WHAT’S RANDOM? 2. Service times Body of Customers Server queue 1. Interarrival times TIME = 8.7 TOTAL WAIT TIME = 7.9 TOTAL OBS. IN QUEUE = 1 ARRIVALS = 4
INDEPENDENCE Waiting times for these two customers are NOT independent Body of Customers Server queue TIME = 8.7 TOTAL WAIT TIME = 7.9 TOTAL OBS. IN QUEUE = 1 ARRIVALS = 4
Lindley’s Recursion Wait(8) Service(8) InArr(9) Wait(9) Service(9) Wait(9) = Wait(8) + Service(8) – InArr(9)
DIVERSION: EXPONENTIAL RANDOM VARIABLES
Exponential Random Variables DEFINITION Let X be a random variable with distribution function 11/19/2018 Exponential Random Variables
Exponential Random Variables f(x) is the DENSITY FUNCTION F(x) is the DISTRIBUTION FUNCTION Fc(x) is the SURVIVAL FUNCTION l is the RATE, m is the EXPECTED VALUE 11/19/2018 Exponential Random Variables
Exponential Random Variables DENSITY FUNCTION area under the curve is 1.0 11/19/2018 Exponential Random Variables
DERIVING EXPECTED VALUE The Definition of Expectation 11/19/2018 Exponential Random Variables
DERIVING EXPECTED VALUE f(x) = 0 if x < 0 11/19/2018 Exponential Random Variables
DERIVING EXPECTED VALUE Integration by parts 11/19/2018 Exponential Random Variables
DERIVING EXPECTED VALUE Integral of the density function integrates to 1 “zero times infinity” uses L’Hopital’s Rule 11/19/2018 Exponential Random Variables
DERIVING EXPECTED VALUE Integration by parts and Induction 11/19/2018 Exponential Random Variables
Exponential Random Variables VARIANCE DERIVATION 11/19/2018 Exponential Random Variables
COEFFICIENT OF VARIATION c.v. defined as the ratio of the mean to the standard deviation standard deviation is SQRT(VAR(X))=1/l c.v. for exponentials is always 1.0 11/19/2018 Exponential Random Variables
MIN OF TWO EXPONENTIALS Let X1 and X2 be two exponential random variables rates l1 and l2 independent What’s the probability X1 is smaller than X2? l1 / (l1+l2) 11/19/2018 Exponential Random Variables
DISTRIBUTION OF THE MINIMUM Let Z = min(X1, X2) then Z is exponentially distributed with rate l1+l2 11/19/2018 Exponential Random Variables
Exponential Random Variables MEET THE SNAILS! 100cm 1 Snail covers 100cm in time X1 X1~expon(1.0 days) E[X1] = 1/1 P[X1>1] = e-1=0.37 11/19/2018 Exponential Random Variables
Exponential Random Variables 100cm 1 1 1 1 n Let Zn = winning time in an n-snail race Zn ~ expon(nl) E[Zn]=1/nl lim E[Zn] = 0 as n gets large Discuss common error of taking expectations too soon. 11/19/2018 Exponential Random Variables
RELEVANCE N (large) customers independently decide when to go for service creating N go times Customer #1’s go time is assumed to be 0.0 Customer #2’s inter-arrival time is the minimum of any remaining go times minus Customer #1’s go time It is appropriate to model interarrival times as exponentials!
M/M/1 CONVENTION & NOTATION l conventionally used as the parameter of the exponential distribution for arrivals M (Markov) is a symbol for exponentially distributed inter-arrivals or service times M/M/1 arrivals departures number of servers
LITTLE’S LAW Imagine that a customer pays $1/min. to stand in line Let (0, T] be a long time interval Let N(t) be the number of customers arriving in (0, T] Let $ = proceeds in (0, T]
$1 = T * Avg system earnings per min system earning per min = length of waiting line (L) $2 = N(T) * Avg customer waiting cost customer waiting cost = his waiting time (W) $1 = $2
LITTLE’S LAW TRUE FOR ALL QUEUES!
EXTENSION arrive ~ l Service~m1 depart ~ l
EXTENSION m123 Service~m1 m2 m100 m4 m1 m666 arrive ~ l arrive ~ l the JACKSON NETWORK arrive ~ l arrive ~ l m123 Service~m1 m2 probabilistic routing is PP filtering m100 depart ~ l m4 m1 m666