Tired Waitig i Queues? The get i lie ow to lear more about Queuig!
Some Begiig Notatio Let = the umber of objects i the system s = the umber of servers = mea arrival rate (arrivals per uit of time with i the system) μ = mea service rate ( services per uit of time with i the system)
Here it is - The Birth-Death Process Let N(t) = the umber i the system at time t. Ca move from state N(t) = to states N(t + t) = -1,, +1 Δ Assumptios: 1. Probability of a arrival(birth) i time Δt is Δt 2. Probability of a departure (death) i time Δt is μ 3. Probability of more tha 1 birth or more tha 1 death i time Δt is o( Δt) 4. Disjoit time itervals are statistically idepedet. Let P (t) = Probability of i the system at time t Δt
The Birth-Death Equatios ( ) ( μ ) ( ) ( μ ) ( μ ) p ( t+δ t) = p ( t) 1 Δ t + p ( t) Δt 1 1 p ( t+δ t) = p () t Δ t + p ()1 t Δt Δ t + p () t Δt : 1 1 1 1 2 2 ( ) ( μ ) ( μ ) p ( t+δ t) = p () t Δ t + p ()1 t Δt Δ t + p () t Δt : 1 1 + 1 + 1
The Solutio to the Birth-Death equatios ( ) ( μ ) ( ) ( μ ) ( μ ) p ( t+δ t) = p ( t) 1 Δ t + p ( t) Δt 1 1 p ( t+δ t) = p () t Δ t + p ()1 t Δt Δ t + p () t Δt : 1 1 1 1 2 2 ( ) ( μ ) ( μ ) p ( t+δ t) = p () t Δ t + p ()1 t Δt Δ t + p () t Δt : 1 + 1 + 1 p( t+δt) p( t) = p() t + μ1p1() t Δt p1( t+δt) p1( t) = p() t ( μ1 1) p1() t + μ2p2() t Δt : p( t+δt) p( t) = 1p 1() t ( μ ) p() t + μ+ 1p+ 1() t Δt :
Let s go to the limit lim lim : lim : Δ t o Δ t o Δ t o p( t+δt) p() t dp() t = = p() t + μ1p1() t Δt dt p1( t+δt) p1( t) dp1( t) = = p() t ( μ1 1) p1() t + μ2p2() t Δt dt p( t+δt) p() t dp() t = = 1p 1() t ( μ ) p() t + μ+ 1p+ 1() t Δt dt
Now try for steady-state dp () t dt dp1 () t dt : dp () t : dt = = p ( t) + μ p ( t) 1 1 = = p ( t) μ p ( t) + μ p ( t) ( ) 1 1 1 2 2 = = p ( t) μ p ( t) + μ p ( t) ( ) 1 1 + 1 + 1
Now solve the equatios p + μ p = 1 1 ( ) p μ p + μ p = : 1 1 1 2 2 ( ) p μ p + μ p = 1 1 + 1 + 1 Observe that we ca ow drop the argumet t sice i steady-state the probabilities are o loger chagig over time. : p 1 μ1 1 1 1 2 1 μ2 μ2 μ1μ2 p ( μ + ) p = p p = p p =... = μμ... μ 1 1 1 2 p
Let s cotiue to solve the equatios p... = μμ... μ 1 1 1 2 p sice p = 1 the p + p = 1 = = 1 1... 1 or p + p = p 1 c 1 1 μμ 1 2... μ + = = = 1 1... 1 where c = μμ... μ 1 2 The p = 1+ c ad p = c p 1 = 1
The Geeral Steady-State Solutio of the Birth-Death process C P... = 1 1 = μμ... μ = 1+ 1 2 1 1 C P = C P = 12,,... 12,,... If I kow the lambda s ad the mu s, the I ca compute the etire probability distributio.
Measures of Queuig Effectiveess L= = P L = ( s) P q = s+ 1 W L W L q = ; q = = = P P = Pr N s wait { } s 1 = 1 Pr{ 1} = 1 N s P =
The M/M/1 / /FCFS Queue This I have to see. See it derived i frot of your very eyes!
Assumptios 1. Expoetial iterarrival times (mea umber of arrivals /uit time = ) 2. Expoetial service times (mea = 1/ μ) 3. Oe service at a time 4. Ifiite Populatio 5. Ulimited queue size 6. Steady-state (equilibrium) μ = μ =
The Rate Diagram... 1 N-1 N N+1 μ μ μ μ μ The rate diagram certaily makes the aalysis simple!
The Steady-State Solutio for p 1 x = 1 = x C p p = μ 1 1 1 = = = 1 C 1 = 1 = 1 μ = μ = 1 1 = ( 1 / μ) = 1 ρ 1 / μ = Cp = = μ ( 1 / μ) ρ ( 1 ρ)
The M/M/1 Queue Measures of Effectiveess ρ = P = ρ ( 1 ρ) Pw = μ W = L= 1 μ μ W L q q = μμ ( ) 2 = μμ ( ) μ Note: Fid L from ρ L= ( 1 ρρ ) = = 1 ρ μ = the use Little s formulae.
Our Very First Queuig Problem Cars arrive at a sigle toll booth at a rate of 9 per miute. The average time it takes a car to pay the toll is 6 secods. How much of a back-up (queue) will there be? Stop Pay Toll $1.
The solutio to our very first queuig problem = 9 /miute ad μ =1/miute 9 ρ = = P = ρ (1 ρ) = (.1)(.9) Pw = =.9 μ 1 μ 1 1 9 W = = = 1mi. Wq = = =.9 mi. μ 1 9 μ( μ ) 1(1) 2 9 81 Lq L= = = 9 cars = = = 8.1 cars μ 1 9 μ( μ ) 1(1)
The M/M/S Queue 1 S-1 S S+1 μ 2μ... μ (S-1) Sμ Sμ Sμ Where S = the umber of servers; S >= 2
The Geeral Solutio M/M/s μ = for = 1,2,3,... μ for = 1, 2,3,..., s = sμ for = s, s+ 1,... C =... 1 1 μμ... μ 1 2 c 1 s! μ = 1 1 > s s! μ s s
More of The Geeral Solutio M/M/s P = 1+ 1 1 P = C P = 1,2,... C p = s 1 1 ( / μ) ( / μ) ( / μ) s s 1+ +! s! s = 1 = s 1 = s 1 s ( / μ) ( / μ) 1 +! s! = 1 sμ s
The Geeral Solutio M/M/s p s P = C P = 1,2,... p ( / μ)! p s = ( / ) μ > ss! s p s
Measures of Effectiveess M/M/s ( ) s p / L q ( s) p where 2 = s+ 1 μ ρ = = ρ = s!1 ρ sμ ( ) with a little algebra ad a trick L L= L + ; W = q ; W = W + q q q μ μ 1
Our first M/M/s Queue Problem Cars arrive at oe of 3 toll booths at a rate of 9 per miute. The average time it takes a car to pay the toll is ow 15 secods because the majority of drivers is requestig a receipt for tax purposes. How much of a back-up (queue) will there be? What is kow? = 9/miute μ = 4/miute s = 3 therefore ρ = 9/(3 x 4) =.75 /μ = 9/4 = 2.25
Three toll booths 1 1 p = = 9 81 729 2 3 1 (4) ( 9/4) ( 9/4) 1 + + + 4 2(16) 6(64) + 9 =! 3! 1 3(4) =.747664 p ( 9/4)! = ( 9/4) > (3!)3 3 (.747664) 3 (.747664) 3
More 3 toll booths L q 9 3 s ( ) (.747664) p / μ ρ 4 4 s!1 ( ρ ) 1 6 4 == = = 2 2 3 1.74 2 L= L + = 1.74 + 2.25 = 3.954; p = 1 p =.5677 q w μ = Lq 1.74 1 Wq = = =.1893; W = Wq + =.1893 +.25 =.4393 9 μ
The Excel Spreadsheet It seems easier if you use the computer? Gee, I eter the data ad out comes the aswer.
The Case of the Fiite Queue System capacity is k (fiite umber) Queue capacity is k-s Limited (physical) waitig space Arrivig etities will balk if the umber i the system is k I would t balk at this oe.
The M/M/1 k/ /FCFS Queue... 1 K-2 K-1 K μ μ μ μ The Fiite Queue! = =,1, 2,3,..., k 1 k
c Derivig the Fiite Queue s = 1 p = ρ k = μ > k ( ) k + 1 1 1 / μ 1 ρ = = = 1 ( / μ) 1 ρ / μ k k + 1 = ( ) 1 Fiite geometric series k = x 1 x = 1 x k + 1
More Derivig 1 ρ p = ρ for =,1, 2,..., k k + 1 1 ρ ( ) k + 1 ρ k + 1 ρ L= ; L (1 1 q = L p) k + 1 ρ 1 ρ L L W = ; w = where = p = p = (1 p ) k 1 q q k = =
Ca you provide a example of a fiite queue problem? Fersure! Cars arrive at a car wash at the (Poisso) rate of 25 / hour. It takes 3 miutes for a car to go through the car wash. Oly oe car ca be processed at a time. There is oly space for 2 automobiles to wait for service.
Solvig the car wash problem = 25/ hr; μ = 2 / hr; k = 3 1 1.25 ρ = 25/ 2 = 1.25; p = =.1734 4 1 (1.25) p L q 4 1.25 4(1.25) =.1734(1.25) ; L= = 1.775 4.25 1 (1.25) = 1.775 (1.1734) =.9484 ( ) = 25 1.3387 = 16.5325 where p =.3387 L.9484 W = = =.174hr = 6.44 miutes 16.5325 L 1.775 Wq = = =.574 hr = 3.44miutes 16.5325 p = 1.1734 =.8266 w P(service deial) =.3387 = p 3 3
The Case of the Fiite Populatio Populatio size is N (<< ) If there etities i the system, the there are oly N- etities remaiig i the callig populatio Impacts o the arrival rate ito the system Sometimes called the machie repair problem. Each etity is assumed to have a arrival rate ito the system give by.
The M/M/S / N /FCFS Queue Rate diagram N ( N 1) ( N S +1)... 1 S S+1... N μ Sμ 2μ Sμ Sμ
The Fiite Populatio steady-state equatios for s = 1 ( N ) N 1 = N N! N c = ( N )! μ > N 1 p = ; p = C p N! = ( N )! μ N
Performace measures for the fiite populatio model (s=1)* N + μ Lq = ( 1) p = N (1 p) = 1 N μ L= p = Lq + 1 p = N (1 p) = L Lq W = ; Wq = N N = p = ( N ) p = ( N L) = =
A example of M/M/S / 3 /FCFS There are three idetical Safeway Petium 2 Computers. Each machie fails at the (Poisso) rate of oce per day. It takes a day (average) to repair the machie. Should there be oe or two repair persos? Or brig i a 2d repair perso oly whe all 3 are dow?
The Safeway Computer (s=1) 3 2 1 1 2 3 1 1 1 C 1 = 3, C 2 = 6, C 3 = 6 p = 1/[1+15] = 1/16; p 1 = 3/16, p 2 = 6/16, p 3 = 6/16 L = 3/16 + 12/16 + 18/16 = 33/16 = 2.625 -bar = (1) (3-2.625) =.9375, W = 2.625/.9375 = 2.2 days
The Safeway Computer (s=2) 3 2 1 1 2 3 1 2 2 C 1 = 3, C 2 = 3, C 3 = 3/2 p = 1/[1+3+3+3/2] = 2/17; p 1 = 6/17, p 2 = 6/17, p 3 = 3/17 L = 6/17 + 12/17 + 9/17 = 27/17 = 1.59 -bar = 3(2/17) + 2(6/17) + (6/17) = 24/17 W = (27/17)/(36/17) = 27/24 = 1.125 days
The Safeway Computer (s=1 if =1,2 ad s=3 if =3) 3 2 1 1 2 3 1 1 3 C 1 = 3, C 2 = 6, C 3 = 2 p = 1/[1+3+6+2] = 1/12; p 1 = 3/12, p 2 = 6/12, p 3 = 2/12 L = 3/12 + 12/12 + 6/12 = 21/12 = 1.75 -bar = 3(1/12) + 2(3/12) + (6/12) = 15/12 W = (21/12)/(15/12) = 21/15 = 1.4 days