Queuing Theory PDF
Queuing Theory PDF
Queuing Theory PDF
Ioannis Glaropoulos
February 13, 2014
1
1 Probability Theory and Transforms
1.1 Exercise 1.2
X is a random variable chosen from X1 with probability a and from X2 with
probability b. Calculate E[X] and σX for α = 0.2 and b = 0.8. X1 is an expo-
nentially distributed r.v. with parameter λ1 = 0.1 and X2 is an exponentially
distributed r.v. with parameter λ2 = 0.02. Let the r.v. Y be chosen from
D1 with probability α and from D2 with probability b, where D1 and D2 are
deterministic r.v.s. Calculate the values D1 and D2 so that E[X] = E[Y ] and
σX = σY .
Solution: a) We directly apply the conditional expectation formula:
We can do this since the expectation is a raw moment – not central. The proof
is straightforward: we have
Finally, we use the relation between the expectation, square mean and variance
2 2
σX = E[X 2 ] − [E[X]] = 4040 − 422 → σX = 47.70. (3)
b) We have E[Y ] = αd1 + bd2 and E[Y 2 ] = αd21 + bd22 . So the system of
equations becomes
Solving this 2 by 2 non-linear system we obtain the solution. Notice that because
of the second order of the equation we may in general have more than one
solutions.
2
1.2 Exercise 1.3
k
X is a discrete stochastic variable, pk = P (X = k) = ak! e−a , k = 0, 1, 2, ... and
a is a positive constant.
P∞
a) Prove that k=0 pk = 1.
P∞
b) Determine the z-transform (generating function) P (z) = k=0 z k pk .
c) Calculate E[X], Var[X] and E[X(X − 1)...(X − r + 1)], r = 1, 2, ... with
and without using z-transforms.
Solution a) We have
∞ ∞ ∞
X X ak X ak
pk = e−a = e−a = e−a ea = 1.
k! k!
k=0 k=0 k=0
c) First, we try without the z-transform, i.e. using the definitions in the
probability domain. We start from the third sentence, using the definition of
expectation: Z ∞
E[g(X)] = g(x)fX (x)dx (5)
−∞
P∞
E[X(X − 1)...(X − r + 1)] = k=0 k(k − 1)...(k − r + 1)pk =
k
ak
P∞ P∞
= k=0 k(k − 1)...(k − r + 1) ak! e−a = k=0 (k−r)! e−a =
P∞ a(k−r)
= e−a ar k=0 (k−r)! = ar e−a ea = ar .
If we replace z = 1 we get
dr
P (z) = E[X(X − 1)...(X − r + 1)].
dz r z=1
dr
P (z) = ar e−a(1−1) = ar .
dz r z=1
3
1.3 Exercise 1.4
ak
Xi ’s are independent Poisson distributed random variables, thus, pk = k!i e−ai ,
k = 0, 1, 2, ..., and each ai , i = 1, 2, ...,
Pnn is a positive constant. Give the proba-
bility distribution function of X = i=1 .
Solution: This problem indicates the usefulness of the z-transform in the
calculation of the distribution of the sum of variables. We have proven that
the ZT of the sum of independent random variables is the product of
their individual z-transforms. Thus,
n
Y n
Y Pn
P (z) = Pi (z) = e−ai (1−z) = e i=1 −ai (1−z)
= e−α(1−z) ,
i=1 i=1
Pn
where α = i=1 −ai . This proves that the distribution is also Poisson with
parameter α, i.e. the sum of parameters. The proof is based on the uniqueness
of z-transform1 . As a result, the distribution function will be
αk −α
pX (k) = e
k!
d) We proceed first, without the help of Laplace transforms, using the defi-
nition of the expectation
R∞ R∞
E[X 0 ] = 0 x0 f (x)dx = 0 f (x)dx = 1.
1 or the 1-1 correspondence between the mass function and the ZT
4
R∞ R∞ R ∞ k −ax 0
E[X k ] = 0 xk f (x)dx = 0 xk ae−ax dx = a −1
a 0
x (e ) dx =
R ∞ k−1 −ax ∞ ∞
dx = ka 0 xk−1 ae−ax dx = 0 xk−1 f (x)dx =
R R
=k 0 x e
= ka E[X k−1 ].
so the standard deviation is simply the square root of the variance, 1/a, and
the coefficient of variation is 1. Notice that this is special for the exponential
distribution.
We try, now, with the help of the Laplace transforms.
dk
∗ k d k
a (−1)k ak!
E[X k ] = (−1)k dsk f (s) = (−1) dsk s+a = (s+a)k+1
.
We find this formula by differentiating k times the Laplace transform and re-
placing s = 0. The rest follows with simple replacement k = 1, 2, ...
5
2 Balance equations, birth-death processes, con-
tinuous Markov Chains
2.1 Exercise 3.2
Consider a birth-death process with 3 states, where the transition rate from state
2 to state 1 is q21 = µ and q23 = λ. Show that the mean time spent in state 2
is exponentially distributed with mean 1/(λ + µ).2
Solution: Suppose that the system has just arrived at state 2. The time until
next ”birth“ – denoted here as TB – is exponentially distributed with cumu-
lative distribution function FTB (t) = 1 − e−λt . Similarly, the time until next
”death“ – denoted here as TD – is exponentially distributed with cumulative
distribution function FTD (t) = 1 − e−µt . The random variables TB and TD are
independent.
Denote by T2 the time the system spends in state 2. The system will depart
from state 2 when the first of the two events (birth or death) occurs. Conse-
quently we have T2 = min{TB , TD }. We, then, apply the result from exercise
1.6, that is the minimum of independent exponential random variables is an
exponential random variable. We can actually show this:
Solution: Denote by NC the number of arriving calls during the period of one
conversation. Denote by T the duration of this conversation. Given that T = t,
NC |T = t is Poisson distributed with parameter λ · t so the probability mass
function of the number of calls will be
(λt)k −λt
Pr{arriving calls within t = k} = Pk (t) = e .
k!
2 This exercise is similar to Exercise 6 from Chapter 1: ”The minimum of independent
6
with an average number of calls: E[NC |T = t] = λt.
Moreover T is exponentially distributed, with parameter µ so the density
function will be:
fT (t) = µe−µt .
We apply the conditional expectation formula:
Z∞ Z∞ Z∞
−µt λ
E[NC ] = E[NC |T = t] · fT (t)dt = λtµe dt = λ tµe−µt dt = .
µ
0 0 0
Solution:
a) We have a link with a constant transmission rate. So the service time
distributions follow the packet length distributions. Consequently, the service
times of both packet types are exponential with mean values of
300 1
• Type 1: E[T1 ] = 4800 = 16 sec,
150 1
• Type 2: E[T2 ] = 4800 = 32 sec.
As a result the parameters of the exponential distributions are µ1 = 16 and
µ2 = 32, respectively. A random arriving packet is of Type 1 or Type 2 with
probability 0.5. We apply the conditional expectation 3 :
1 1 3
E[T ] = E[T1 ] + E[T2 ] =
2 2 64
Similarly, we calculate the mean square:
1 1 1 2 1 2 5
E[T 2 ] = E[T12 ] + E[T22 ] = + = 16−2 + 32−2 = · 16−2 .
2 2 2 µ21 2 µ22 4
2 2
p] = E[T ] − (E[T ]) . Then we compute
The variance of T is derived from V ar[T
the standard deviation σT as σT = V ar[T ], and finally the coefficient of
σT
variation is given as: cT = E[T ].
7
µ1 λ/2 λ/2 λ/2
λ/2 λ/2 µ2 µ2
b) For this part of the exercise, we need to draw the Markov Chain (Fig. 1)
and solve it in the steady state. The state space must be defined in such a
way that we can guarantee that all transitions – from state to state – have an
exponential rate. We choose here to define such a Markov chain with 4 states:
State 0; Empty buffer.
State 11; 1 packet of Type 1.
State 21; 1 packet of Type 2.
State 22; 2 packets of Type 2.
Then we solve the balance equations in the local form:
µ2 P22 = λ/2P21
µ2 P21 = λ/2P0
µ1 P11 = λ/2P0
P0 + P11 + P21 + P22 = 1(norm. equation)
Solution:
P0 = 0.670, P21 = 0.105, P22 = 0.016, P11 = 0.209.
An accepted message of Type 1 can only arrive at state 0, otherwise it is rejected.
So its the average service time will be E[T1 ].
An accepted message of Type 2 can arrive at states 0 and 21, otherwise it is
rejected. Then, the average service time will be (E[T2 ]P0 + 2E[T2 ]P(21 )/(P0 +
P21 ). 4
c) The loss probabilities are equal to the probabilities of the system being in
BLOCKING states, for each of the two packet types. We underline that this is
always true for homogeneous Markov chains, that is, Markov chains where the
arrival rates do not depend on the system state.
Solution:
4 The occurrence of acceptance reduces the sample space to two states only. Then the
8
λ λ 3λ/4 2λ/4 λ/4 0
S0 S1 S2 S3 S4 S5
µ µ µ µ µ
a) This is a simple model but requires careful design. After building the
correct state diagram, the solution is found, based on the LOCAL balance equa-
tions.
We have a system with 6 states. State space: Sk : k jobs in the system. The
system diagram is shown in Fig. 2).
Balance Equation System:
λP0 = µP1
λP1 = µP2
3λ/4P2 = µP3
λ/2P2 = µP4
λ/4P2 = µP5
P5
k=1 Pk = 1
9
λ λ
λ
S0 S10 S20
S11 S21
µ µ µ µ
λ
λ
that all transitions rates are guaranteed to be exponential. The selected state
space:
The state diagram is shown in Fig. 3. We can form the global balance equations
parameterized by λ. Then we apply information that is given: P0 = 0.6; This
extra information enables the solution of the system of equations, and leads to
the calculation of λ:
λP0 = µP11
(λ + µ)P11 = µP10
(λ + µ)P10 = λP0 + µP21
µP21 = λP11 + µP22
P11 + P10 + P21 + P22 = 1 − P0 = 0.4
Solution: P10 ≈ 0.1636, P11 ≈ 0.1337, P20 ≈ 0.0365, P21 ≈ 0.0663, λ ≈ 7.63.
For the calculation of the total average system time for a packet, we apply
Little’s formula.
N 1 · (P10 + P11 ) + 2 · (P21 + P22 )
N = λef f · E[Tsys ] → E[Tsys ] = = .
λef f λef f
We always apply the effective arrival rate at Little’s formula, because the formula
needs the actual average arrival rate at the system, excluding possible drops.
Here, the effective rate is not equal to λ, since we have packet drops. However,
since the arrival rate for this system does not change with time, the effective
arrival rate is simply:
10
3 Chapter 4 – Queuing Systems
3.1 Exercise 4.1
Packets arrive to a communication node with a single output link according to
a Poisson Process. Give the Kendall notation for the following cases:
1. the packet lengths are exponentially distributed, the buffer capacity at the
node is infinite
2. the packet length is fixed, the buffer can store n packets
3. the packet length is L with probability pL amd l with probability pl and
there is no buffer in the node
Solution:
1. M/M/C/C
2. M/M/C/C+c
11
4 Exercise 4.4
Which system provides the best performance, an M/M/3/300/100 or an
M/M/3/100/100?
Solution: They have the same performance, since the users fit to both
queues. Of course, the first system wastes buffer positions!
2
Solution: Offered Load ρ → λT = 300 · 60 · 4.5 = 45 Erlang. Generally, the
actual load is not the offered load.
Link Utilization:
actual load
# servers
The existence of an infinite queue here means that no load is dropped, or
that the offered load is the actual load. So,
offered load 45
utilization = = = 0.5
90 90
.
12
λ λ λ λ λ
S0 S1 S2 ... Sk Sk+1 ...
µC µC µC µC µC
13
Finally, the state distribution is given as
Pk = (1 − ρ)ρk .
We, now, derive the average number of messages in the system, using the state
distribution:
P∞ P∞ P∞
N = k=0 kPk = k=0 k(1 − ρ)ρk = (1 − ρ)ρ k=0 kρk−1 =
d( ∞ k
k=0 ρ )
P
P∞ dρk
= (1 − ρ)ρ k=0 dρ = (1 − ρ)ρ dρ = (1 − ρ)ρ d(1/(1−ρ))
dρ = ρ
1−ρ .
In order to solve the first question we can use the LITTLE’s formula:
1
E[Ttotal ] = .
(µC) − λ
1 λ + T0−1
≤ T0 → µC − λ ≥ T0−1 → C ≥ .
µC − λ µ
14
λ λ λ λ
µ µ µ µ µ µ
system. Then, the state diagram is straightforward. Special care must be taken
on determining the transitions and rates from state to state.
Departure rate = µ
Arrival Event rate = λ
Clearly, the average customer arrival rate is 2λ and is NOT Poisson! What IS
Poisson is the group arrival rate. We also DEFINE ρ = µλ . This is neither the
offered nor the actual load. We just use ρ to define this fraction.
The system diagram is given in Fig. 5.
Local Balance Equations:
λP0 = µP1
λPk−2 + λPk−1 = µPk , k≥2
P0
P (z) = . (7)
1 − ρz − ρz 2
15
The second condition comes from the NORMALIZATION in the probability or
in the Z-domain:
X∞
Pk = 1, or, P (z = 1) = 1.
k=0
Proof:
P∞ k "∞ # ∞
dP (z) d k=0 z Pk X X
= = kz k−1 Pk = kPk = N .
dz z=1 dz z=1 k=0 z=1 k=0
Replacing z = 1 we obtain
3ρ 3λ
N= = .
1 − 2ρ µ − 2λ
The typical M/M/1 system with the same average customer arrival rate (2λ)
ρ
and service rate (µ) has N M/M/1 = 1−ρ , where ρ is its offered load, and is equal
to ρ = 2λ/µ. So, finally,
2λ
N M/M/1 =
µ − 2λ
so it is different, and, actually, less. Why?
16
λ λ λ λ λ
S0 S1 S2 ... Sk Sk+1 ...
µ 2µ 3µ kµ (k + 1)µ
.........................................................................
λPk−1 = kµPk → Pk = k1 ρPk−1 = ... = k! 1 k
ρ P0
.........................................................................
P∞
k=0 Pk = 1 (normalization)
From the last general equation and the normalization equation we obtain
the state distribution:
∞
X ρk
P0 = 1 → P0 eρ = 1 → P0 = e−ρ .
k!
k=0
N 1
E[Ttotal ] = = .
λ µ
This means that the arriving customers only stay in the system for an average
time equal to the service time!6
parallel with the others, so actually this system is equivalent to an M/M/∞ system!
17
system. If a group of customers does not fit into the system, none of the members
of the group joins the queue. 10% of the customers arrive in a group of 1, 20%
of the customers arrive in groups of 2, 30% in a group of 3 and 40% in a group
of 4 customers. The average number of arriving customers is 75 customers
per hour, the interarrival time between groups is exponentially distributed. The
service time is exponentially distributed with a mean of 0.5 minutes.
1. Give the Kendall notation of the system and draw the state transition
diagram.
2. Calculate the average number of customers in the queue and the mean
waiting time per customer.
3. Calculate the probability that the system is full and the probability that a
customer arriving in a group of k customers can not join the queue.
4. Calculate the probability that an arriving customer in general can not join
the queue and the probability that an arriving group of customers can not
join the queue.
5. What is the average waiting time for a customer arriving in a group of 3
customers?
Solution: This is a very interesting problem that reveals the problems when
the arriving process is complex and not straightforward so it must be derived.
First, we give the Kendall notation of the system. We have:
The difficulty lies in deriving the arrival transition rates. We are given
that the number of customers per group is i.i.d. We assume, naturally, that
the GROUP arrival process is HOMOGENEOUS, that is, groups arrive in each
state with the same rate! Also, since the inter-arrival times between GROUP ar-
rivals are exponential we conclude that the GROUP arrivals is a Poisson process.
7 It is our task to find an appropriate state space where the event arrival process is Poisson.
18
We are given that the number of customers per group is an i.i.d. process,
but we are NOT given the distribution. Let
q1 , q2 , q3 , q4
denote the probabilities that a random arriving group contains 1,2,3,4 customers
respectively.
Let λG denote the Poisson group arrival rate. Then, the individual rates
for each groups is ALSO a Poisson process, based on the Poisson split property,
with rates
λG q1 , λG q2 , λG q3 , λG q4 .
For any i = 1, 2, 3, 4,
λG · qi
defines the (average) rate of arrivals for group’s of type i, and, consequently,
λG · qi · i
λG q1 · 1 = 10% · 75
λG q2 · 2 = 20% · 75
λG q3 · 3 = 30% · 75
λG q4 · 4 = 40% · 75
λG = 30 groups / hour
We can now complete the state diagram (Fig. 7). Then, we solve the LOCAL
balance equations, to define the state probabilities.
We can compute BOTH the average number of customers in the system, and
the average number of customers in the queue:
N queue = 1 · P2 + 2 · P3 + 3 · P4
N = 1 · P1 + 2 · P2 + 3 · P3 + 4 · P4
For the average waiting time, we could apply the LITTLE result. For that
we need the effective customer arrival rate, which is different from the nominal,
since there are losses in the system.
It is important to notice again that the system is HOMOGENEOUS in group
arrivals but not in customer arrivals.
We have
λef f = P0 λG ·(q1 +2q2 +3q3 +4q4 )+P1 λG ·(q1 +2q2 +3q3 )+P2 λG ·(q1 +2q2 )+P3 λG ·(q1 ).
19
λG q4
λG q3 λG q3
λG q2 λG q2 λG q2
λG q1 λG
λG q1 λG q1 λG q1
S0 S1 S2 S3 S4
µ µ µ µ
λG q4 λG q3 + λG q4 λG q2 + λG q3 + λG q4
Then, from LITTLE we compute first the system time, N = λef f E[T ], and
then the average waiting time will be W = E[T ] − E[Ts ].
The probability that the system is full (as seen by an independent observer)
is simply P4 .
The probability that a customer of a group k does not join the queue is, actu-
ally, the probability that the whole particular group does not join the queue.
Since the system is homogeneous in group arrivals (a random group SEES state
distribution),
20
An arriving group of customers is blocked with probability
21
λ λ λ λ λ λ λ
S0 S1 S2 S3 ... S9 S10
µ 2µ 3µ 4µ 9µ 10µ
• 10 Servers
• No buffer
The Kendall Notation is: M/M/10/10.
We draw the system diagram (Fig. 8) and, based on that, we build the
balance equations to compute the state probabilities. A state, S, defines the
number of active calls in the system. We define
λ
ρ=
µ
22
which, here, is also the offered load of the system; of course this is NOT the
actual load, since the system may drop calls when it is blocked. We have:
.............................................................
k
λPk−1 = kµPk → Pk = kρ Pk−1 = ρk! P0
where, here, n = 10. The blocking probability is the probability that the system
can not accept new calls, and this is equal to the probability of the system being
in state Sn (S10 ). This probability is, also, the TIME BLOCKING, i.e. the
percentage of time the system can not accept new calls, and it is the one seen
by an independent observer.
ρn
Pblock = Pn = Pnn! ρk
k=0 k!
General rule: In Markov chains where the arrival rates do not depend on the
system state, the time blocking is also equal to the probability of a random
event being blocked. The latter is defined as CALL BLOCKING probability.
You can compute the Pblock from the equation above, but you could also do
it by using the Erlang tables.
• Servers: n = 10
λ 180
• Offered Load: ρ = µ = 3600 = 5.5
110
The rate of rejected calls is ALWAYS given by: λ · Pcall block . However, as
stated above, here,
Pcall block = Pblock
since the arrival process is independent of the system state8 . We get:
23
To find the average load per server, we first need to find the total ACTUAL
load. The actual load is the nominal (offered) load minus the rejected load:
For the average load per server, we divide the above with the number of severs.9
7 Exercise 6.3
We consider two types of call arrivals to a cell in a mobile telephone network:
new calls that originate in a cell and calls that are handed over from neighboring
cells. It is desirable to give preference to handover calls over new calls. For this
reason, some of the channels in the cell are reserved for handover calls, while
the rest of the channels are available to both types of calls. For the questions
below, assume the following: Channels in the cell are held for two minutes on
average, with exponential distribution. All calls arrive according to a Poisson
process with rate λnc = 125 calls per hour for new calls, and λho = 50 calls
per hour for handover calls. The cell has a capacity of 10 channels; each call
occupies 1 channel.
1. Draw a state diagram of the channel occupancy in a cell when 2 channels
are used exclusively for handover calls.
2. Calculate the blocking probability in the cell if no channels are reserved for
handover calls. What is the average number of channels used?
3. Find the minimum number of channels reserved for handover calls so that
their blocking probability is below 1 percent. What is the blocking probabil-
ity for the new calls in this case?
Solution:
This is an interesting exercise that models a Mobile network, like GSM,
UTRAN etc. We have a system which prioritizes some calls (handover) over
some others (new).
We draw the state transition diagram for the case of 2 reserved channels for
handover calls (Fig. 9)
• Poisson arrivals – λ = λnc + λho for states 0,1,2,...,7, λ = λho for states
8,9. This is a nce application of the Poisson SPLIT property.
1 1
• Exponential Service times – µ = E[t] = 2/60 = 30.
• 10 servers, no buffer
9 Check also exercise 4.5.
24
λno λnc
S0 S1 S2 ... S8 S9 S10
µ 2µ 3µ 8µ 9µ 10µ
Figure 9: State diagram for exercise 6.3. Case of 2 reserved channels for han-
dover calls. Notice that the system accepts only handover arrivals when only 2
channels remain vacant. In state 10, both handover and new calls are dropped.
We can draw and solve the balance equations for this system, and calculate, for
example, the average number of active calls in the cell. The offered load in the
system is
λtotal · E[T ] = (λnc + λho ) · E[T ].
What is the actual load of this system?
We consider, now, the case where no channels are reserved for handover calls.
The Kendall notation is then M/M/10/10. So, the system resembles a standard
M/M/10/10 case!
2 35
• Offered Load: ρ = (λnc + λh o)E[T ] = 175 · 60 = 6 .
• Servers: n = 10
• Blocking Probability: E10 ( 35
6 ) = ...
For the third question we need to go step by step. First, we do the calcula-
tions with one reserved channel. The diagram in shown in Fig. 10 We have the
result:
9
λho λtot λho
10µ 9!µ9 10µ
Pblock = P10 = λ2tot λ9tot λho λ9tot
= 1 λho
λtot +
1+ µ + 2µ2 + ... + 9!µ9 + 10!µ10 E9 (ρ) 10µ
25
λnc
S0 S1 S2 ... S8 S9 S10
µ 2µ 3µ 8µ 9µ 10µ
Figure 10: State diagram for exercise 6.3c. Case of 1 reserved channel for
handover calls. Notice that the system accepts only handover arrivals when
only one channel remains vacant. State S9 is now green, to show that it is a
non-blocked state for handover calls.
λno λnc
S0 S1 S2 ... S8 S9 S10
µ 2µ 3µ 8µ 9µ 10µ
Figure 11: State diagram for exercise 6.3c. Case of 2 reserved channel for
handover calls. Notice that the system accepts only handover arrivals when
only one channel remains vacant. State S9 is now green, to show that it is a
non-blocked state for handover calls.
Solution: There is a clear difference between the two system, and that is, the
user population. In Fig. 12 we depict the two system diagrams. Both systems
have finite population, i.e. the user arrival rate depends on the system state.
26
40λ 39λ 38λ
S0 S1 S2
µ 2µ
(a)
4λ 3λ 2λ
S0 S1 S2
µ 2µ
(b)
However, the first system (A) could be approximated with a typical M/M/2/2
system, since the population size (40) is high compared to the number of servers
(2). In other words, 40λ ≈ 39λ ≈ 38λ. We can not say the same for system B.
We notice that the TIME Blocking probability is equal to the CALL blocking
probability since the arrival intensity is constant and does not depend on the
state (we assumed typical M/M/2/2). So, we obtain:
Pblock = P2 = 0.615
The mean blocking time (Tb ) is the average time the system CONTINU-
OUSLY remains in state S2 , i.e. from the time it arrives at S2 until it departs
to S1 . The transition rate (S2 → S1 ) is 2µ, so the average time the system stays
at S2 is E[Tb ] = 1/2µ = 3sec.
The mean time without blocking (Tn ) is the average time between a
departure from state S2 and an arrival at state S2 . It is not the percentage
of time without blocking! That would be, simply, P0 + P1 .
27
where Tbi is the duration of the blocking period at cycle i and Tni is the duration
of the non-blocking period at cycle i. We rewrite the above as
1
PM 1
PM
Ti limM →∞ i
i=1 Tb
Pb = lim 1 PM i=1 b
M
= 1
M
PM (10)
M →∞ i i i i
M i=1 Tb + Tn limM →∞ M i=1 Tb + Tn
and finally:
1
PM i
limM →∞ M i=1 Tb E[Tb ]
Pb = 1
PM i 1
PM = . (11)
limM →∞ i=1 Tb + limM →∞
i
i=1 Tn
E[Tb ] + E[Tn ]
M M
From the above we can calculate E[Tn ] with respect to Pb and E[Tb ].
The solution for system B is similar to the one for system A, EXCEPT that
we can not use the approximation from the Erlang tables, so we need to derive
the steady-state solution by solving the balance equations.
We calculate the mean blocking time and the mean time without block in
the same way.
Note, however, that the call blocking probability is different, now, since this
chain is non-homogeneous, as the arrival rate is state-dependent! In particular:
2λP2
Pcall block =
4λP0 + 3λP1 + 2λP2
28
8 Tutorial 7 – M/M/m systems
8.1 Exercise 7.2
The performance of a system with one processor and another with two processors
will be compared. Let the inter-arrival times of jobs be exponentially distributed
with parameter λ. We consider, first, the system with one processor. The service
time of the jobs is exponentially distributed with a mean of 0.5sec.
1. For an average response time of 2.5sec (the total time for a job in the
system) how many jobs per second can be handled?
2. For an increase of λ with 10% how much will the response time increase?
3. Calculate the average waiting time, the average number of customers in
the server and the utilization of the server. What is the probability of the
server being empty?
Let us now compare this system with a system of two cheaper processors, each
with a mean service time of 1 sec.
1. How many jobs can now be handled per second with a mean response time
of 2.5 sec?
2. For an increase of λ with 10% how much will the response time increase?
3. Calculate the average waiting time, the average number of customers in
the server and the utilization of the server. What is the probability of both
of the servers being busy?
Solution: We consider first the system with one processor. Clearly, since we are
not given any information regarding the buffer data, and we are also told that
there is waiting time, we can safely conclude that the buffer is infinite.
As a result we are dealing with a typical M/M/1 system, and we will derive
the answers from the M/M/1 formulas. The average number of jobs in the
M/M/1 system is given as
ρ λ/2 λ
N= = =
1−ρ 1 − λ/2 2−λ
1 1
since µ = E[T ] = 0.5 = 2. Applying the LITTLE’s formula, we get
N 1
T system = = → λ = 1.6
λ 2−λ
since T system = 2.5. Assume now that we increase the arrival rate by 10%. The
new rate will be λ̂ = 1.1 · 1.6 = 1.76. This will change the offered load of the
system to ρ̂ = µλ̂ = 1.762 = 0.88. Then the response time will be given in a
similar way:
1 1
T̂system = = = 4.1666sec
µ − λ̂ 2 − 1.76
4.166−2.5
So the increase is 2.5 = 66.66%
29
λ λ λ λ
S0 S1 S2 S3 ...
µ 2µ 2µ 2µ
Figure 13: System diagram for the second model of exercise 7.2
For the initial (λ = 1.6) system the average waiting time is W = T system −
E[T ] = T system − µ1 = 2sec, the mean number of customers in the system is
N = ρ/(1 − ρ) = 0.8/0.2 = 4, and the probability of empty server is 1 − ρ = 0.2.
The utilization is of course ρ and is equal to the mean number of customers in
the server.
We consider now the second system. This one has 2 processors with µ = 1,
so half of the service rate. The offered load for this system is ρ = λ/1 = λ. The
state diagram is given in Fig 13. We could use the formulas for the M/M/2
system. However, since we only have 2 servers, we can solve it analytically with
the Balance Equations.
λP0 = µP1 → P1 = ρP0
2
λP1 = 2µP2 → P2 = 21 ρP1 = ρ2 P0
3
λP2 = 2µP3 → P3 = 12 ρP2 = ρ4 P0
............................................
ρk
λPk−1 = µPk → Pk = 2k−1 P0
From the above equation set and the normalization equation we derive
∞
!
X ρk−1 2−ρ
P0 1 + ρ k−1
= 1 → P0 = .
2 2+ρ
k=1
Then, we calculate the mean number of customers in the system, from the state
distribution
∞ ∞
X X ρk 2 − ρ 4ρ 4λ
N= kPk = k = ... = = .
2k−1 2 + ρ (2 + ρ)(2 − ρ) (2 + λ)(2 − λ)
k=1 k=1
30
3.65−2.5
So the increase is 2.5 = ....
Note that for a fair comparison with the previous system we must compute
the response time for λ = 1.76. Calculations give:
4
T̂system = = ... = 4.4326sec
(2 + 1.76)(2 − 1.76)
1
but, simply, can be given as T system − µ = 1.5 sec.
Solution: In this problem the state space is given. Sij denotes the state where
the total number of customers [in the server(s) and in the queue] is i and the
number of active servers is j. Given the state space we draw the system dia-
gram in Fig. 14. The system has 2 servers, infinite queue, Poisson arrivals and
exponential service times, so the Kendall notation is: M/M/2, although it is
not a typical case, as you see in the diagram.
31
λ λ λ
S22 S32 S42 ...
2µ 2µ 2µ
2µ λ
λ λ
µ µ
Figure 14: System diagram for exercise 7.6. Notice that the system transits
from S21 to S32 , since this new arrival would make the queue length become 2,
so the second server is activated, and the queue length remains one, while both
servers, now, serve a customer.
32
9 Tutorial 8 – M/M/m systems with limited
number of customers
10 Exercise 6.6
There are K computers in an office, and a single repairman. Each computer
breaks down after an exponentially distributed time with parameter α. The re-
pair takes an exponentially distributed amount of time with parameter β. Only
one computer is being repaired at a time, computers break down independently
from the repair process, and repair times and lifetimes of the computers are
independent.
1. What is the probability that i computers are working at time t?
2. What is the average failure rate (i.e. the average number of computers
that fail per time unit)?
3. What is the percentage of time a repairman is busy?
4. What is the percentage of time when all computers are out-of-order (bro-
ken)?
5. How many computers should we have if we would like to have K computers
to work on average?
Solution:
By reading the first question of this problem we already realize what the desired
State Space could be. We try with the obvious selection:
State Si : i computers working, i = 0, 1, 2, ..., K
The K computers in the system is the population size of our model. And it is,
clearly, finite. The single repairman represents the servers in our model (1).
Each computer needs an exponentially distributed time for repair, so the service
rates in our model are exponential. Finally, each computer breaks-down after
an exponentially distributed time (after its repair) so the arrival process in the
system is, also, Markovian.
To summarize:
• A break-down of a computer is an ”arrival”
• A repair of a computer is a ”departure” or a ”service”
Based on the above, we depict the diagram in Fig. 10. We denote γ = β/α. We
draw the Balance Equations:
β
βP0 = αP1 → P1 = α P0 = γP0 ,
β
βP1 = 2αP2 → P2 = 2α P1 = 21 γP1 = 12 γ 2 P0 ,
βP1 = 3αP2 → β
P2 = 3α P1 = 31 γP1 = 1 3 (12)
2·3 γ P0 ,
...............................................................
β 1 K
βPK−1 = KαPK → PK = Kα PK−1 = .... = K! γ P0 .
33
β β β β β
S0 S1 S2 ... SK−1 SK
α 2α 3α(K − 1)α Kα
γi
Pi = P0 , i = 0, 1, 2, ..., K (13)
i!
From the above and the normalization equation we derive the P0 :
K K
X X 1 j 1
Pj = 1 → γ P0 = 1 → P0 = PK 1 . (14)
j=1 j=1
j! j=1 j! γ
j
P0 gives the probability that all computers are out of order. In addition, the
probability that i computers are working (in the steady-state) is given by:
γi
Pi = PK γj
. (15)
i! j=1 j!
The repairman is busy in all states, except state SK , where all computers are
working properly. So the percentage of time the repairman is busy, will be:
Next, we want to calculate the average failure rate (λfail rate ). We notice that
the failure rate depends on the state of the system. For example, the failure
rate in state SK is Kα, while, in case S0 is it zero! We use the conditional
expectation calculation to compute it:
K
X K
X
λfail rate = j · αPj = α j · Pj , (17)
j=1 j=1
We would like to have a system with K computers working (on average). Assume
the required number of computers is M . Then M can be found as the lowest
integer that satisfies the inequality:
M
X γi
N ≥K → i· PM γj
≥ K. (19)
i=1 i! j=1 j!
34
We can find the require M by trial-and-error.
Extra question: What is the probability that a broken computer can
not be repaired immediately?
This probability can be found by taking the ratio of the rate of computer break-
downs that can not be served immediately, over the total average rate of com-
puter break-downs:
PK−1
j=1 αjPj
λW = PK (20)
j=1 αjPj
11 Exercise 8.6
In a kitchen dormitory corridor there are two hobs for cooking and 3 places
on the sofa. There are 8 students living in the corridor, each of them goes on
average every 1/α hours to the kitchen to cook (if he is not cooking already),
the inter-arrival time is exponentially distributed. If on arrival the 2 hobs are
occupied, the student looks for a place on the sofa. If the sofa is occupied as well,
the student goes back to his room and tries again at a later time. Students spend
an exponentially distributed amount of time cooking with mean 1/β. α = 0.5
hours, β = 1 hours.
1. Draw the state transition diagram
2. Calculate the mean waiting time of the students
3. Calculate the ratio of time the kitchen is completely full, e.g. a student
arriving has to go back to his room.
4. Calculate the probability that a student finds the kitchen completely full
5. Calculate the probability that a student has to wait more than 2 hours
(supposing that he can sit down in the kitchen)
Solution:
This is a complex problem that discusses all important matters in the Marko-
vian systems with finite population size. It is, perhaps, easy to choose the state
space; it could, clearly, be the number of places occupied by students at some
point in time, either in the kitchen counter (hobs) or the kitchen sofa:
The population of the system is the number of students (8). The number of
servers is the number of hobs (2) and the number of queuing positions is the
number of places on the sofa (3). The inter-arrival times between student ar-
rivals at the kitchen is exponentially distributed and the rate depends on the
remaining number of students that are still at their rooms (not already cooking
or waiting at the sofa). The service times are the cooking times and are also
exponentially distributed. Consequently, the system is Markovian, with Kendall
notation: M/M/2/5/8. The system diagram is depicted in Fig. 16. We define:
35
8α 7α 6α 5α 4α 3α
S0 S1 S2 S3 S4 S5
β 2β 2β 2β 2β
α 1
ρ= = .
β 2
Notice that is not the offered load at the system. We draw the balance equa-
tions:
8αP0 = βP1 → P1 = 8ρP0 ,
7αP1 = 2βP2 → P2 = 27 ρP1 = 28ρ2 P0 ,
6αP2 = 2βP3 → P3 = 3ρP2 = 84ρ3 P0 , (22)
5αP3 = 2βP4 → P4 = 25 ρP3 = 210ρ4 P0 ,
4αP4 = 2βP5 → P5 = 2ρP2 = 420ρ5 P0
Through the state probabilities we calculate, first, the percentage of time the
kitchen is completely full, simply:
Pfull = P5 . (24)
Now, since the system has finite population, the arrival rates depend on the
state, and, so the probability that a random student finds the system (kitchen)
full is NOT equal to P5 . The average student arrival rate is calculated using
the conditional expectation and taking into account the different arrival rates
in each state:
X5
λ= λk · Pk , (25)
k=0
The average student block rate is the average rate of students that are
blocked, i.e. find the kitchen completely full. Since they are only blocked at
state S5 we obtain:
λblock = 3αP5 . (27)
36
The ratio between the two average arrival rates gives the percentage of students
that are blocked, or, equivalently, the probability that an arbitrary student is
blocked (Pblocked ):
λblock 3P5
Pblocked = = (28)
λ 8P 0 + 7P 1 + 6P 2 + 5P3 + 4P4 + 3P3
Clearly, the effective arrival rate of the system is the total average arrival rate
minus the blocked arrival rate:
We can find the mean waiting time of the student with the help of LITTLE’s
formula. First, we need to compute the average number of students in the
kitchen:
X 5
N= kPk = P1 + 2P2 + 3P3 + 4P4 + 5P5 . (30)
i=0
Then, using LITTLE we can find the average SYSTEM time for a student:
N
E[Tsystem ] = . (31)
λeff
Then the average waiting time will be equal to the average system time minus
the average service (cooking) time:
1
W = E[Tsystem ] − . (32)
β
There is another way to do this; that of considering the arrivals at
each state and the waiting time a student experiences given the state
of arrival. Here, we must reject the blocked arrivals cause they have
no waiting time.
The last question is a bit challenging. We are asked to consider ONLY those
students that are not rejected. So we must consider students that arrive at
states Sk , k = 0, ...4. Generally, we use the total probability theorem, and
obtain:
4
X
Pr{W > 2h} = Pr{W > 2h|Student sees state Sk }·Pr{Student sees state Sk }
k=0
(33)
1. If the student observes state S0 or S1 there is not waiting time. (Cooks
immediately)
2. If the student observes state S2 the student waits for an exponential
amount of time with parameter 2β.
3. If the student observes state S3 the student waits for a sum of two expo-
nential amounts of time, each with parameter 2β.
37
4. If the student observes state S4 the student waits for a sum of three
exponential amounts of time, each with parameter 2β.
There is however, a better option. We can realize that the times between de-
partures are exponentially distributed variables with rate 2β, considering fully
loaded kitchen counter. So, the number of departures within some time interval
will be a Poisson random variable! This is the duality between the exponential
and the Poisson distributions!
So, for example, if the student observes S4 he will want for more than T =2h, if
less than 3 departures occur during these two hours, and the number of these
departures is Poisson (2β · T ):
)0 )1 )2
Pr{W > T |Student sees state S4 } = (2βT 0! + (2βT
1! + (2βT
2! e−2βT
0 1
Pr{W > T |Student sees state S3 } = (2βT )
+ (2βT ) e−2βT (34)
0! 0 1!
(2βT ) −2βT
Pr{W > T |Student sees state S2 } = 0! + e
The last thing to calculate the probabilities that a random student observes
a particular state. Using the same reasoning as in the calculation of the blocked
students, we get:
6αP2
Pr{Student sees state S2 } = λeff
5αP3
Pr{Student sees state S2 } = λeff (35)
4αP4
Pr{Student sees state S2 } = λeff
Notice that we used λeff because we exclude those students that arrive at state
S5 and are blocked (because they have no waiting time).
38