More of the Queuing Phenomenon
The Middle Game Continues …
A potpourri of queuing topics selected especially for you
A Smorgasbord of Queuing TopicsThe menu:
Observations on queuingA “homemade” modelThe M/G/1 queue
Wow!
A General Queuing Law
.2 .4 .6 .8 1.0 utilization rate
W = L /λ
/ 111 / 1 1
L λ λ μ ρμ λ λ μ ρ
ρ
= = = =− − − −
For M/M/1:
Effect of Queue Discipline-11 hr service time
1
2
3
4
5
Arrivaltime
1000
1020
1040
1100
1130
Start waitservice timeFCFS in Q
1000 0
1100 40
1200 80
1300 120
1400 150
3907853.8
Total wait timeaverage wait timestandard deviation
Effect of Queue Discipline-21 hr service time
1
2
3
4
5
Arrivaltime
1000
1020
1040
1100
1130
Start waitservice timeFCFS in Q
1000 0
1100 40
1200 80
1300 120
1400 150
3907853.8
Start waitservice timeLFS in Q
1000 0
1400 220
1300 140
1100 0
1200 30
3907887.7
Total wait timeaverage wait timestandard deviation
Effect of Queue Discipline-31 hr service time
1
2
3
4
5
Arrivaltime
1000
1020
1040
1100
1130
Start waitservice timeFCFS in Q
1000 0
1100 40
1200 80
1300 120
1400 150
3907853.8
Start waitservice timeLFS in Q
1000 0
1400 220
1300 140
1100 0
1200 30
3907887.7
Start waitservice timeSIRO in Q
1000 0
1300 160
1100 20
1200 60
1400 150
3907865.8
Total wait timeaverage wait timestandard deviation
M/G/1 ∞/∞/FCFS Assumptions
Poisson input process with mean λn= λIndependent service times having the same probability distributionMean service time = 1/μVariance = σ2
Steady-state, i.e. ρ < 1
M/G/1 Solution
0
2 2 2 2
1 1
/2(1 / )
1
q
q
q
p
L
L L
LW
W W
λρμ
λ σ λ μλ μ
ρ
λ
μ
= − = −
+=
−= +
=
= +
What a remarkable solution.
The M/G/1 Queue
Lq =+−
λ σ λ μλ μ
2 2 2 2
2 1/
( / )
I. For the M/M/1 Queue: set σμ
22
1=
II. For the M/D/1 Queue: set σ 2 0=
But isn’t this just the Pollaczek-Khintchine Formula?
A Queue Comparison
M/D/1 M/G/1 M/M/1
Wq =+−
λ σ μλ μ
( / )( / )
2 212 1
Wq = −λ
μ μ λ2 ( ) Wq = −λ
μ μ λ( )
σμ
22
1=σ 2 0=
Why the M/M/1 has twice the
waiting time as the M/D/1!
The impact of variability
Lq =+−
λ σ λ μλ μ
2 2 2 2
2 1/
( / )
Notice how the variability of the service time impacts on Lq. I am an
engineer and I know about these things.
I always strive for consistency in my service times.
Let’s do an example using the M/G/1
Cars arrive at the drive-through window of MacDonald's at the Poisson rate of 27 per hour during the noon rush hour. The time required to service a car at the window is normally distributed with a mean of 2 minutes and a standard deviation of 1 minute. How many cars will be waiting on the average?
The Big Mac Solution
( ) ( )( )
2 222 2 2 2 (27) 1/ 60 27 / 30/ 5.062(1 / ) 2 1 27 / 30
.9.1873 hr 11.24 minutes
q
q
L
W
λ σ λ μλ μ
ρ
++= = =
− −
== =
Look at them waiting for
me.
Wq = Lq / λ = 5.06/27 = .1873
Build your own model…3 identical machines having the following reliability:
MTBF = 10 hrs when all 3 are running8 hrs when 2 are running6 hrs when 1 is running
and the following maintainability:
MTTR = 8 hrs with 1 machine down6 hrs with 2 machines down (assign a helper)6 hrs with all 3 machines down (2 crews)
It is quite clear. Let us set up the steady-state equations for the pure birth-death process from the rate diagram.
The Inevitable Rate Diagram
0 1 2 3
λ0 = 3/10 λ1 = 2/8 λ2 = 1/6
μ1 = 1/8 μ2 = 1/6 μ3 = 2 (1/6)
C1 = (3/10) (8/1) = 12/5C2 = (12/5) (2/8) (6/1) = 18/5C3= (18/5) (1/6) (6/2) = 9/5
The SolutionC1 = (3/10) (8/1) = 12/5C2 = (12/5) (2/8) (6/1) = 18/5C3= (18/5) (1/6) (6/2) = 9/5
1 1
0
1
2
3
12 18 9 44 51 .1135 5 5 5 44
12 5 12 .2735 44 4418 5 18 .4095 44 449 5 9 .2055 44 44
P
P
P
P
− −⎡ ⎤ ⎛ ⎞= + + + = = =⎜ ⎟⎢ ⎥⎣ ⎦ ⎝ ⎠
= = =
= = =
= = =
The Measures of Effectiveness
12 18 9 752 3 1.70544 44 44 44
18 9 271 1 .613644 44 44
3 5 2 12 1 18 1510 44 8 44 6 44 88
75 15/ 10 .44 8827 15/ 3.6 .44 88
q
q
L
L
W hr
W hr
λ
⎛ ⎞ ⎛ ⎞ ⎛ ⎞= + + = =⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠ ⎝ ⎠⎛ ⎞ ⎛ ⎞= + = =⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠⎛ ⎞ ⎛ ⎞ ⎛ ⎞= + + =⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠ ⎝ ⎠
⎛ ⎞ ⎛ ⎞= =⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠⎛ ⎞ ⎛ ⎞= =⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠
0 1 2 35 12 18 9, , ,44 44 44 44
P P P P= = = =
The Economics of Queues
The End Gamewhere the emphasis ison decision making
A prescriptive model rather than a
descriptive model. Right?
The Economics of Queues
Level of service
cost
Waiting cost
Service costTotal cost
Our queues always operate at the minimum cost point!
The Basic Economic Model - 1Minimize E(cost) = E(SC) + E(WC) where
SC = service cost and WC = waiting cost
E(SC) = Cs S
where Cs = cost per server per unit of time
I shall be your server for today.
The Basic Economic Model – 2
0 0( )
where cost of waiting per unit of time per customer
w n w n w wn n
w
E WC C np C np C L C W
C
λ∞ ∞
= =
= = = =
=
∑ ∑
Bottom Line: E(cost) = Cs s + Cw L
or E(cost) = Cs s + Cw Lq why?
Queue Emergencies – The Basic Model in Action
Patients enter the Death Valley Hospital emergency roomat the rate of 8 per hour. A patient is seen by the doctorfor an average of 20 minutes. How many doctors shouldbe on duty?
A doctor’s salary equates to $75 per hour while the typicalpatient at Death Valley is estimated to have an income worth$20 per hour.
I make more than you; therefore, you will just have to wait.
Queue Emergencies - continued
Nbr doctors - S 3 4 5
utilization rate .89 .67 .53Lq 6.468 .778 .17920 Lq (wait cost) $ 129.36 $ 15.56 $ 3.5875 S (server cost) $ 225 $ 300 $ 375
Total cost per hr. $ 354.36 $ 315.56 $ 378.58
= 8 / hru = 3 / hr
= 8 / (3 S)λ ρ
Banking on Queue
Assume M/M/s SystemArrivals / hr = 24Number of tellers = 3Service rate = 9 per hour
Individual queues: M/M/1utilization rate = 8/9 = .89time in system = 1/(9-8)= 1 hrnumber in system = 8/1 = 8number in bank = 3 x 8 = 24
Pooled queues: M/M/3utilization rate = 24/27 = .89time in system = .377 hrnumber in system = 9.047number in bank = 9.047
Stay in the queue line
Does not consider jockying
Pooled Secretaries
Factor Secretary Carol Bob Bettyarrival typingjobs/day 9 7 6service rate 10 10 10utilization rate .9 .7 .6Lq 8.1 1.63 .9W 1 day 1/3 day 1/4 day
Secretary pool: arrival rate = 9 + 7 + 6 = 22 jobs/ dayu = 10 jobs /day S = 3utilization rate = 22/ 30 = .73mean jobs waiting = Lq = 1.452mean time in system = W = .12 daysPw = .54
Carol’sCubicle
Machining Queues – yet another example
Dellphy Classy, an independent company long associatedwith Major Motors, operates a machine shop used in manufacturingautomotive ashtrays. The shop contains 15 machines which failat the individual rate of once every 5 (8-hr) days. It takes one (8-hr) day to repair a failed machine. When a machine is down it must wait for a skilled technician to repair it. Technicians cost the company $48 a hour (fully burdened). Lost production on a single machine costs the company $200 a (8-hr) day. How many skilled technicians should they employ?
A skilled technician
Machining Queues M/M/S ∞/15/FCFS
λ = .2 /day (per machine)
u = 1 / day
Nbr technicians (S) 1 2 3 4 5
Machines down (L) 10 5.465 3.307 2.7 2.54
200 L 2000 1093 661.4 540 50848 (8) S 384 768 1152 1536 1920
Total cost $2384 $1861 $1813 $2076 $2428
Is this theright answer?Huh?
The End
This concludes “Adventures in Queuing.”
An engineering management graduate searching for a queue to enter
May all your queues be little ones…little q’s - q q q q q
The overachieving students will go out into the world and participate in as many queues as possible knowing that they are now experts on waiting in lines.