Lec13 - MMs - Queueing System 1-4 y 13-Final
Lec13 - MMs - Queueing System 1-4 y 13-Final
Lec13 - MMs - Queueing System 1-4 y 13-Final
OR372-Dr.Khalid Al-Nowibet 2
4.3 M/M/s Queueing Model
Steady-State Distribution
Rate Diagram: v ice
Ser
Consider an M/M/3 system l
Queue is Open n en
tia µ
p o 1
system size → ∞ Ex
µ
λ = λe 2
µ
3
system in state n = 1 ⇒ 1 server busy ⇒ total service speed = µ
system in state n = 2 ⇒ 2 servers busy ⇒ total service speed = 2µ
system in state n = 3 ⇒ 3 servers busy ⇒ total service speed = 3µ
system in state n = 4 ⇒ 3 servers busy ⇒ total service speed = 3µ
…
system in state n > 3 ⇒ 3 servers busy ⇒ total service speed = 3µ
OR372-Dr.Khalid Al-Nowibet 3
4.3 M/M/s Queueing Model
Steady-State Distribution
Rate Diagram:
1. Arrival rate = λ for all states of the system
2. Service rate = nµ if n ≤ s
Service rate = sµ if n > s
λ λ λ λ λ λ λ
0 1 2 . . . s-1 s s+1 . . .
µ 2µ 3µ (s-1)µ sµ sµ sµ
λ λ λ λ
. . . n-1 n n+1 . . .
OR372-Dr.Khalid Al-Nowibet sµ sµ sµ sµ 4
4.3 M/M/s Queueing Model
Average Average
Steady-State Distribution Rate out of = Rate in to
State n State n
Balance Equations:
λ λ λ λ λ λ λ
0 1 2 . . . s-1 s s+1 . . .
µ 2µ 3µ (s-1)µ sµ sµ sµ
n = 0 ⇒ λP0 = µP1
n = 1 ⇒ λP1 + µP1 = λP0 + 2µP2 ⇔ (λ+µ)P1 = λP0 + 2µP2
n = 2 ⇒ λP2 + 2µP2 = λP1 + 3µP3 ⇔ (λ+2µ)P2 = λP1 + 3µP3
n = 3 ⇒ λP3 + 3µP3 = λP2 + 4µP4 ⇔ (λ+3µ)P3 = λP2 + 4µP4
.... .......
n = s ⇒ λPs + sµPs = λPs-1 + sµPs+1⇔ (λ+sµ)Ps = λPs-1 + sµPs+1
OR372-Dr.Khalid Al-Nowibet 5
4.3 M/M/s Queueing Model
Average Average
Steady-State Distribution Rate out of = Rate in to
State n State n
Balance Equations:
λ λ λ λ
. . . n-1 n n+1 . . .
sµ sµ sµ sµ
.... .......
n = s ⇒ λPs + sµPs = λPs-1 + sµPs+1⇔ (λ+sµ)Ps = λPs-1 + sµPs+1
n = s+1 ⇒ λPs+1 + sµPs+1 = λPs + sµPs+2
⇔ (λ+sµ)Ps+1 = λPs + sµPs+2
.... .......
n > s ⇒ λPn + sµPn = λPn-1 + sµPn+1
⇔ (λ+sµ)Pn = λPn-1 + sµPn+1
OR372-Dr.Khalid Al-Nowibet 6
4.3 M/M/s Queueing Model
Steady-State Distribution
Solution of Balance Equations:
OR372-Dr.Khalid Al-Nowibet 7
4.3 M/M/s Queueing Model
Steady-State Distribution
Solution of Balance Equations:
OR372-Dr.Khalid Al-Nowibet 8
4.3 M/M/s Queueing Model
Steady-State Distribution
Solution of Balance Equations:
Make all equations functions of P0 only:
OR372-Dr.Khalid Al-Nowibet 9
4.3 M/M/s Queueing Model
Steady-State Distribution
Solution of Balance Equations:
Make all equations functions of P0 only:
Let ρ = λ
µ
Eq-1 ⇔ P1 = ρ P0
2
Eq-2 ⇔ P2 = (ρ /2)P0
Eq-3 ⇔ P3 = (ρ3/6)P0
......
Eq-n ⇔ Pn = (ρn/n!)P0 n<s
......
n
Eq-n ⇔ Pn = [ρ /(s! sn-s)]P0 n≥s
OR372-Dr.Khalid Al-Nowibet 10
4.3 M/M/s Queueing Model
Steady-State Distribution
Solution of Balance Equations:
∑P
Computing P0 :
n =1
∀n
P0 + P1 + P2 + … +Ps +Ps+1 + … + Pn +Pn+1 + … = 1
OR372-Dr.Khalid Al-Nowibet 11
4.3 M/M/s Queueing Model
Steady-State Distribution
Pn is a function of P0
Solution of Balance Equations: if P0 = 0 ⇒ system is infinite
system is finite if an only if P0 > 0
Computing P0 : −1
⎡ ρ
s −1 n ∞
ρ ⎤
n
P0 = ⎢∑ + ∑ n − s ⎥
⎣ n =0 n! n = s s! s ⎦
ρn n → ∞
finite sum ⇒ finite value infinite sum ⇒ n−s
0
constant s! s
ρn ⎛ ss ⎞ ρ n ρ n
ρ
n−s
= ⎜⎜ ⎟⎟ n ⇒ n → 0 if <1
s! s ⎝ s! ⎠ s s s
Steady-State ρ λ
Condition = <1
OR372-Dr.Khalid Al-Nowibet s sµ 12
4.3 M/M/s Queueing Model
Steady-State Distribution
Solution of Balance Equations:
Pn Formula:
−1
⎡ λ sµ s
λ ⎤ s −1 n
P0 = ⎢ +∑ n ⎥
ρ λ
= <1
⎣ s!µ s
s µ − λ n =0 n!µ ⎦ s sµ
λn ρn
Pn = P n<s Pn = P0 n<s
n! µ n 0
n!
λn ρn
Pn = n−s
P0 n≥s Pn = P
n−s 0 n≥s
s! s µ n
s! s
OR372-Dr.Khalid Al-Nowibet 13
4.3 M/M/s Queueing Model
Performance Measures
In steady state
λ , µ , P0
LB = E[busy servers] = E[#Cust. in service]
Ls = Lq + LB
Ws = Wq + (1/µ)
System is
Ls = λWs in Steady Stead
Lq = λWq
LB = λWB
ρn
s -1 ∞
ρn P0 ⎛ s-1 ∞
ρ n
⎞
= ∑ n P0 + ∑ n n − s P0 = ⎜⎜ ∑ n ⋅ ρ + s ∑ n n ⎟⎟
n s
n =0 s! n =s s! s s! ⎝ n =0 n =s s ⎠
λ ⎡ (λ / µ) s λµ ⎤ ⎡ ρ s +1 ⎤
Ls = + ⎢ P = ρ+ ⎢
2⎥ 0
P
2⎥ 0
µ ⎣ ( s − 1)! ( sµ − λ) ⎦ ⎣ ( s − 1)!( s − ρ) ⎦ ρ= λ
µ
OR372-Dr.Khalid Al-Nowibet 15
4.3 M/M/s Queueing Model
Performance Measures
⇒ LB = λWB = λ (1/µ) = ρ
OR372-Dr.Khalid Al-Nowibet 17
4.3 M/M/s Queueing Model
Performance Measures
3. Average Customers in Queue Lq:
Lq = Ls − LB
or
Number of customer in queue = 0 with Pr{n ≤ s} = P0+P1+P2+…+Ps
Number of customer in queue = 1 with Pr{n = s+1} = Ps+1
Number of customer in queue = 2 with Pr{n = s+1} = Ps+2
…. …
Lq = 0.(P0 +P1+P2+…+Ps )+ 1.Ps+1 + 2.Ps+2 + 3.Ps+3 …
∞
= ∑ (n − s) ⋅ Pn = Ls – λ/µ
n =s
OR372-Dr.Khalid Al-Nowibet 18
4.3 M/M/s Queueing Model
Performance Measures
U = Pr{ n > 0 } = P1 + P2 + P3 + … = 1 − P0
OR372-Dr.Khalid Al-Nowibet 19
4.3 M/M/s Queueing Model
Performance Measures
Ls
Ls = λ .Ws ⇔ Ws =
λ
Lq
Lq = λ .Wq ⇔ Wq =
λ
OR372-Dr.Khalid Al-Nowibet 20
4.3 M/M/s Queueing Model
Example: Consider a bank with two tellers. An average of
90 customers per hour arrive at the bank and wait in a
single line for an idle teller. The average time it takes to
serve a customer is 1.2 minutes. The bank opens daily at
9:00 am and closes at 4:00 pm. Assume that interarrival
times and service times are exponential. Determine
1. The expected number of customers present in the bank
2. The expected length of time a customer spends in the bank
3. Average number of busy tellers.
4. The expected total time that all tellers are busy.
5. The expected total time that a teller #1 is idle.
6. The manager decided to hire a 3rd teller if the average queue
length is more than 9 customers or the waiting time exceeds
5 minutes. Should a 3rd be hired?
OR372-Dr.Khalid Al-Nowibet 21
4.3 M/M/s Queueing Model
Example:
Arrivals: λ = 90 cust/hr Poisson
Service: E[S] = 1.2 min. Exponential
⇒ µ = 1/E[S] = 1/1.2 cust/min
= 60/1.2 = 50 cust/hr
Servers: s = 2 ⇒ M/M/2 ρ/s = 90/(2(50)) = 0.9 < 1
= ⎢ +∑ ⎥ = 0.0526
⎣ 2! 2 − 1 . 8 n =0 n! ⎦
⎡ (1.8)3 ⎤
Ls = 1.8 + ⎢ P
2⎥ 0 = 9.4737 customers
⎣ (1)!(2 − 1.8) ⎦
OR372-Dr.Khalid Al-Nowibet 23
4.3 M/M/s Queueing Model
Example:
2. The expected time a customer spends in the bank
OR372-Dr.Khalid Al-Nowibet 24
4.3 M/M/s Queueing Model
Example:
4. The expected total time that all tellers are busy