0% found this document useful (0 votes)
14 views

E4 - Queuing Theory Exercises

This document contains exercises on queuing theory. It includes exercises on applying Little's law to calculate expected number of customers and wait times. It also includes exercises on probability distributions related to queuing models like calculating probabilities of interarrival and service times for an M/M/2 queue. The document provides solutions to the exercises.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

E4 - Queuing Theory Exercises

This document contains exercises on queuing theory. It includes exercises on applying Little's law to calculate expected number of customers and wait times. It also includes exercises on probability distributions related to queuing models like calculating probabilities of interarrival and service times for an M/M/2 queue. The document provides solutions to the exercises.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Queuing theory exercises

Giovanni Righini
April 1, 2022

These notes are mainly for the students of the “Logistics” course. Many exercises are taken from Hillier &
Liebermann, “Introduction to Operations Research”, chapters 15 and 16, and they are indicated by HL.

1
1 Applying Little’s law
1.1 HL 15.2-2
You are given a two-server queuing system in a steady-state condition, where the number of customers in the
system varies between 0 and 4. For n = 0, . . . , 4 the probability Pn that exactly n customers are in the system
1 4 6 4 1
is P0 = 16 , P1 = 16 , P2 = 16 , P3 = 16 , P4 = 16 .
• (a) Determine L, the expected number of customers in the system.
• (b) Determine Lq , the expected number of customers in the queue.
• (c) Determine the expected number of customers being served.
• (d) Given that the mean arrival rate is 2 customers per hour, determine the expected waiting time in the
system, W , and the expected waiting time in queue, Wq .
• (e) Given that both servers have the same expected service time, use the results from part (d) to determine
this expected service time.

Solution. The exercise requires to apply the definitions of L, Lq , W and Wq and the relations between them:
L = λW , Lq = λWq and W = Wq + 1/µ.
• (a) From the knowledge of Pn one can easily obtain L:
4
X 4 12 12 4
L= Pn n = 0 + + + + = 2.
n=0
16 16 16 16

In average there are two customers in the system.


• (b) From the probabilities Pn and from s = 2 one can directly obtain also Lq :
4
X 4 2 3
Lq = Pn (n − 2) = 0 + + = = 0.375.
n=2
16 16 8

In average, there are 0.375 customers waiting in queue.


• (c) From the difference L − Lq we know that in average there are 1.625 customers that are receiving
service; then one obtains that in average the 2 servers are busy for a fraction of time equal to ρ = 1.625
2 ,
i.e. ρ = 13
16 = 0.8125. The same result can be obtained directly from the values of P n :
4
X 4 6 4 1 13
E[N. busy servers] = Pn min{n, s} = 0P0 + 1P1 + 2(P2 + P3 + P4 ) = 0 + + 2( + + ) = .
n=0
16 16 16 16 8

• (d) From Little’s law one obtains:

L 2 customers
W = = = 1 hour.
λ 2 customers/hour

Analogously, for the queue one obtains:


3
Lq customers 3
Wq = = 8 = hour.
λ 2 customers/hour 16

• (e) Finally, from W = Wq + 1


µ one obtains:

1 1 16 customers
µ= = = .
W − Wq 1 − 3/16 13 hour

Hence, the average service time is


1 13 hour
= .
µ 16 customer

2
2 Probability distributions and their properties
2.1 HL 15.4-1
Suppose that a queuing system has two servers, an exponential interarrival time distribution with a mean of
2 hours and an exponential service time distribution with a mean of 2 hours for each server. Furthermore, a
customer has just arrived at 12:00 noon.
• (a) What is the probability that the next arrival will come (i) before 1:00 pm; (ii) between 1:00 and 2:00
pm; (iii) after 2:00 pm?
• (b) Suppose that no additional customers arrive before 1:00 pm. Now, what is the probability that the
next arrival will come between 1:00 and 2:00 pm?
• (c) What is the probability that the number of arrivals between 1:00 and 2:00 pm will be (i) 0, (ii) 1, (iii)
2 or more?
• (d) Suppose that both servers are serving customers at 1:00 pm. What is the probability that neither
customer will have service completed (i) before 2:00 pm, (ii) before 1:10 pm, (iii) before 1:01 pm?

Solution. The system is an M/M/2 system with λ = 1/2 and µ = 1/2, both expressed in hours.
Question (a). Here T indicates the point in time of the next arrival starting from 12:00 (in hours). Using
the definition of the exponential distribution,
1
1 −1t
Z
1 1
P {T ≤ 1} = e 2 dt = | − e− 2 t |10 = 1 − e− 2 ≈ 0.393.
0 2
1 1
P {1 ≤ T ≤ 2} = P {T ≤ 2} − P {T ≤ 1} = | − e− 2 t |21 = e− 2 − e−1 ≈ 0.239.
P {T ≥ 2} = 1 − P {T ≤ 2} = 1 − (P {T ≤ 1} + P {1 ≤ T ≤ 2}) = e−1 ≈ 0.368.
Question (b). By the property of the exponential distribution of being “without memory”,

P {1 ≤ T ≤ 2|T ≥ 1} = P {T ≤ 1} ≈ 0.393

as already computed in (a).


Question (c). Here Nt indicates the expected number of events between 1:00 pm and t (expressed in hours,
starting from 1:00 pm). Using the definition of a Poisson process,
1
( 21 1)0 e 2 1 1
P {N1 = 0} = = e− 2 ≈ 0.607.
0!
The same result can be obtained in an easier way considering the results already computed in the previous
answers:
1
P {N1 = 0} = 1 − P {T ≤ 1} = e− 2 ≈ 0.607.

Analogously,
1
( 1 1)1 e 2 1 1 1
P {N1 = 1} = 2 = e− 2 ≈ 0.303.
1! 2
3 1
P {N1 ≥ 2} = 1 − (P {N1 = 0} + P {N1 = 1}) = 1 − e− 2 ≈ 0.090.
2
Question (d). Here Nt indicates the number of completions between 1:00 pm and t (expressed in hours,
starting from 1:00 pm), while T indicates the time of the next completion.
Z 1
P {N1 = 0} = 1 − P {T ≤ 1} = 1 − (sµ)e−(sµ)t dt = e−1 .
0
Z 1/6
1
P {N1/6 = 0} = 1 − (sµ)e−(sµ)t dt = e− 6 .
0
Z 1/60
1
P {N1/60 = 0} = 1 − (sµ)e−(sµ)t dt = e− 60 .
0

3
2.2 HL 15.4-2
The jobs to be performed on a particular machine arrive according to a Poisson input process with a mean rate
of 2 per hour. Suppose that the machine breaks down and will require one hour to be repaired. What is the
probability that the number of new jobs that will arrive during this time is (a) 0, (b) 2, (c) 5 or more?

Solution. Using the definition of a Poisson process,

(λt)n eλt
P [X(t) = n] =
n!
with different values of n, with t = 1 hour and λ = 2 job/hour. Then one obtains

e−2
P0 = = 0.1353
1
2e−2
P1 = = 0.2707
1
4e−2
P2 = = 0.2707
2
8e−2
P3 = = 0.1804
6
16e−2
P4 = = 0.0902
24
Finally
4
X
P (≥ 5) = 1 − Pn = 1 − 7e−2 = 0.05265.
n=0

2.3 HL 15.4-3
The time required by a mechanic to repair a machine has an exponential distribution with a mean of 4 hours.
However, a special tool would reduce this mean to 2 hours. If the mechanic repairs a machine in less than two
hours he is paid $ 100; otherwise, he is paid $ 80. Determine the mechanic’s expected increase in pay if he uses
the special tool.

Solution. From the definition of exponential probability distribution, the probability that the repair inter-
vention be completed in less than two hours is
Z 2
P [≤ 2 hours] = µe−µt dt = 1 − e−2µ .
0

1
Hence, in the scenario with no special tool, where µ = 4 hour,
1
P [≤ 2 hours] = 1 − e− 2
1
P [> 2 hours] = e− 2
1 1
E[payment] = $[100(1 − e− 2 ) + 80(e− 2 )].
1
On the contrary, in the scenario with the special tool, where µ = 2 hours,

P [≤ 2 hours] = 1 − e−1

P [> 2 hours] = e−1


E[payment] = $[100(1 − e−1 ) + 80(e−1 )].
The expected difference in payment for each repair intervention is
1 1
$[100(1 − e−1 ) + 80(e−1 )] − $[100(1 − e− 2 ) + 80(e− 2 )] = $4.773.

4
3 Birth-and-death processes
3.1 HL 15.5-5
A service station has one gasoline pump. Cars wanting gasoline arrive according to a Poisson process at a mean
rate of 15 per hour. However, if the pump already is being used, these potential customers may balk (drive to
another service station). In particular, if there are n cars already at the service station, the probability that
an arriving potential customer will balk is n/3 for n = 1, . . . , 3. The time required to service a car has an
exponential distribution with a mean of 4 minutes.
• (a) Construct the rate diagram for this queuing system.
• (b) Develop the balance equations.
• (c) Solve these equations to find the steady-state probability distribution of the number of cars at the
station. Verify that this solution is the same as that given by the general solution for the birth-and-death
process.
• (d) Find the expected waiting time (including service) for those cars that stay.

Solution. The system can be classified as M/M/1.


The value of λ0 = 15 customers/hour is given. However, for different values of n, we have different
values of λn owing to “balking” customers. Hence λ1 = 10 customers/hour, λ2 = 5 customers/hour and
λ3 = 0 customers/hour.
The state diagram has only 4 states, for n = 0, . . . , 3. Transitions to states with n > 3 occur with zero
average frequency.
The frequency of completions does not depend on the number of customers in the system, but it is always
equal to µ = 15 customers/hour in all states n = 1, . . . , 3.

15 10 5
0 1 2 3
15 15 15

The balance equations for states n = 0, n = 1 and n = 2 are



 15P0 = 15P1
(10 + 15)P1 = 15P0 + 15P2
(15 + 5)P2 = 10P1 + 15P3

To these equations we must add the normalization constraint of the probability values:

P0 + P1 + P2 + P3 = 1.

We obtain a system of four linear equations in four variables, that can be solved expressing all probabilities as
functions of P0 :

 P1 = P0
P2 = 2/3P0
P3 = 2/9P0

from which

P0 + P0 + 2/3P0 + 2/9P0 = 1

i.e. P0 = 9/26 and thus



 P1 = 9/26
P2 = 6/26
P3 = 2/26

Form the P values we can immediately obtain the expected number of customers in the system, indicated by
L, and the average frequency of the arrivals, indicated by λ.
3
X
L= nPn = 0 + 9/26 + 12/26 + 6/26 = 27/26 customers.
n=0

5
3
X
λ= λn Pn = 159/26 + 109/26 + 56/26 + 02/26 = 255/26 customers/hour.
n=0

Then, through Little’s law we can compute the required value of W :

W = L/λ = 27/255 hour,

which is about 6 minutes.

3.2 HL 15.5-9
A certain small grocery store has a single checkout stand with a full-time cashier. Customers arrive at the stand
randomly (i.e. a Poisson input process) at a mean rate of 30 per hour. When there is only one customer at the
stand, he is processed by the cashier alone, with an expected service time of 1.5 minutes. However, the stock
boy has been given standard instructions that whenever there is more than one customer at the stand, he is to
help the cashier by bagging the groceries. This help reduces the expected time required to process a customer
to 1 minute. In both cases, the service-time distribution is exponential.
• (a) Construct the rate diagram for this queuing system.
• (b) What is the steady-state probability distribution of the number of customers at the checkout stand?
• (c) Derive L for this system (hint: refer to the derivation of L for the M/M/1 model at the beginning of
Sec. 15.6). Use this information to determine Lq , W and Wq .

Solution. It is an M/M/1 system again.


The value of λ = 30 customers/hour is known. The completion frequency is µ1 = 40 customers/hour when
n = 1 and µn = 60 customers/hour when n > 1.

30 30 30
0 1 2 3
40 60 60

The balance equations form the following linear system:



 30P0 = 40P1
70P1 = 30P0 + 60P2
90Pi = 30Pi−1 + 60Pi+1 ∀i ≥ 2

together with the normalization constraint ∞


P
n=0 Pn = 1. Expressing the probability Pi+1 as a function of Pi−1
and Pi we get

 P1 = 3/4P0
P2 = 70P160
−30P0
→ P2 = 3/8P0 → P2 = 1/2P1
90Pi −30Pi−1
Pi+1 = ∀i ≥ 2

60

From the third equation we obtain Pi+1 = 3Pi −P


2
i−1
. For Pi = 1/2Pi−1 we obtain Pi+1 = 1/2Pi . Since for i = 2
we have P2 = 1/2P1 , then Pi+1 = 1/2Pi ∀i ≥ 1. Hence, expressing now each Pi value as a function of P0 , we
have


 P1 = 3/4P0
 P2 = 3/8P0


P3 = 3/16P0
. ..



Pi = 3/2i+1 P0 ∀i

The normalization constraint can be restated as



3X 1
P0 (1 + ) = 1.
2 n=1 2n

6
Since the missing term of the geometrical series (the term with n = 0), has valus equal to 1, we have

3 X 1
P0 (1 + (( ) − 1)) = 1.
2 n=0 2n

1
The sum of a geometrical series of ratio r is equal to 1−r . Therefore for r = 1/2,

3 1
P0 (1 + ( 1 − 1)) = 1,
2 1− 2

3
P0 (1 + (2 − 1)) = 1,
2
3
P0 (1 + ) = 1,
2
5
P0 = 1,
2
2
P0 = .
5
from which we can obtain al the other values of the probabilities: P1 = 3/10, P2 = 3/20 etc.
To obtain L we can proceed as follows. The definition of L is:

X
L= nPn
n=0

We have Pn = 35 21n ∀n ≥ 1. The value of P0 does not satisfy this relation but in the expression of L is it
multiplied by 0. Then we can rewrite

3X 1
L= n .
5 n=0 2n

To compute the sum of this series we can resort to the commutative property between the sum and the derivative.
Let define φ = 12 and rewrite

3X n
L= nφ (1)
5 n=0

Now we have
P∞ n
P∞
n=0 nφ = φ n=0 nφn−1 =
∞ d d P∞
= φ n=0 dφ (φn ) = φ dφ ( n=0 φn ) =
P
d 1 1
= φ dφ ( 1−φ ) = φ (1−φ) 2.

Remembering that φ = 1/2 and replacing it in (1) we get


1
3 2 3 1/2 6
L= 1 2
= = .
5 (1 − 2 ) 5 1/4 5

From Little’s law we obtain W (expressed in hours):


6
L 1
W = = 5 = .
λ 30 25
The length of the queue, Lq , can be computed from its definition
P∞ P∞ P∞
Lq = Pn=1 (n − 1)Pn = n=1 nPn − n=1 Pn =
∞ P∞
= ( n=0 nPn − 0P0 ) − ( n=0 Pn − P0 ) = (L − 0) − (1 − P0 ) =
= 65 − (1 − 25 ) = 53 .

Finally, using Little’s law again, we obtain Wq (expressed in hours):

Wq 3/5 1
Wq = = = .
λ 30 50

7
3.3 HL 15.6-4
Jobs arrive at a particular work center according to a Poisson input process at a mean rate of 2 per day, and
the operation time has an exponential distribution with a mean of 1/4 day. Enough in-process storage space is
provided at the work center to accommodate 3 jobs in addition to the one being processed, whereas excess jobs
excess are stored temporarily in a less convenient location. For what proportion of the time will this storage
space at the work center be adequate to accommodate all waiting jobs?

Solution. It is an M/M/1 system. Although the description may induce to assume this is a finite capacity
system, this is not the case, because the frequency of the arrivals is not zero for any given number of customers
in the system.
The parameters describing the queuing system are λ = 2 and µ = 4, both expressed in jobs per day. The
system utilization factor is ρ = 12 . From the formulae for M/M/1 systems we obtain

1
P0 = 1 − ρ = .
2
1
Pn = (1 − ρ)ρn = ( )n+1 .
2
The available capacity is sufficient for a fraction of time equal to
4 4
X X 1 31
Pn = ( )n+1 = .
n=0 n=0
2 32

3.4 HL 15.6-31
A company is designing a new production plant. A large number of identical machines have been assigned to
a plant section and it is necessary to determine how many of them should be assigned to the same operator
for loading, unloading, tuning, set-up and so on. For the purpose of this analysis the following data have been
provided. The working time of a machine (i.e. the time from the completion of a service by the operator and
the time when the machine requires his intervention again) has an exponential distribution with a mean value of
150 minutes. The service time has an exponential distribution with a mean value of 15 minutes. Each operator
has its own subset of machines and he cannot give/receive help to/from other operators. For the section to
reach the required level of productivity, the machines must be active for at least 89% of time in average.
• (a) What is the maximum number of machines that can be assigned to each operator?
• (b) Assuming that the number of machines per operator is the one determined in answer (a), for what
fraction of time will the operators be busy?

Solution. This is an M/M/1/N system with finite population. The value of N is a design variable.
Indicating with T = 25 the average working time (expressed in hours), the constraint on productivity can be
expressed as
89
T ≥ (T + W )
100
which is the same as
11
W ≤ T
89
i.e.

W ≤ 0.308.

The average frequency of arrivals (expressed in machines/hour) depends on the number n of idle machines
and it is given by λn = (N − n)λ̂, where λ̂ = 1/T = 2/5. The average frequency of completions (expressed in
machines/hour) is µ = 4.
Let examine the different cases.

8
N = 1. The state diagram is the following one.

2
5
0 1
4

The balance equation imposes that

4P1 = 2/5P0 .

Since P0 + P1 = 1, we obtain

P0 = 10/11
P1 = 1/11

Then we have L = 0P0 + 1P1 = 1/11. Furthermore we have λ = 25 P0 + 0P1 = 2 10


5 11
1
+ 0 11 = 4
11 . Then, for Little’s
law,

L 1/11 1
W = = = = 0.25.
λ 4/11 4

The constraint on productivity is satisfied.

N = 2. The state diagram is the following one.

4 2
5 5
0 1 2
4 4

Balance equations impose that


 4
5 P0 = 4P1
( 52 + 4)P1 = 45 P0 + 4P2

from which we have


P1 = 51 P0

1
P2 = 50 P0
1 1
Since P0 + P1 + P2 = 1, we obtain P0 (1 + 5 + 50 ) = 1 from which

 P0 = 50/61
P1 = 10/61
P2 = 1/61

Then we have L = 0P0 + 1P1 + 2P2 = 12/61. Furthermore, we have λ = 54 P0 + 25 P1 + 0P2 = 4 50


5 61 + 2 10
5 61 = 44
61 .
Then, for Little’s law,

L 12/61 12
W = = = ≈ 0.27.
λ 44/61 44

The constraint of productivity is still satisfied.

N = 3. The state diagram is the following one.

6 4 2
5 5 5
0 1 2 3
4 4 4

9
The balance equations are
 6
 5 P0 = 4P1
( 4 + 4)P1 = 65 P0 + 4P2
 25
( 5 + 4)P2 = 45 P1 + 4P3

from which we have


3

 P1 = 10 P0
3
P2 = 50 P0
3
P3 = 500 P0

3 3 3
Since P0 + P1 + P2 + P3 = 1, we have P0 (1 + 10 + 50 + 500 ) = 1 from which


 P0 = 500/683
P1 = 150/683


 P2 = 30/683
P3 = 3/683

500 150 30 3 219


Then we have L = 0P0 + 1P1 + 2P2 + 3P3 = 0 683 + 1 683 + 2 683 + 3 683 = 683 . Furthermore we have λ =
6 4 2 6 500 4 150 2 30 600+120+12 732
5 P0 + 5 P1 + 5 P2 + 0P3 = 5 683 + 5 683 + 5 683 = 683 = 683 . Then for Little’s law,

L 219/683 219
W = = = ≈ 0.299.
λ 732/683 732

The constraint of productivity is still satisfied.

N = 4. The state diagram is the following one.

8 6 4 2
5 5 5 5
0 1 2 3 3
4 4 4 4

With the same procedure above, we obtain W ≈ 0.33 that violates the constraint.

Then, assuming N = 3, we can compute the system utilization factor

λ
ρ= .
µ
732
With N = 3 we have λ = 683 and then
732
683 183
ρ= = ≈ 26.8%.
4 683

3.5 HL 15.7-4
An airline maintenance base has facilities for overhauling only one airplane engine at a time. Therefore, to
return the airplanes to use as soon as possible, the policy has been to stagger the overhauling of the four engines
of each airplane. In other words, only one engine is overhauled each time an airplane comes into the shop.
Under this policy, airplanes have arrived according to a Poisson process at a mean rate of 1 per day. The time
required for an engine overhaul (once work has begun) has an exponential distribution with a mean of 21 day.
A proposal has been made to change the policy so that all four engines are overhauled consecutively each time
an airplane comes into the shop. Although this would quadruple the expected service time, each plane would
need to come into the shop only one-fourth as often. Use queuing theory to compare the two alternatives on a
meaningful basis.

10
Solution. In the first scenario (current policy) the queuing system is M/M/1 with parameters

λ = 1 engine/day µ = 2 engine/day.

Then we have ρ = 21 , P0 = 12 , Pn = P0 ρn = ( 12 )n+1 , from which


λ
L = µ−λ = 1 engine
L
W = λ = 1 day
Wq = W − µ1 = 12 day
Lq = λWq = 12 engine.

In the second scenario (proposed policy) the maintenance of each aircraft is given by the sequence of four
identical operations, one for each engine. Therefore the service time follows an Erlang distribution with param-
eter k = 4. The corresponding M/E4 /1 system has the following parameters:
1 1
λ= aircraft/day µ = aircraft/day.
4 2
Using the relations of M/Ek /1 systems we get
1
1+k λ2 5 5
Lq = 2k µ(µ−λ) = 8 12 ( 21 − 14 ) = 16
16
aicraft
L
Wq = λq = 5/16 5
1/4 = 4 day
W = Wq + µ1 = 54 + 1/2
1
= 13 4 day
1 13 13
L = λW = 4 4 = 16 aircraft.

In the second scenario the number of aircrafts in the system is smaller. Furthermore the time to traverse
the system for each aircraft in the second scenario is also less than four times the time required for each engine
in the first scenario.

4 Design and optimization of queuing systems


4.1 HL 16.4-2
A small grocery store has a single chackout stand with a full-time cashier. Customers arrive at the stand
according to a Poisson process at a mean rate of 30 per hour. The service-time distribution is exponential with
a mean of 1.5 minutes. This situation has resulted in occasional long lines and complaints from customers.
Therefore, beacuase there is no room for a second checkout stand, the proposal has been made that another
person be hired to help the cashier by bagging the groceries. This help would reduce the expected time required
to process a customer to 1 minute but the distribution still would be exponential. The total compensation for
the new employee would be $ 8 per hour, which is just half that for the cashier. It is estimated that the grocery
store incurs lost profit due to lost future business of $ 0.08 for every minute that each customer has to wait
(including service time). The manager wants to determine on an expected total-cost basis whether it would be
worthwhile to hire the new person.
• (a) Which decision model presented in Sec. 16.4 applies to this problem? Why?
• (b) Use this model to determine whether to continue the status quo or to adopt the proposal.

Solution. The system is M/M/1 with λ = 30 customers/hour. In the current system we have µ = 40
customers/hour; in the scenario with the additional operator we would have µ′ = 60 customers/hour.
The cost C due to the time required to traverse the system (expressed in $/hour) can be evaluated as

C = cλW = cL

being c = 4.8 $/hour the given coefficient (equivalent to 0.08 $/minute). Every customer is subject to a cost
(expressed in $) equal to cW (where W must be expressed in hours) and therefore the whole population of λ
customers/hour pays a cost cλW (expressed in $/hour). Since
λ λ
L= e L′ = ,
µ−λ µ′ − λ
we have
30 30
L= =3 e L′ = = 1,
10 30

11
from which

C = 4.8 × 3 = 14.4 $/hour and C ′ = 4.8 × 1 = 4.8 $/hour.

The cost reduction that can be achieved hiring the additional employee is given by C − C ′ = 14.4 − 4.8 = 9.6
$/hour, which is larger than the cost of the employee (equal to 8 $/hour). Therefore hiring the employee yields
a net improvement of 9.6 − 8 = 1.6 $/hour.

4.2 HL 16.4-3
Customers arrive at a fast-food restaurant with one server according to a Poisson process at a mean rate of 30
per hour. The server has just resigned and the two candidates for the replacement are X (fast but expensive)
and Y (slow but inexpensive). Both candidates would have an exponential distribution for service times, with
X having a mean of 1.2 minutes and Y having a mean of 1.5 minutes. Restaurant revenue per month is given
by $ 6000
W , where W is the expected waiting time (in minutes) of a customer in the system. Determine the upper
bound on the difference in their monthly compensation that would justify hiring X instead of Y .

Solution. The system is M/M/1 with λ = 12 customers/minute. With X we have µX = 65 customers/minute;


1
with Y we have µY = 32 customers/minute. For M/M/1 systems we have W = µ−λ . Then

1
WX = 5 1 = 3 minutes
6 − 2

1
WY = 2 1 = 6 minutes
3 − 2

from which, being W = Wq + µ1 ,

1 9
WqX = 3 − 5 = minutes
6
5

1 9
WqY = 6 − 2 = minutes
3
2
Then we have
6000
RX = 9 = 3333.3 $/month
5

6000
RY = 9 = 1333.3 $/month.
2

The maximum difference in salary that justifies hiring X instead of Y is RX − RY = 2000 $/month.

4.3 HL 16.4-10
A single crew is provided for unloading and7or loading each truck that arrives at the loading dock of a warehouse.
These trucks arrive according to a Poisson input process at a mean rate of one per hour. The time required
by a crew to unload and/or load a truck has an exponential distribution (regardless of the crew size). The
expected time required by a one-person crew is 1 hour. The cost of providing each additional member is $ 20
per hour. The cost that is attributable to having a truck not in use (i.e. a truck standing at the loading dock)
is estimated to be $ 30 per hour.
• (a) Assume that the mean service rate of the crew is proportional to its size. What should be the size to
minimize the expected total cost per hour?
• (b) Assume that the mean service rate of the crew is proportional to the square root of its size. What
should be the size to minimize the expected total cost per hour?

12
Solution. This is an M/M/1 system: the server is the team of workers, which is always one although it can
be composed by several workers. The input average frequency is λ = 1 customers/hour.
Indicating with s the number of workers in the team, the cost for providing the service is C provider = cs (s−1),
being cs = 20 $/hour the given coefficient.
The cost for each vehicle is given by cc λW (expressed in $), being cc = 30 $/hour the given coefficient,
where the overall service time W is expressed in hours. The total cost for the whole population of customers is
C customers = cc λW and it is expressed in $/hour. In turn, in a M/M/1 system one has W = µ−λ 1
. Then, under

assumption (a) one has µ = sµ1 with µ1 = 1 customer/hour, while under assumption (b) one has µ = sµ1 .
Then the total cost in the system is
λ
C = C provider + C customers = cs (s − 1) + cc
sµ1 − λ

under assumption (a) and

λ
C = C provider + C customers = cs (s − 1) + cc √
sµ1 − λ

under assumption (b).


The minimum value of the cost can be found by trials, assuming different values of s, but in order to better
orient our trials it is advisable to first solve the continuous relaxation of the problem analytically (or with
a non-linear programming solver), computing the derivative with respect to the independent variable s. In
scenario (a) we have:

dC −µ1
= cs + cc λ
ds (sµ1 − λ)2

The first order condition is then


−µ1
cs + cc λ =0
(sµ1 − λ)2

from which we get


q q
λ + cccλµ 1
1 + 30 1 1 r
s 20 3
s= = =1+ ≈ 2.22
µ1 1 2
Then, it makes sense to compare the cost for s = 2 and s = 3.
For s = 2 we have
λ 1
C = cs (2 − 1) + cc = 20 + 30 = 50 $/hour.
2µ1 − λ 2−1
For s = 3 we have
λ 1
C = cs (3 − 1) + cc = 40 + 30 = 55 $/hour.
3µ1 − λ 3−1

Therefore, under assumption (a) the optimal size of the team is s = 2.


In scenario (b) per s = 2 we have

λ 1
C = cs (2 − 1) + cc √ = 20 + 30 √ ≈ 92.43.
2µ1 − λ 2−1
For s = 3 we have
λ 1
C = cs (3 − 1) + cc √ = 40 + 30 √ ≈ 80.98.
3µ1 − λ 3−1
For s = 4 we have
λ 1
C = cs (4 − 1) + cc √ = 60 + 30 √ = 90.00.
4µ1 − λ 4−1

Them under assumption (b) the optimal size of the team is s = 3.

13
5 Additional exercises on queuing systems
5.1 First aid
In a small hospital two physicians are available for first aid. Patients are classified as “urgent” and “non-urgent”.
Once the treatment of a patient has started, it cannot be interrupted. However, it is undesirable that both
physicians be simultaneously busy with one or two “non-urgent” patients and thus nobody be available in case
a new urgent patient arrives. Therefore the policy is the following: when both physicians are idle, any incoming
patient is immediately treated; when one of the two physicians is busy the next patient is treated only if he
is urgent; otherwise he is kept in a waiting room. To avoid excessively long queues, the hospitals immediately
alerts the ambulances so that no further patients are carried there. In particular no urgent patients are accepted
when both physicians are busy and no additional patients are accepted if there is one already in the waiting
room. Arrivals are allowed again as soon as the conditions for blocking them is no longer verified. When arrivals
are allowed, non-urgent patients arrive with an average period of 15 minutes; urgent patients arrive with an
average period of 45 minutes. All treatments last 20 minutes in average.
The hospital manager wants to know:
• For what fraction of time the first aid system is blocked for urgent patients?
• For what fraction of time the first aid system is blocked for non-urgent patients?
• What is the workforce utilization factor?
• What is the probability that a non-urgent patient must wait?
• How would these indicators change if the physicians treated all incoming patients immediately?
• How would these indicators change with three physicians, with the current policy of keeping the last
physician idle if there no urgent patients to treat?

Solution. The exercise requires to represent the system with a state-transition graph, where each node cor-
responds to a possible state and each arc to a possible state transition. Then, we can compute the probability
Pi associated with each state i from the knowledge of the average frequency fij of each transition from each
state i to each state j. In this example the system can be represented with the graph in Figure 1.

Figure 1: The state-transition diagram for questions 1 to 4.

Each state is indicated by two numbers: the first one is the number of busy servers (physicians), while the
second one is the number of patients in the queue (waiting room). Therefore the sum of the two numbers is the
total number of patients in the system. The frequencies on the arcs are indicated as functions of
• the mean arrival frequency of urgent patients: λ1 = 4
3 patients/hour;
• the mean arrival frequency of non-urgent patients: λ2 = 4 patients/hour;
• the mean frequency of completions for each physician: µ = 3 patients/hour.

14
f A B C D E
16
A - 3 0 0 0
4
B 3 - 3 4 0
C 0 6 - 0 4
4
D 0 3 0 - 3
E 0 0 0 0 -

f A B C E
16
A - 3 0 0
16
B 3 - 3 0
C 0 6 - 4
E 0 0 6 -

The same frequencies can be reported in a square matrix with as many rows and columns as the number of
states.
In order to compute the probabilities associated with each state, we have to formulate a system of balance
equations with five unknowns and five equations (but one of the equations is redundant).



 (λ1 + λ2 )PA = µPB
 (λ1 + λ2 + µ)PB = (λ1 + λ2 )PA + 2µPC + µPD


(λ1 + 2µ)PC = λ2 PB
(λ2 + µ)PD = λ1 PB + 2µPE




2µPE = λ1 PC + λ2 PD

Since the system is ill-conditioned, we must replace one of the equations with the normalization constraint:

PA + PB + PC + PD + PE = 1.

Solving the linear system (with a spreadsheet, for instance), we obtain:



 PA ≈ 0.15

 PB ≈ 0.28


PC ≈ 0.04
P D ≈ 0.42




PE ≈ 0.12

Now we can answer some questions.

Question 1. The system does not accept further urgent patients when it is in states C and E. This occurs
with probability PC + PE =≈ 0.15, i.e. for about 15% of the time.

Question 2. The system does not accept further non-urgent patients when it is in states D and E. This occurs
with probability PD + PE =≈ 0.53, i.e. for about 53% of the time.

Question 3. The workforce is not used when the system is in state A, half ot it is used in states B and D
and it is fully used in states C and E. Therefore the utilization factor is

ρ = 0.0PA + 0.5(PB + PD ) + 1.0(PC + PE ) ≈ 0.50.

Question 4. A non-urgent patient is kept in queue when the arrival occurs with the system in states B or C
and this occurs with probability PB + PC ≈ 0.31.

Question 5. To answer question 5 we must slightly modify the description of the system and then to repeat
the same procedure. With the alternative policy of immediately serving all incoming patients, state D is never
reached. The new state-transition diagram is indicated in Figure 2.
The matrix with the transition frequencies is now the following.

15
Figure 2: The state-transition diagram for question 5.

The solution is:




 PA ≈ 0.18
PB ≈ 0.33


 PC ≈ 0.29
PE ≈ 0.19

Therefore the four answers to the four previous questions are now:
• Question 1: PC + PE ≈ 48.7%
• Question 2: PD + PE ≈ 19.5%
• Question 3: ρ ≈ 65.1%
• Question 4: PC ≈ 29%

Question 6. With three physicians instead of two we have the state-transitions diagram outlined in Figure 3.

Figure 3: The state-transition diagram for question 6.

The matrix with the transition frequencies is now the following.

16
f A B C D E F
16
A - 3 0 0 0 0
16
B 3 - 3 0 0 0
4
C 0 6 - 3 4 0
D 0 0 9 - 0 4
4
E 0 0 6 0 - 3
F 0 0 0 0 9 -

The solution is:




 PA ≈ 0.17
 PB ≈ 0.30



PC ≈ 0.27

 PD ≈ 0.03

 PE ≈ 0.20



PF ≈ 0.04

Therefore the four answers to the four previous questions are now:
• Question 1: PD + PF ≈ 7%
• Question 2: PE + PF ≈ 23.7%
• Question 3: ρ ≈ 47.7%
• Question 4: PC + PD ≈ 29%

5.2 The buffer


Jobs arrive at a working center as Poisson events with an average frequency of 10 jobs per minute. They are
put in a buffer, managed according to a FIFO policy, from which they are taken to be processed on one of the
two available machines. The two machines are identical and they work in parallel independently of each other.
Each one requires a variable time to process each job: the distribution of the service times is exponential with
average value equal to 10 seconds per job.

1. What is the utilization factor of the queuing system?


2. What is the average number of jobs in the buffer?
3. What is the average number of jobs in the system (buffer+machines)?
4. What is the average time during which a job remains in the buffer?
5. What is the average time that a jobs spends in the system?

Furthermore one wants to know how to design the capacity of the buffer so that the probability that it si
not enough to accommodate the waiting jobs is less than 3%.
Finally one wants to evaluate the profitability of replacing the two machiens with a single new machine that
processes all jobs in a fixed time equal to 5 seconds. If the cost of having jobs in the queue is evaluated to be
0.2 e/minute and the cost for upgrading the production line is 2000 e, how long does it take to amortize the
investment?

Solution. In the current scenario we must analyze a M/M/2 system with parameters λ = 10 jobs/minute
and µ = 6 jobs/minute. Therefore we have:
a) ρ = λ/sµ = 5/6 = 0.8333 = 83.33%.
b) P0 = 1/11 and then Lq = 125/33 = 3.788 jobs.
c) L = 60/11 = 5.4545 jobs
d) Wq = 25/66 = 0.3788 minutes
e) W = 6/11 = 0.5454 minutes

From the probabilities Pi we can see that the probability of having more than K jobs in the system (buffer
+ machines) is 2.84% for K = 19 while it would be 2.84 + 0.57 = 3.41% for K = 18. Then the probability is

17
less than 3% for K = 19, which corresponds to a buffer capacity of 17 (2 jobs are in the machines, not in the
buffer).
In the second scenario the model is M/D/1 with parameters λ = 10 jobs/minute and µ′ = 12 jobs/minute.
Therefore we have:
a) ρ′ = λ/µ′ = 10/12 = 0.8333 = 83.33%.
b) L′q = 2.0833 jobs
c) L′ = 2.9167 jobs
d) Wq′ = 0.2083 minutes
e) W ′ = 0.2917 minutes

The cost C due to the queue is given by the average number of jobs in the queue, Lq , times the cost for each
job, which is given. In the first scenario we have C = 3.0788 × 0.2 ≈ 0.75 e/minute. In the second scenario we
have C ′ = 2.0833 × 0.2 ≈ 0.4167 e/minute. The difference is C − C ′ = 0.33 e/minute. Therefore, to amortize
the upgrade cost of 2000 e, 6000 minutes are needed, i.e. 100 hours.

5.3 The railway station


In a railway station customers arrive at the counter to buy tickets. The inter-arrival time is a random variable
with an exponential distribution of probability with a mean of 4 customers every 10 seconds. There are 6
operators at the counter and each one takes in average 10 seconds to serve a customer. The probability
distribution of the service time is exponential.
Evaluate
1. what is the utilization factor
2. what is the average number of customers in the system
3. what is the average number of customers in queue
4. what is the average time for each customer to traverse the system
5. what is the average time spent in queue for each customer.
Evaluate what would happen by replacing the 6 operators with 5 machines. Their service time would be
constant and equal to the average service time of operators, i.e. 10 seconds per customer.

Solution. In the first scenario we have an M/M/6 system with parameters λ = 0.4 customers/second and
µ = 0.1 customers/second. Hence, we have:
1. ρ = λ/sµ = 2/3 = 0.6667 = 66.67%.
2. L = 4.5695 customers.
3. Lq = 0.5695 customers
4. W = 11.4238 seconds
5. Wq = 1.4238 seconds
In the second scenario the model is M/D/5 with parameters λ = 0.4 customers/second and µ = 0.1
customers/second. Hence, we have:
1. ρ′ = λ′ /s′ µ′ = 0.8 = 80%.
2. L′ = 5.6220 customers.
3. L′q = 1.6220 customers.
4. W ′ = 14.0550 seconds.
5. Wq′ = 4.0550 seconds.

18
5.4 Drilling machines
In a mechanical factory there is a machine with two drills that work in parallel, picking up the mechanical
parts from a “first-in-first-out” buffer fed by a conveyor belt. When the buffer is full, the conveyor stops and it
restarts as soon as there is room in the buffer again. When the conveyor works, the mechanical parts arrive with
random inter-arrival times, according to an exponential distribution of probability with a mean of 12 seconds.
The drilling time for each part is a random variable with an exponential distribution and a mean of 20 seconds.
Compute what the buffer size should be so that the probability that the conveyor should stop be less than 4%.
Evaluate the proposal of replacing the current machine with a new one, equipped with a single drill working
three times faster than the current drills. i.e. able to process three mechanical parts in 20 seconds in average.
The drilling time would still have an exponential distribution.

Solution. The system is an M/M/2/K with finite capacity K, because arrivals do not occur when the buffer
is full. The parameters are λ = 5 parts/minute and µ = 3 parts/minute. We need room for 10 parts in the
system, i.e. 8 in the buffer and 2 in the machine. With this choice the probability that the buffer be full, i.e.
P10 is 3.34%. With smaller capacity, the requirement is violated: with K = 9 we have P9 = 4.28%.
In the alternative scenario the system is M/M/1/K with λ = 5 parts/minute and µ = 9 parts/minute. We
need room for 4 parts in the buffer besides 1 part in the machine. With K = 5, we have P5 = 2.42%, which is
acceptable, while with K = 4 we have P4 = 4.47% which is not acceptable.

5.5 Truck unloading


Trucks provide coils to a steelworks warehouse. They arrive with random inter-arrival time, distributed according
an exponential probability distribution with a mean of 20 minutes. The time needed by a team of workers to
unload a truck is variable and it has an exponential probability distribution with a mean of half an hour.
Evaluate how many teams must work in parallel to reduce the average time of each truck in the system to less
than one hour and the average number of trucks at the steelworks to less than three.

Solution. The system is an M/M/s system, where λ = 3 trucks/hour, µ = 2 trucks/hour and s is a design
variable. For s = 1 the system does not reach a steady-state condition, because the utilization factor is larger
than 1. For s = 2 we have W = 1.14 hours and L = 3.43 trucks, which does not satisfy the constraints. For
s = 3 we have W = 0.58 hours and L = 1.74 trucks, which satisfies both constraints.

5.6 E-mail orders


Orders arrive from commercial agents by e-mail. The messages arrive with random inter-arrival times, with an
exponential probability distribution with a mean of 15 minutes. They are read and processed by a secretary,
who takes a variable time, with an exponential probability distribution and a mean of 12 minutes. Evaluate
the percentage variation in the number of messages in the queue if the secretaries were two, working in parallel
with the same speed of current one.

Solution. This is an M/M/1 system, to be compared with an M/M/2 system, in which λ = 4 msg/hour and
µ = 5 msg/hour. With s = 1 we have Lq = 3.2 msg. With s = 2 we would have L′q = 0.15 msg, equal to 4.76%
of Lq .

5.7 Maintenance
In a production plant a certain number of identical machines will be installed. These machines require main-
tenance after 5 days, i.e. 120 hours, in average. This working time is a random variable with an exponential
probability distribution. Some operators will be in charge for the maintenance. The time needed by each of
them for each machine is a random variable with exponential probability distribution and a mean of 2 hours.
Owing to a suitable rotation of work-shifts a team of operators will be available 24h a day.
According to the design the number of machines should be 20 and the number of operators in the maintenance
team should be 3. What is the fraction of time during which each operator would be busy in average? How
long will a machine stop last, in average?
The general manager of the new plant wants every worker to be active for maintenance of machines for no
less than 20% and no more than 33% of its working time. Within these constraints he wants to decide the
number of machines in the plant and the number of operators in the maintenance team so that the duration of
the machine stop be minimum. Owing to economies of scale, machines must be bought in groups of five and
there is no room for more than 30 machines.

19
Solution. This is an M/M/s/K system with finite population. When s = 3 and K = 20 we have ρ = 10.93%
and W = 0.0834 hours. Therefore the operators are under-utilized. Considering K = 20, 25, 30 and s = 1, 2, 3,
we obtain 20% ≤ ρ ≤ 33% only in three cases: (a) K = 20 and s = 1, (b) K = 25 and s = 2, (c) K = 30 and
s = 2. The minimum machine stop time is in case (b) and it is equal to 0.0865 days, i.e. 2.076 hours for each
maintenance intervention.

5.8 The highway


Vehicles arrive at a highway toll booth as Poisson events, with an average frequency of one vehicle every 10
seconds. The three automatic card readers have become unavailable owing to a black-out. Their service time
was constant and equal to 20 seconds per vehicle. They must be replaced by operators working in parallel.
Each operator has a service time described by a random variable with an exponential probability distribution
with a mean of 30 seconds. How many operators must be used to reach a steady-state condition? What would
the expected waiting time in queue for each vehicle be in that case? How many operators must be used so that
the expected time spent in queue by each vehicle be not larger than with the three parallel card readers?

Solution. In the scenario with the three parallel card readers, the system is M/D/3, with λ = 6 vehi-
cles/minute and µ = 3 vehicles/minute. So, we have Wq ≈ 0.1 minutes. In the new scenario, the system is
M/M/s with λ = 6 vehicles/minute and µ = 2 vehicles/minute. The system needs at least 4 operators to reach
a steady-state condition. In this case Wq ≈ 0.25 minutes. With s = 5 we have Wq = 0.06 minutes, which is not
worse than in the case with the card readers.

5.9 Bar-code and RFID


Goods received by a large supermarket are unloaded in a suitable structure equipped with 4 unloading bays,
usable in parallel, each one with its own team of workers. Trucks arrive as Poisson events with an average
frequency of 5 trucks per hour. The time needed to unload them in 30 minutes in average and it has an
exponential distribution of probability. All unloaded packages are immediately identified by a bar-code to
be sent to the internal warehouse and possibly to the shelves. You are required to provide a quantitative
evaluation of the impact of replacing bar-code with RFID: it is estimated that this would allow reducing the
average unloading time from 30 to 25 minutes, while keeping the same probability distribution.

Solution. In the current M/M/4 system, with the bar-code, we have λ = 5 trucks/hour, µ = 2 trucks/hour
and s = 4 parallel servers. The performance indicators are: ρ = 62.5%, L = 3.03 trucks, Lq = 0.53 trucks,
W ≈ 0.6 hours (i.e. about 36 minutes), Wq ≈ 0.1 hours (i.e. about 6 minutes).
In the alternative M/M/4 system, with RFID, we have λ′ = 5 trucks/hour, µ′ = 2.4 trucks/hour and s = 4
parallel servers. The performance indicators are: ρ′ ≈ 52.1%, L′ ≈ 2.3 trucks, L′q ≈ 0.2 trucks, W ′ ≈ 0.46 hours
(i.e. about 27.5 minutes), Wq′ ≈ 0.04 hours (i.e. about 2.4 minutes).

5.10 Bays
At a warehouse trucks arrive as Poisson events at an average frequency of one truck every 15 minutes. The
duration of the unloading operations has an exponential probability distribution with a mean of 45 minutes.
When a truck must wait because all bays are busy, the warehouse must pay a penalty of 1 e/minute. The
hourly wage for the operators at each unloading bay is 75 e/hour. What is the optimal number of bays and
what are the corresponding costs? A new contract with the transportation companies compels the warehouse
to keep the average system traversal time (waiting + unloading) for each truck within one hour. Solve the
problem with this additional constraint.

Solution. This is an M/M/s system. The minimum number of servers (bays) needed to reach steady-state
condition is 4; otherwise the requirement ρ < 1 is not satisfied. With 4 bays we have W = 1.13 hours, Wq = 0.38
hours, Lq = 1.53 vehicles, waiting cost equal to 91.70 e/h, cost for the bays equal to 300 e/h and total cost
equal to 391.70 e/h. This is the solution of minimum cost. However it would become infeasible with the new
contract, because W is larger than 1 hour. With 5 bays we have W = 0.84 hours (50.3 minutes), Wq = 0.09
hours (5.3 minutes), Lq = 0.35 vehicles, waiting cost equal to 21.25 e/h (0.35 e/min), service cost equal to
375 e/h (6.25 e/min) and total cost equal to 396.25 e/h (6.60 e/min). This solution is feasible with the new
contract and it is optimal in the new scenario.

20
5.11 Quality test
Mechanical parts output from a high precision process are checked by a quality test operator. He does three
measures on each mechanical part. The three operations are identical but their duration is a random variable
with exponential distribution and a mean of 1 minute. Mechanical parts arrive as Poisson events at an average
rate of two parts every three minutes. For each given number of operators s, the policy is to split the incoming
flow of parts into s identical flows, so that operator k checks parts, k, s + k, 2s + k, . . .. What is the minimum
number of operators needed? With that number of operators, how long does it take in average for a part to
traverse the quality check phase? What is the average number of parts waiting for being checked? If one wants
to cut both the above indicators by 50%, what is the minimum number of operators needed and what is their
utilization factor?

Solution. The way the input flow of parts is partitioned a priori into identical flows, independently of the
state of the queues at each point in time, makes this system a set of s identical single-server queuing systems,
each one serving a fraction 1/s of the demand.
Since service consists of a sequence of three identical operations, the service time has an Erlang distribution
with parameter k = 3. The mean time per each measure is 1 minute and three measures are required; therefore
the mean time for checking a part is 3 minutes. Hence, the mean completion rate for each operator is µ = 1/3
part per minute.
The input process is Poisson and when it is partitioned into s flows, all of them are Poisson. The arrival
rate for each queue is a fraction 1/s of the total arrival rate, which is 2/3 parts per minute. Hence, the arrival
rate for each queue is λ = 2/(3s) parts per minute.
The utilization factor of each M/E3 /1 system is ρ = λ/µ = 2/s. Hence, to reach a steady-state condition
(which implies ρ < 1) at least s = 3 operators are needed.
From the analysis of the M/E3 /1 systems with λ = 2/9 and µ = 1/3, we obtain W = 7 minutes and Lq = 0.8
parts.
To cut these two indicators by 50%, we require W ≤ 3.5 minutes and Lq ≤ 0.4 parts. Four operators are
enough to satisfy the latter condition, but ten operators are required to satisfy the former one.

21

You might also like