Politecnico di Torino

Network Modeling
Formulary
Fiandrino Claudio - Pievanelli Elisa
Academic Year 2010/2011
Contents
I Theory 5
1 Elementary Queueing Theory 6
1.1 Introduction and Basic Definitions . . . . . . . . . . . . . . . . . . . . . 6
1.1.1 Arrivals and Service . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.2 Scheduling Disciplines . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.3 Kendall’s Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.1.4 Graphical Representation of Queue . . . . . . . . . . . . . . . . . 12
1.1.5 Measurement of Effectiveness . . . . . . . . . . . . . . . . . . . . 13
1.1.6 Little’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2 Birth-Death Processes: The M/M/1 Queue . . . . . . . . . . . . . . . . 15
1.2.1 Description and Steady-State Solution . . . . . . . . . . . . . . . 15
1.2.2 Performance Measurement . . . . . . . . . . . . . . . . . . . . . . 17
1.3 Finite-Capacity System - The M/M/1/N Queue . . . . . . . . . . . . . . 19
1.4 Multiservers Systems - The M/M/c Queue . . . . . . . . . . . . . . . . . 21
1.5 Multiservers Systems - The M/M/c/0 Queue . . . . . . . . . . . . . . . 23
1.6 Multiservers Systems - The M/M/∞ Queue . . . . . . . . . . . . . . . . 25
1.7 Finite-Source Systems - The M/M/1/N-1/N Queue . . . . . . . . . . . . 26
1.8 Finite-Source Systems - The M/M/k/0/N Queue . . . . . . . . . . . . . 26
2 Queues with Phase-Type Laws 28
2.1 The Erlang-r Service Model - The M/E
r
/1 Queue . . . . . . . . . . . . 28
2.2 The Erlang-r Arrival Model - The E
r
/M/1 Queue . . . . . . . . . . . . 30
2.3 The M/H
2
/1 and H
2
/M/1 Queues . . . . . . . . . . . . . . . . . . . . . 32
3 The M/G/1 and the G/M/1 Queues 34
3.1 Introduction in the M/G/1 Queue . . . . . . . . . . . . . . . . . . . . . 34
3.2 Solving the M/G/1 Queue . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.3 Average in other type of queue . . . . . . . . . . . . . . . . . . . . . . . 38
4 Queueing Networks 39
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.1.1 Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.1.2 The Departure Process - Burke’s Theorem . . . . . . . . . . . . . 39
2
Politecnico di Torino Formulary ver. 1.1
4.1.3 Two M/M/1 Queues in Tandem . . . . . . . . . . . . . . . . . . 41
4.2 Open Queueing Networks . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.2.1 Feedforward Networks . . . . . . . . . . . . . . . . . . . . . . . . 41
4.2.2 Jackson Networks . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.3 Closed Queueing Networks . . . . . . . . . . . . . . . . . . . . . . . . . . 44
II Exercises 45
5 Preliminary Exercises 46
6 Exercises on Queues 51
7 Network queues exercises 70
8 Simulation of exams 73
III Appendix 92
A Formulas 93
B Integrals 96
C Series 98
3
Introduction
The formulary consists of a theorical part, exercises and formulas.
We have wrote it during the course Network modelling: theory and simulation
attended, for the first time, in this year.
The first part has been written by Pievanelli Elisa, while the exercises by Fiandrino
Claudio

.

Contact me from http://claudiofiandrino.altervista.org/ section contact & links.
4
Part I
Theory
5
Chapter 1
Elementary Queueing Theory
1.1 Introduction and Basic Definitions
The server(s) and the queue into which arriving customers are directed together con-
stitute the service facility or queueing system. Also, it frequently happens that both
the queue and the server are collectively referred to as a queue, such as the M/M/1
queue or the M/G/1 queue. One after the other, customers arrive to the service facil-
ity, eventually receive service and then depart. We make some assumptions about all
queueing systems we analyze:
• If the server is free (not already serving a customer) an arriving customer goes
immediately into service. No time at all is spent in the queue.
• If the server is busy, then the customer joins a queue of waiting customers and
stays in the queue until entering service.
• When the server becomes free, a customer is chosen from the queue according to
a scheduling policy and immediately enters into service. The time between the
departure of one customer and the start of service of the next customer is zero.
• Customers remain in the system until their service is complete and then they
depart. Customers do not become impatient and leave before they receive service.
1.1.1 Arrivals and Service
The length of a queue depends on the complete probabilistic description of the arrival
and service processes - the demand being placed on the resource - and of the capacity of
the resource to service these demands. It’s evident that, if the average service demands
of arriving customers are greater than the system service capacity, the system will break
down since unbounded queues will form. On the other hand, if the average arrival rate
is less than the system service capacity, then we still get queues. Even when the average
arrival and service rates are held constant, an increase in the variation of arrivals or
service increases the congestion. Thus we use elementary probability theory to predict
6
Politecnico di Torino Formulary ver. 1.1
average waiting times, average queue length, distribution of queue length, etc., on the
basis of:
• the arrival pattern of customers to the resource,
• the service pattern of customers,
• the scheduling algorithm in which the next customer to be served is chosen.
In some scenario, the space available to hold customers waiting for service, may be
limited. When the queue has reached its maximum capacity, so it is full; customers
who arrive to find the queue full are lost.
The Arrival Process
The customer arrival process may be described in two ways:
1. By characterizing the number of arrivals per unit time (the arrival time);
2. By characterizing th time between successive arrivals (the interarrival time).
We use the variable λ to denote the mean arrival rate (1/λ denotes the mean time
between arrivals). If the arrival pattern is not deterministic, the input process is a
stochastic process, which means that we need its associated probability distribution.
The probability distribution of the interarrival time of customers is denoted by A(t)
where
A(t) = P (time between arrivals ≤ t)
and
1
λ
=
_

0
t dA(t)
where dA(t) is the probability that the interarrival time is between t and t + dt. We
assume that these interarrival times are independent and identically distributed (iid),
which means that only A(t) is of significance. The manner in which the arrival pattern
changes in time may be important. An arrival pattern that does not change with time
is called homogeneous arrival process. If it is invariant to shifts in the time origin, it
is called stationary arrival process.
The Service Process
The service pattern may be describe by a rate, the number of customers served per
unit time, or by a time, the time required to serve a customer. The parameter µ is used
to denote the mean service rate (1/µ denotes the mean service time). We use B(x) to
denote the probability distribution of the demand placed on the system
B(t) = P (Service time ≤ x)
7
Politecnico di Torino Formulary ver. 1.1
and
1
µ
=
_

0
xdB(x)
where dB(x) is the probability that the service time is between x and x + dx. The
service time is equal to the length of time spent in service and does not include the
time spent waiting in the queue. Although it is usual to associate the service time
distribution with the server, the service time is actually the time that is request or
needed by customer who is taken into service. The service may be batch or single.
With batch service, several customers can be served simultaneously. Also, the service
rate may depend on the following factors:
1. Each server has its own queue.
2. There are fewer queues than server. Typically, there is a single queue for all
servers.
The servers may or may not be identically, B(x) may be different for different servers.
The capacity that a service facility has to hold waiting customers is often taken to be
infinite.
Poisson Arrivals and Exponential Service
In stochastic modelling, numerous random variables are frequently modelled as expo-
nentials. These include:
• interarrival time,
• service time,
• time to failure of a component,
• time required to repair a component.
Recall that the cumulative distribution function for an exponential random variable,
X, with parameter λ > 0, is given by
F(x) =
_
1 −e
−λx
x ≥ 0
0 otherwise
and its corresponding probability density function is
f(x) =
_
λe
−λx
x ≥ 0
0 otherwise
Its mean and variance are given, respectively, by
E[X] =
1
λ
Var [X] =
1
λ
2
Reason for the use of exponential distribution include:
8
Politecnico di Torino Formulary ver. 1.1
1. its memoryless property and resulting analytical tractability,
2. its relationship to the Poisson process.
Definitions of Poisson process:
1. {t
i
} is a Poisson process if:
• t
i+1
−t
i
IID (interarrival times are independent and identically distributed),
• t
i+1
− t
i
∼ e
λ
(interarrival times are distributed as an exponential with
parameter λ)
2. A Poisson process {N(t), t ≥ 0} having a rate λ ≥ 0 is a counting process with
independent and stationary increments, with N(0)=0, and is such that the number
of events that occur in any time interval of length t has a Poisson distribution
with mean λt. This means that
P (N(t +s) −N(s) = n) = e
−λt
(λt)
n
n!
n = 0, 1, 2, . . .
Thus a Poisson process is a continuous-parameter, discrete-state process.
3. Let N(t) be the number of events that occur in an interval (0,t]. When the
following four conditions are true, then {N(t), t ≥ 0} is a Poisson process:
(a) N(0)=0,
(b) Events that occur in nonoverlapping time intervals are mutually indepen-
dent,
(c) The number of event that occur in any interval depends only on the length
of the interval and not on the past history of the system,
(d) For sufficiently small h and some positive constant λ, we have
P (One event in(t, t +h]) = λh +o(h)
P (Zero events in(t, t +h]) = 1 −λh +o(h)
P (More Than one event in(t, t +h]) = o(h)
where o(h) (”little o h”) is any quantity that tends to zero faster than h
lim
h→0
o(h)
h
= 0
These definitions of the Poisson process are equivalent. The number of arrivals, N(t),
in the interval (0,t] has a Poisson distribution with parameter λt. To compute the mean
number of arrivals in an interval of length t, we proceed as follows:
E[N(t)] =

k=1
k p
k
(t) =

k=1
k e
−λt
(λt)
k
k!
= λt
_

k=1
(
(λt)
k−1
(k −1)!
_
e
−λt
=
= λt
_

k=1
(λt)
k
k!
_
e
−λt
= λt
9
Politecnico di Torino Formulary ver. 1.1
Poisson Process Have Exponential Interarrival Times
If the arrival process is a Poisson process, then the associated random variable de-
fined as the time between successive arrivals (the intearrival time) has an exponential
distribution. The arrival process is Poisson:
p
n
(t) = e
−λt
(λt)
n
n!
, n = 0, 1, 2, . . .
Which describes the number of arrivals that have occurred by time t. Let X be the
random variable that denotes the time between successive arrivals. Its probability
distribution function is given by
A(t) = P (X ≤ t) = 1 −P (X > t)
But P (X > t) = P (0 arrivals in (0, t]) = p
0
(t). Thus
A(t) = 1 −p
0
(t) = 1 −e
−λt
t ≥ 0
with corresponding density function
a(t) = λe
−λt
t ≥ 0
This defines the exponential distribution. Thus X is exponentially distributed with
mean 1/λ and, consequently, for a Poisson arrival process, the time between arrivals is
exponentially distributed.
Superposition and Decomposition of Poisson Process
When two or more independent Poisson streams merge, the resulting stream is also
a Poisson stream. It follows then that multiple processes to a single service center
can be merged to a single arrival process whose interarrival times are exponentially
distributed. If the i-th stream, i = 1, 2, ..., n, has parameter λ
i
, then the parameter for
the merged stream is given by
λ =
n

i=1
λ
i
A single Poisson stream may be decomposed into multiple independent Poisson streams
if the decomposition is such that customers are directed into substreams i, i=1,2,...,n
with probability p
i
and
n

i=1
p
i
= 1
10
Politecnico di Torino Formulary ver. 1.1
PASTA (Poisson Arrivals See Time Average)
An important property of the Poisson arrival process is that the distribution of cus-
tomers seen by an arrival to a queueing system is, stochastically, the same as the limiting
distribution of customers at the system. Once the queueing system has reached the
steady state, each arrival from a Poisson process finds the system at equilibrium. If p
n
is the probability that the system contains n customers at equilibrium and a
n
is the
probability that an arriving customer finds n customers already present, then PASTA
says that p
n
= a
n
.
π
(i)
a
= lim
∆t→0
P (N(t) = i | one arrival in(t, t + ∆t))
= lim
∆t→0
P (N(t) = i, one arrival in(t, t + ∆t))
P (one arrival in(t, t + ∆t))
= lim
∆t→0
P (one arrival in(t, t + ∆t) | N(t) = i)
P (one arrival in(t, t + ∆t))
·
P (N(t) = i)
P (one arrival in(t, t + ∆t))
=
P (one arrival in(t, t + ∆t)) · P (N(t) = i)
P (one arrival in(t, t + ∆t))
= P (N(t) = i) = π
(i)
This result is a consequence of the memoryless property if the interarrival time distri-
bution of customers to queueing system fed by Poisson process: it does not depend on
the service time distribution. The PASTA property does not hold for arrival processes
different from Poisson.
1.1.2 Scheduling Disciplines
The scheduling policy, or discipline, is the manner in which the customers are selected
from the queue and taken into service. We assume that the time it takes to select a
customer and to enter that into service is zero. We have two type of policies:
• Preemptive policies: it is used when there are different types of customer (high
priority and low priority). When a high priority customer enters the queue and
finds a lower priority customer in service, the service of the lower priority customer
is interrupted and later resumed.
• Nonpreemptive system: in this case the server will commence the service of lower
priority customer if there are no higher priority customers in the queue. Several
scheduling disciplines exist:
– FCFS (First Come First Served), also called FIFO (First In First Out). In
this case it is selected the first customer at the head of the queue to be the
first served.
– LCFS (Last Come First Served) is the opposite of FCFS. The last customer
to arrive is the one next chosen to be served.
11
Politecnico di Torino Formulary ver. 1.1
– LCFS-PR (Last Come First Served-Preempt Resume)
– SIRO (Service In Random Order). The next customer to be served is chosen
at random among all those waiting.
– RR (Round Robin). In this scheduling discipline, the duration of service
provided each time a customer begins service is limited to a fixed amount
(time slice). If a customer completes its service at any point during the time
slice, it immediately departs from the service center and the customer at the
head of the queue begins to be served. If, after the time slice has finished,
a customer has still not completed its service requirement, that customer is
reinserted back into the end of the queue to await its turn.
– PS (Processor Sharing), it is a limiting case of RR in whiche the time slice
goes to zero.
– IS (Infinite Server). In this case the server has the ability to serve all cus-
tomers simultaneously.
– PRIO (Priority scheduling). The customer chosen from the queue is the one
with the highest priority.
1.1.3 Kendall’s Notation
Kendall’s notation is used to characterize queueing systems. It is given by A/B/C/X/Y/Z
where
A indicates the interarrival time distribution
B indicates the service time distribution
C indicates number of servers
X indicates the system capacity
Y indicates the size of the customer population
Z indicates the queue scheduling discipline
Some possible distribution for interarrival and service time are: M for Markovian, E for
Erlang, G for General and D for Deterministic. The number of servers is often taken
to be 1. This first three parameters are always provided. The letters that specify the
system capacity, customer population and scheduling discipline may be omitted with
the understanding that the default values for capacity and population size is infinite
and the default scheduling discipline is FCFS.
1.1.4 Graphical Representation of Queue
There are several ways to graph a queueing system, but we will see only one. for a
FCFS, single server queue. one possibility is shown in the figure 1.1.
12
Politecnico di Torino Formulary ver. 1.1
Time
N. customers
1
2
3
4
τ
1
τ
2
τ
3
τ
4
τ
5
τ
6
t
2
t
3
t
4
t
5
t
6
w
2
x
1
x
2
x
3
x
4
x
5
x
6
Figure 1.1: Representation of a queue
Let we denote with C
n
the n
th
customer that enters in the queue. Let we denote
with τ
n
the time at which C
n
arrives in the system and t
n
the arrival time between
the arrival of C
n−1
and C
n
. We assume that the t
n
are drawn from a distribution
such that P (t
n
≤ x) = A(t), independent of n, where A(t) is completely arbitrary
interarrival time distribution. Equally, we can define x
n
to be the service time for C
n
and P (x
n
≤ x) = B(x), where B(x) is a completely arbitrary service time distribution.
In the figure we have plotted N(t), the number of customers in the system at time t;
and w
n
represents the waiting time for C
n
and s
n
represent the system time for C
n
.
Moreover, we can say that:
. t
n
are interarrival times;
. x
n
are interdeparture times.
1.1.5 Measurement of Effectiveness
We analyze a queueing system with the purpose of obtaining the values of certain system
properties; for example: the number of customers in the system, the waiting time of a
customer, the length of a busy or idle period, the current work backload, etc.. These
are called measurement of effectiveness. All these values are random variables and we
have to know their complete probabilistic descriptions, but sometimes we are satisfied
to be able to derive just mean and variance. We now consider the most commonly
obtained measures of effectiveness:
• Number of customers: let N the random variable that describes the number
of customers in the system at steady state. The probability that at steady state
13
Politecnico di Torino Formulary ver. 1.1
the number of customer present in the system is n is denote by p
n
,
p
n
= P (N = n)
and the average number in the system at steady state is
E[N] =

i=0
n · p
n
Let N
q
be the random variable that describes the number of customers waiting
in the queue and we denote its mean by E[N
q
].
• System time and queueing time: the time that a customer spend in the
system, from the instant of its arrival to the queue to the instant of its departure
from the server, is called the response time. This is a random variable and we
denote it by R and its mean value is E[R]. The response time is composed of the
time that the customer spends waiting in the queue, called waiting time, plus the
time the customer spends receiving service, called service time. Let W
q
be the
random variable that describes the time spends by the customer waiting in the
queue and its mean is E[W
q
].
• System utilization: in a queueing system with a single server, the utilization
U is defined as the fraction of time that the server is busy. If the rate at which
customers arrive in the queueing system is λ and if µ is the rate at which these
customers are served, then the utilization is equal to ρ =
λ
µ
(where ρ is identified
with the utilization). In the case of queueing system with multiple servers, the
utilization is defined as the average fraction of server that are active U =
λ

.
• System throughput: The throughput of a queueing system is equal to its
departure rate, the average number of customers that are processed per unit
time. It is denote by X. In a queueing system in which customers that arrive
are eventually served and leave the system, the throughput is equal to the arrival
rate λ.
• Traffic intensity: we define the traffic intensity as the rate at which work enters
the system, so it is given as the product of the average arrival rate of customers
and the service time: λ¯ x =
λ
µ
, where ¯ x =
1
µ
and µ is the mean service rate. In a
queueing system with a single server the traffic intensity is equal to the utilization.
For multiple servers, the traffic intensity is equal to cU.
1.1.6 Little’s Theorem
Little’s theorem equates the number of customers in a system to the product of the
effective arrival rate and the time spend in the system. We assume that
E[N] = lim
T→∞
1
T
_

0
N(t) dt
14
Politecnico di Torino Formulary ver. 1.1
E[D] = lim
N→∞

N
i=1
D
i
N
and the Little’s theorem says:
E[N] = E[λ] · E[D]
This says that the number of customers in the system is equal to the average arrival
rate of customers in the system multiplied by the average system time per customer.
Little’s theorem can be applied individually to the different parts of a queueing system,
the queue and the server.
1.2 Birth-Death Processes: The M/M/1 Queue
Birth-Death processes are continuous-time Markov chains with a special structure. If
the states of the Markov chain are indexed by integer 0,1,2,.. , then transitions are
permitted only from state i > 0 to its nearest neighbors state i − 1 and i + 1.For the
state i = 0 the Markov chain must enter state 1. These processes are called skip-free
processes because to go from any state i to any other state j, each intermediate state
must be visited. An arrival to the queueing system results in one additional unit in
the system, and is defined with a birth, whereas a departure removes a unit from the
system as is referred to as a death. The simplest of all queeuing system is the M/M/1
queue. This is a single server queue with FCFS scheduling discipline, an arrival process
that is Poisson and service time that is exponentially distributed.
1.2.1 Description and Steady-State Solution
At any time t, the state of an M/M/1 queue is completely characterized by specifying
the number of customers present. The state are denote with an integer number, n
denotes the state in which there are n customers in the system, including the one in
service. We want to know the state probabilities, the probability that the system is in
any given state n at any time t.
p
n
(t) = P (n in the sistem at time t)
This is a difficult task; so we look to the steady-state probabilities
π
n
= lim
t→∞
p
n
(t)
If this limit exists, then the probability of finding the system in any particular state
eventually becomes independent of the starting state. This probability p
n
can be in-
terpreted as the probability of finding n customers in the system at an arbitrary point
in time after the process has reached steady state. Not all systems reach the steady
state, for some queueing systems it is impossible that lim
t→∞
p
n
(t) may not yield a true
probability distribution. This system is a Markov chain so we can draw the diagram
15
Politecnico di Torino Formulary ver. 1.1
0 1 2
n · · · n + 1
λ
µ
λ
µ
λ
µ
Figure 1.2: State transition diagram of an M/M/1 queue
transition state (figure 1.2):
The arrivals are distributed as an exponential with parameter λ and the service times
are exponentially distributed with parameter µ. The steady state equation are:
State 0 : λπ
0
= µπ
1
State 1 : (λ +µ) · π
1
= λπ
0
+µπ
2
State n : (λ +µ) · π
n
= λπ
n−1
+µπ
n+1
n ≥ 1
If we sum the first two equations we obtain: λπ
1
= µπ
2
. If we substitute this result
in one of the first two equations we can find the value of π
1
or π
2
. If we repeat this
procedure for all the state of the system we’ll find:
λπ
n
= µπ
n+1
n ≥ 0
π
n+1
=
λ
µ
π
n
n ≥ 0
To find the value of π
0
we proceed as follows:
π
1
=
λ
µ
π
0
π
2
=
λ
µ
π
1
=
_
λ
µ
_
2
π
0
π
n
=
_
λ
µ
_
n
π
0
If we impose ρ =
λ
µ
, we find
π
n
= ρ
n
π
0
Now we need to know if the M/M/1 system is ergodic.
A Markov chain is ergodic if:
• ρ =
λ
µ
< 1
• π
0
= 1 −ρ
• π
n
= (1 −ρ)ρ
n
n > 0
16
Politecnico di Torino Formulary ver. 1.1
At this point, we impose

i=0
π
i
= 1
This implies
π
0

i=0
ρ
i
= 1
π
0
=
1


i=0
ρ
i
with

i=0
ρ
i
< ∞
1.2.2 Performance Measurement
Mean Number in System
Let N be the random variable that describes the number of customers in the system at
steady state and let E[N] be the mean number of customers in the M/M/1 queue.
E[N] =

n=0

n
=

n=0
n(1 −ρ)ρ
n
For n = 0, the product is zero then we can start the sum from n = 1
E[N] = (1 −ρ)

n=1

n
= (1 −ρ)ρ

n=1

n−1
Since nρ
n−1
can be written as nρ
n−1
=

n

E[N] = (1 −ρ)ρ

n=1
d

ρ
n
= (1 −ρ)ρ
d

_

n=1
ρ
n
_
We know that

n=1
ρ
n
=

n=0
ρ
n
−1 =
1
1 −ρ
−1 =
ρ
1 −ρ
so we can write
E[N] = (1 −ρ)ρ
d

_
ρ
1 −ρ
_
=
ρ
1 −ρ
(ρ < 1)
17
Politecnico di Torino Formulary ver. 1.1
Variance of Number in System
To compute the variance of the number of customers in an M/M/1 queue, we use the
formula
Var [N] = E
_
N
2
¸
−E[N]
2
The second moment is
E
_
N
2
¸
=

n=0
n
2
π
n
=

n=0
n
2
(1 −ρ)ρ
n
= (1 −ρ)

n=0
n
2
ρ
n
= (1 −ρ)ρ

n=0
n
2
ρ
n−1
= (1 −ρ)ρ
d

_

n=0

n
_
= (1 −ρ)ρ
d

_
ρ
(1 −ρ)
2
_
= (1 −ρ)ρ
(1 −ρ)
2
+ 2(1 −ρ)ρ
(1 −ρ)
4
= ρ
ρ
(1 −ρ)
2
In this way we can write the variance as follows
Var [N] = ρ
ρ
(1 −ρ)
2

_
ρ
1 −ρ
_
2
=
ρ
(1 −ρ)
2
Delay - Mean of Waiting in the Queue
If the mean service time is 1/µ and the mean waiting time is n/µ we can write the
mean of waiting in the queueing system as
E[W | find 0 customer] =
1
µ
E[W | find 1 customer] =
2
µ
E[W | find n customers] =
n + 1
µ
=⇒
_
1
µ
+
n
µ
_
In this way we can compute the mean of waiting in the queueing system
E[W] =

n=0
E[W | n] · P (finding n customers) =

n=0
n + 1
µ
π
(n)
a
Applying PASTA we obtain
E[W] =

n=0
n + 1
µ
π
n
=

n=0
n + 1
µ
(1 −ρ)ρ
n
=
1/µ
1 −ρ
Throughput, Utilization and Traffic Intensity
The throughput of the M/M/1 queue is equal to the arrival rate, X = λ. The utilization
in equal to the traffic intensity and is given by:
U =
λ
µ
18
Politecnico di Torino Formulary ver. 1.1
1.3 Finite-Capacity System - The M/M/1/N Queue
In an M/M/1/N queue customers arrive according to a Poisson process at rate λ and
receive service that is exponentially distributed with a mean service time of 1/µ from
a single server. The difference from the M/M/1 queue is that at most N customers
are allowed into the system. A customer that arrives and find the system full it is
discarded, and then lost. To analyze the M/M/1/N queue, we use a birth-death model
and choose the parameter so that the Poisson arrivals stop as soon as N customers
are present. Figure 1.3 shows the system. The parameters of the exponential service
distribution are unchanged. Then
λ
n
=
_
λ n < N
0 n ≥ N
µ
n
= µ for n = 1 , 2 , · · · , N
We can now write the flow balance equations:
0 1 2 N −2 · · · N −1 N
λ
µ
λ
µ
λ
µ
λ
µ
Figure 1.3: State transition diagram of an M/M/1/N queue
λπ
0
= µπ
1
λπ
1
= µπ
2
λπ
i
= µπ
i+1
i ≤ N
π
i
= ρ
i
π
0
ρ =
λ
µ
The system is ergodic so we impose
N

i=0
π
i
= 1
therefore by substituting π
i
= ρ
i
π
0
N

i=0
ρ
i
π
0
= 1
π
0
=
1

N
i=0
ρ
i
19
Politecnico di Torino Formulary ver. 1.1
Recall that
N

i=0
ρ
i
=
1 −ρ
N+1
1 −ρ
We can write:
π
0
=
1 −ρ
1 −ρ
N+1
And then we can obtain the value of π
i
π
i
= ρ
i
·
1 −ρ
1 −ρ
N+1
i ≤ N + 1
Now we try to find some important parameter of this type of queue:
- The loss probability is P
loss
= π
(N+1)
a
In this case we can apply PASTA, because the arrival process is Poisson, and
we’ll find:
P
loss
= π
(N+1)
a
= π
N+1
=
ρ
N+1
(1 −ρ)
1 −ρ
N+2
For ρ < 1 and N → ∞ the loss probability tends to 0 while, considering ρ > 1
and N →∞ the loss probability is:
P
loss
=
ρ −1
ρ
N+2
ρ
N+1

1
ρ
N+1
=
ρ −1
ρ
≈ 1 −
1
ρ
- The throughput is the number of customers that arrive in a unit of time; in this
case the formula for the throughput in input is:
T
in
= λ

= λ(1 −P
loss
) = λ(1 −π
N+1
)
and the formula for the throughput in output is:
T
out
= µ

= µ(1 −π
0
) = µ
_
1 −
1 −ρ
1 −ρ
N+2
_
If λ < µ and N →∞ : µ

< λ
If λ > µ and N →∞ : µ

= µ
If N = 0
T
out
= µ
_
1 −
1 −ρ
1 −ρ
2
_
= µ
_
−ρ
2

1 −ρ
2
_
= µρ
1 −ρ
(1 +ρ)(1 −ρ)
=
µρ
1 +ρ
=
λ
1 +ρ
20
Politecnico di Torino Formulary ver. 1.1
- Delay: for the calculation of the delay we use the Little’s Theorem
E[N] = E[λ] · E[D]
E[D] =
E[N]
λ(1 +π
N+1
)
E[N] =
N+1

i=0

i
=
ρ[1 −(N + 2)ρ
N+1
+ (N + 1)ρ
N+2
]
1 −ρ
2
·
1 −ρ
1 −ρ
N+2
E[D] =
ρ[1 −(N + 2)ρ
N+1
+ (N + 1)ρ
N+2
]
(1 −ρ)(1 −ρ
N+2
)
λ
_
1 −
ρ
N+1
(1 −ρ)
1 −ρ
N+2
_
If ρ < 1 and N →∞:
E[D] =
ρ
λ(1 −ρ)
=
1/µ
1 −ρ
If N = 0:
E[D] =
1
µ
1.4 Multiservers Systems - The M/M/c Queue
The M/M/c queue consists of c identical servers. In this queue customers arrive ac-
cording to a Poisson process with rate λ
n
= λ for all n and are served in fist-come
first-served order by any available server. Each of the c servers provides independent
and identically distributed exponential service rate µ. When the number of customers
is greater or equal to c, n ≥ c, then all the servers are busy and the effective service
rate is equal to cµ. If the number of customer is less than c, then only n out of c servers
are busy and the effective service rate is equal to nµ. The term load dependent service
center is used to designate a service center in which the customers departure rate is a
function of the number of customers present. With c identical servers, each providing
service at rate µ, and a total of n customers present, the load dependent service rate
is equal to
µ(n) = min{n, c} · µ
The state transition diagram of an M/M/c queue is represented in figure 1.4. It
follows that the arrival rate and the service rate to define the M/M/c queue are given
by
λ
n
= λ ∀n
µ
n
=
_
nµ 1 ≤ n ≤ c
cµ n ≥ c
21
Politecnico di Torino Formulary ver. 1.1
0 1
c −2 · · · c −1 c c + 1 · · ·
λ
µ
λ
(c −1)µ
λ

λ

Figure 1.4: State transition diagram of an M/M/c queue
The condition for ergodicity is λ < cµ.
The flow balance equation are:
λπ
0
= µπ
1
λπ
1
= 2 µπ
2
For a generic i we obtain:
λπ
i
= (i + 1)µπ
i+1
i < c
λπ
i
= cµπ
i+1
i ≥ c
And from these equations we find:
1. for i < c
π
i+1
=
λ
(i + 1)µ
π
i
π
i
=
_
λ

_
·
_
λ
(i −1)µ
_
·
_
λ
(i −2)µ
_
· . . . ·
_
λ
µ
· π
0
_
π
i
=
_
λ
µ
_
i
1
i!
π
0
2. for i ≥ c
π
i+1
=
λ

π
i
π
i
=
_
λ

_
·
_
λ

_
·
_
λ

_
· . . . · π
c
π
i
=
_
λ

_
i−c
π
c
The system is ergodic only when

i=0
π
i
< ∞
22
Politecnico di Torino Formulary ver. 1.1
Since this is an ergodic sum with radix λ/cµ, the ergodic condition is
λ

< 1
If we normalize by requiring

i=o
π
i
= 1
we obtain:
c

i=0
1
i!
_
λ
µ
_
i
π
0
+

i=c+1
_
λ

_
i−c
1
c!
_
λ
µ
_
c
π
0
= 1
π
0
=
1

c
i=0
1
i!
_
λ
µ
_
i
+


i=c+1
_
λ

_
i−c
1
c!
_
λ
µ
_
c
=
1

c
i=0
1
i!
_
λ
µ
_
i
+
1
c!
_
λ
µ
_
c
λ/cµ
1 −λ/cµ
From this formula we can find information on the delay:
E[N] =

i=0
i · π
i
E[D] =
E[N]
λ
1.5 Multiservers Systems - The M/M/c/0 Queue
This kind of queue is characterized by the fact of not having the waiting line. It is still
a Markov chain because it has both the arrival process, that is Poisson, and the service
time distributed as an exponential.
This is the state transition diagram of an M/M/c /0 queue (figure 1.5).
0 1 2
c −2 · · · c −1 c
λ
µ
λ

λ
(c −1)µ
λ

Figure 1.5: State transition diagram of an M/M/c/0 queue
This system is an irreducible Markov chain.
23
Politecnico di Torino Formulary ver. 1.1
Now we write the flow balance equation:
λπ
0
= µπ
1
λπ
1
= 2µπ
2
λπ
i
= (i + 1)µπ
i+1
i ≤ c −1
π
i+1
=
λ
(i + 1)µ
π
i
i ≤ c −1
π
i
=
1
i!
_
λ
µ
_
i
π
0
If we impose

i=0
π
i
= 1
we can find π
0
as follows
c

i=0
1
i!
_
λ
µ
_
i
π
0
= 1
π
0
=
1

c
i=0
1
i!
_
λ
µ
_
i
π
i
=
1
i!
_
λ
µ
_
i

c
j=0
1
j!
_
λ
µ
_
j
For the loss probability, that is the fraction of customer that are loss over the customers
that arrived, we can consider that we have a loss when a customer arrives and find c
customers already in service. In this way we can define the loss probability as:
P
loss
= π
c
=
1
c!
_
λ
µ
_
c

c
j=0
1
j!
_
λ
µ
_
j
= B(ρ, c)
Where B(ρ, c) is the Erlang B formula. This formula is valid for the system M/G/c/0
and for this system the loss probability is:
P
loss
=
1
c!
(λ · E[S])
c

c
i=0
1
j!
(λ · E[S])
j
The delay of an M/G/c/0 is
E[D] =
ρ
1 −ρ
24
Politecnico di Torino Formulary ver. 1.1
1.6 Multiservers Systems - The M/M/∞ Queue
This is an infinite server queue and the arrival and service rates are:
λ
n
= λ ∀n (1.1)
µ
n
= nµ ∀n (1.2)
Since no customer will evere wait in an M/M/∞ queue, the mean time spent in the
system must be equal to the mean service time 1/µ and so the mean number of cus-
tomers present must be equal to λ times this, λ/µ.
This is the state transition diagram of an M/M/c queue (figure 1.6).
0 1 2 · · · n −1 · · · n n + 1 · · ·
λ
µ
λ

λ

λ
(n + 1)µ
Figure 1.6: State transition diagram of an M/M/∞ queue
The flow balance equations are:
λπ
n
= (n + 1)µπ
n+1
π
N+1
=
λ
(n + 1)µ
π
n
π
n
=
1
n!
_
λ
µ
_
n
π
0
We impose that

n=0
π
n
= 1
obtaining
π
0

n=0
1
n!
_
λ
µ
_
n
= 1
π
0
· e
ρ
= 1
π
0
= e
−ρ
The average delay and the average number of customers are:
E[D] =
1
µ
E[N] =
λ
µ
= ρ
25
Politecnico di Torino Formulary ver. 1.1
1.7 Finite-Source Systems - The M/M/1/N-1/N Queue
In this type of queue there is a total of N customers and a customers is either in the
system, or else outside the system and is in an idle state. When a customer is in the
idle condition, then the time it takes for that particular customer to arrive is a random
variable with exponential distribution whose means is 1/λ. This is the mean time spent
per customer in the idle condition. All customers act indipendently of each other so
that if there are k customers in the idle condition, the total average arrival rate is kλ.
The arrival process in this case is not a Poisson process and we cannot apply PASTA.
The flow balance equations are:
Nλπ
0
= µπ
1
(N −i)λπ
i
= µπ
i+1
0 ≤ i ≤ N −1
From these equation we can find the relationship between π
i
and π
0
π
i+1
=
(N −i)λ
µ
π
i
π
i
=
(N −i + 1)λ
µ
(N −i + 2)λ
µ
· · · =
_
_
i

j=1
(n −i +j)
_
_
λ
i
µ
π
0
To find π
0
we have to impose

N
i=0
π
i
= 1 and in this way we find the steady state
solution.
π
0
=
1

N
i=0
_

i
j=1
(n −i +j)
_
λ
i
µ
Now we try to find the average of this type of queue applying Little’s Theorem:
E[N] =
N

i=0

i
E[λ] =
N

i=o
λ
i
π
i
=
N

i=0
(N −i)λπ
i
E[T] =
E[N]
E[λ]
1.8 Finite-Source Systems - The M/M/k/0/N Queue
This queue is represented by k identical servers (where k < N), no waiting line and
the population is a maximum of N. This kind of system is typical of the telephone
communications.
The state transition diagram of an M/M/k/0/N queue is represented in figure 1.7.
This system is always ergodic and we can find π
i
solving the flow balance equations.
26
Politecnico di Torino Formulary ver. 1.1
0 1 2 k −2 · · · k −1 k

µ
(N −1)λ

(N −k + 2)λ
(k −1)µ
(N −k + 1)λ

Figure 1.7: State transition diagram of an M/M/k/0/N queue
For the loss probability we have to refer to the blocking probability; where P
block
< π
k
.
The blocking probability is the fraction between the rate at which calls are blocked and
the rate at which calls arrive:
P
block
=
(N −k)λπ
k

k
i=0
(N −i)λπ
i
=
(N −k)π
k

k
i=0
(N −i)π
i
<
π
k

k
i=0
π
i
= π
k
N −i ≥ N −k
27
Chapter 2
Queues with Phase-Type Laws
In a single server queue the only probability law used to model the interarrival or service
time distributions is the exponential distribution. This type of queue are collectively
referred to as birth-death processes. In these systems, transitions from any state are ad-
jacent states only. But sometimes the exponential distribution is simply not adequate.
Phese-type distributions allows us to consider more general situations. Queueing sys-
tem with phase-type arrival or service mechanisms are referred to be almost-birth-death
processes.
2.1 The Erlang-r Service Model - The M/E
r
/1 Queue
Consider a single server system for which the arrival process is Poisson with rate λ
and service time, having an Erlang-r distribution, is represented as a sequence of r
exponential services each with rate rµ. There cannot be more than one customer
receiving service at any time - the single server provides each customer taken into service
with r consecutive service phases and then ejects that customer from the system.
The density functions of the arrival and service processes are given by
a(t) = λe
−λt
, t ≥ 0
b(x) =
rµ(rµx)
r−1
e
−rµx
(r −1)!
, x ≥ 0
Our first task is to formulate a state descriptor for this queueing system. In an M/E
r
/1
queue, we must record both the number of customers present and the current phase
of service of the customer in service, if any. Because of the exponential nature of the
distribution of both the times between arrivals and the services times at each of the r
phases, a knowledge of the number of customers in the system and the current phase of
service is sufficient to capture all the relevant past history of this system.It follows that
a state of the system can be completely described by the pair (k, i), where k (k ≥ 0) is
the number of customers in the system, including the one in service, and i (1≤ i ≤ k)
denotes the current phase of service. If k = 0, then the value of i is irrelevant. If
28
Politecnico di Torino Formulary ver. 1.1
k > 0, then k − i+1 denotes the number of phases of service yet to be completed by
the customer in service. The future evolution of the system is a function only of the
current state (k, i) and consequently a Markovian analysis may be carried out.
1,S
1
2,S
1
3,S
1
1,S
2
2,S
2
3,S
2
0 1,S
3
2,S
3
3,S
3
· · · · · · · · ·
1,S
r
2,S
r
3,S
r
λ

λ
r
µ

λ
r
µ
rµ rµ
λ

λ
rµ rµ
λ

λ
rµ rµ
λ λ
Figure 2.1: State transition diagram of an M/E
r
/1 queue
The state transition diagram is represented in figure 2.1, where the states are arranged
into levels according to the number of customer present. The states that have exactly
k customers are said to constitute the level k.
If we consider Y as an Erlang process of order r we can write:
Y = X
1
+X
2
+· · · +X
r
Where X
i
with i < k is IID and it is a random variable distributed exponentially.
We can also calculate the mean of Y :
E[Y ] =
1
µ
with Y = X
1
+ X
2
+· · · + X
r
The second moment of Y is:
E
_
Y
2
¸
= E
_
(X
1
+X
2
+· · · +X
r
)
2
¸
=
k

i=1
E
_
X
2
i
¸
+
k

i=1
k

j=1
E[X
i
X
j
]
= k
2
(kµ)
2
+k(k −1)
1
(kµ)
2
=
k
2
+k
(kµ)
2
=
1
µ
+
1

2
The coefficient of variation, how variant is the random variable is describe by this
formula
C
v
=
_
Var [X]
E[X]
29
Politecnico di Torino Formulary ver. 1.1
for the exponential this value is
C
v exp
= 1
The variance of an M/E
r
/1 queue comes from the second moment
Var [Y ] = E
_
Y
2
¸
−E[Y ]
2
=
1
µ
2
+
1

2

1
µ
2
=
1

2
And the coefficient of variation for an Erlang-r distribution is:
C
v Er
r
=
1


1
µ
=
1

k
2.2 The Erlang-r Arrival Model - The E
r
/M/1 Queue
We now introduce the case of a single server queue for which the arrival process is
Erlang-r and the service time is exponential with rate µ.
The density function of the arrival and service processes are given by
a(t) =
rλ(rλt)
r−1
(r −1)!
t ≥ 0
b(x) = µe
−µx
x ≥ 0
Before actually appearing in the proper queue, an arriving customer must pass through
r exponential phases each one distributed with parameter rλ. When a customer com-
pletes the arrival process another immediately begins. We assume to have an infinite
pool of available customers waiting to enter the arrival mechanism. The instant that
one customer completes the arrival process, a second customer simultaneously begins
the process.
The state descriptor for the E
r
/M/1 queue must specify the number of customers in
the system, k, and the phase at which the arriving customer has to be found, i. In this
way, the state diagram is set up on a two-dimensional grid (k,i), arranged into levels
according to the number of customers present, similar to the M/E
r
/1 system. The
state transition of E
r
/M/1 queue is represented in figure 2.2.
30
Politecnico di Torino Formulary ver. 1.1
(0,1) (0,2) (0,3) · · · (0,r)
(1,1) (1,2) (1,3) · · · (1,r)
(2,1) (2,2) (2,3) · · · (2,r)
· · · · · · · · · · · · · · ·
(k,1) (k,2) (k,3) · · · (k,r)

µ

µ

µ


µ

µ

µ

µ


µ

µ

µ

µ


µ

µ

µ

µ


µ
rλ rλ rλ rλ
Figure 2.2: State transition diagram of an E
r
/M/1 queue
31
Politecnico di Torino Formulary ver. 1.1
2.3 The M/H
2
/1 and H
2
/M/1 Queues
In this section we take into account single-server queues with either hyperexponential
service or arrival distributions. We consider first the M/H
2
/1 queue, in this case the
arrivals are generated according to a Poisson process with rate λ, while the service is
represented by a two-hyperexponential distribution. With probability α a customer
entering service receives service at rate µ
1
, while with probability 1 −α this customer
receives service at rate µ
2
. Also in this case the state of the system is represented by
the pair (n,i ) where n is the total number present and i is the current service phase.
The transition diagram is shown in figure 2.3. Increasing the number of phases from 2
to r has the effect of incorporating additional columns into this figure. With r possible
service choices, a departure from any state (n,i ), n > 1 can bring the system to any of
the states (n-1, i ) at rate α
i
µ
i
, where α
i
is the probability that an arriving customer
enters service phase i, for i =1,2,..,r.
(0,0)
(1,1) (1,2)
(2,1) (2,2)
· · · · · ·
(k,1) (k,2)
(1 −α)λ
αλ
µ
1
µ
2
λ
αµ
1
α
µ
2
λ
(
1

α
)
µ
1
(1 −α)µ
2
λ
αµ
1
α
µ
2
λ
(
1

α
)
µ
1
(1 −α)µ
2
λ
αµ
1
α
µ
2
λ
(
1

α
)
µ
1
(1 −α)µ
2
Figure 2.3: State transition diagram of an M/H
2
/1 queue
Now we look at the H
2
/M/1 queue. In the instant at which a customer enters in the
queue properly, a new customer immediately initiates its arrival process. The time of
32
Politecnico di Torino Formulary ver. 1.1
the moment at which it actually arrives in the queue is exponentially distributed. With
probability α this exponential distribution has rate λ
1
, while probability 1-α it has rate
λ
2
.
The transition diagram is represented in figure 2.4.
(0,1) (0,2)
(1,1) (1,2)
(2,1) (2,2)
· · · · · ·
(k,1) (k,2)
(
1

α
)
λ
1
αλ
1
µ
α
λ
2
(1 −α)λ
2
µ
(
1

α
)
λ
1
αλ
1
µ
α
λ
2
(1 −α)λ
2
µ
(
1

α
)
λ
1
αλ
1
µ
α
λ
2
(1 −α)λ
2
µ
(
1

α
)
λ
1
αλ
1
µ
α
λ
2
(1 −α)λ
2
µ
Figure 2.4: State transition diagram of an H
2
/M/1 queue
33
Chapter 3
The M/G/1 and the G/M/1
Queues
3.1 Introduction in the M/G/1 Queue
The M/G/1 queue is a single-server queue, the arrival process is Poisson with rate λ
and its distribution function is:
A(t) = 1 −e
−λt
t ≥ 0
The service times are independent and identically distributed and obey a general distri-
bution function. In particular, the remaining service time may no longer be independent
of the service already received. The mean service rate is denoted by µ. The service
time distribution function is:
B(x) = P (S ≤ x)
where S is the random variable service time, and the density function is:
b(x)dx = P (x ≤ S ≤ x +dx)
For the M/G/1 queue, the stochastic process N(t), t ≥ 0 is not a Markov process since,
when N(t) ≥ 1, a customer is in service and the time already spent by that customer in
service must be take into account. Consider the conditional probability that the service
finishes before x +dx knowing that its duration is greater than x
C(x) = P (S ≤ x +dx| S > x) =
P (x ≤ S ≤ x +dx)
P (S > x)
=
b(x)dx
1 −B(x)
In general C(x) depends on x. However, when B(x) is the exponential distribution,
B(x) = 1 −e
−µx
, b(x) = µe
−µx
and
C(x) =
µe
−µx
dx
1 −1 + e
−µx
34
Politecnico di Torino Formulary ver. 1.1
which is independent of x.
For the M/G/1 queue, where C(x) depends on x, the process N(t), t ≥ 0 is not Marko-
vian and if we start to observe the process at an arbitrary time x, the probability that
the service completes on the interval (x, x +dx], which implies a transition of the pro-
cess N(t), is not independent of x, the time already spent in service for the customer
currently in service. If at some time t we want to summarize the complete relevent
past history of an M/G/1 queue, we must specify both:
1. N(t), number of customers present at time t
2. S
0
(t), the service time already spent by the customer in service at time t
While N(t) is not Markovian, [N(t), S
0
(t)] is a Markovian process, since it provides all
the past history necessary for describing the future evolution of an M/G/1 queue.
3.2 Solving the M/G/1 Queue
To solve the M/G/1 queue with Markov chain theory we need a trick. If we consider the
process N(t
n
) the process sampled in discrete time is better. We can sample the time
at arrival time or at departure time. If we sample at arrival time, the residual service
time is still dependent on S
0
(t) and in this case is not possible to say that Markovian
property is ensured (the next arrival is related to S
0
(t)). Else, when we sample at
departure time, if the queue is not empty the interval between two departures depends
only on service time; if the queue is empty this interval is the sum of one arrival time
and one departure time.
We recognize that N(t
n
) = q
n
is a discrete time Markov chain (DTMC), where q
n
is
the number of customers at departure time. If we write
q
n+1
= F(q
n
)
is equivalent to say that Markov property holds because all the system depends on n.
F is a function that contains stochasticity but does not depend on the past.
q
n+1
= q
n
+ arrivals − departures
If q
n
> 0 ”departures” are deterministically equal to 1.
We define θ
n
as the number of arrivals in (t
n
, t
n+1
] and we can check that θ
n
does not
depend on the past. We can write
q
n+1
= (θ
n
−1) +p
n
If we define t
n
and t
n+1
the service time of customer in n and n +1, we can rewrite θ
n
as the number of arrivals in S
n+1
and for stacasticity θ
n
is in S
n+1
is independent of
another θ
n
in another S
n
time.
Now we define θ

n
is the arrivals in S
n+1
we can write
q
n+1
= θ

n
+q
n
35
Politecnico di Torino Formulary ver. 1.1
∆q =
_
1 q
n
> 0
0 q
n
= 0
The M/G/1 works as
q
n+1
= q
n
−∆q
n

n
Now we draw the graph of M/G/1(3.1)
0 1 2 3 4 5
p
0
p
1
p
2
p
3
p
4
p
5
Figure 3.1: Graph of an M/G/1 queue
θ
n
can take any value from 0 to ∞. The probability to having k customers does not
depend on n:
p
k
= p
n
(θ = k)
If we consider that G = D, so we have an M/D/1 queue, all S
n
have the same value
p
n
(θ = k) =
e
−λx
(λx)
k
k!
Now we define N(t) as the number of customers after the departure of the n-th customer.
Service time are IID so customers that arrive are independent from the number of
customers in another service time. This can be write as
P (θ
n
= k) = P (θ = k)
Customers arrive in random window so
_

0
P (θ = k | S
n+1
= x) S(x) dx =
_

0
e
−λx
(λx)
k
k!
S(x) dx
However, this solution is too complex to do, so we try in another way.
0 1 2
p
0
p
1
p
2
p
1
p
2
p
0
n −1 n n + 1 n +j
p
1
p
2
p
0
p
j+1
36
Politecnico di Torino Formulary ver. 1.1
We now look at the flow balance equation for state 0 is:
π
1
p
0
= π
0
(1 −p
0
)
The flow balance equation for state n is:
π
n
(1 −p
1
) = π
n+1
p
0

n−1
p
2
+· · · +π
1
p
n−1

0
p
n
The loops are count twice or are not count at all.
Average
To calculate the average we start from this equation
q
n+1
= q
n
−∆q
n

n
Under ergodic condition we can write
lim
n→∞
E[q
n
] = E[q]
And we find
E[q
n+1
] = E[q
n
] −E[∆q
n
] +E[θ
n
]
Now we take the limit of this expression
E[q] = E[q] − lim
n→∞
E[∆q
n
] +E[θ
n
]
E[θ
n
] this is a constant with respect to n, because of θ
n
does not depend on n.
−P (q > 0) +E[θ
n
] = 0 ⇒P (q > 0) = E[θ
n
]
E[θ] = λE[S]
for λE[S] > 1 the system is not ergodic. Now, if we take q
n+1
= q
n
−∆q
n

n
and we
do the square and after we take the limit for n →∞ we obtain something like this
E[q] =
E
_
θ
2
¸
+E[θ] −2E[θ]
2
2(1 −E[θ])
This formula is known as Pollack and Klimchine formula.
E[θ] = λE[S]
E
_
θ
2
¸
= λ
2
E[S]
2
+λE[S]
It can be proved that the distribution if the queue size at departure time is equal to
the steady state distribution at any time.
E[q] =
λ
2
E[S]
2
+λE[S] +λE[S] + 2λ
2
E[S]
2
2(1 −λE[S])
=
λ
2
E[S]
2
+ 2λE[S] + 2λ
2
E[S]
2
2(1 −λE[S])
37
Politecnico di Torino Formulary ver. 1.1
If we put ρ = λE[S]
E[q] =
λ
2
E[S]
2
+ 2ρ −2ρ
2
2(1 −ρ)
=
λ
2
E[S]
2
+ 2ρ(1 −ρ)
2(1 −ρ)
=
λ
2
E[S]
2
2(1 −ρ)

We apply Little’s Theorem and we obtain
E[D] =
λE
_
S
2
¸
2(1 −ρ)
+E[S]
E[W] =
λE
_
S
2
¸
2(1 −ρ)
This is the average waiting time and we can see that it depends directly to the second
moment of the service time.
3.3 Average in other type of queue
• M/M/1
c
v
= 1 V ar(S) =
1
µ
2
E[S] =
1
µ
E
_
S
2
¸
=
2
µ
2
= 2E[S]
2
E[W] =
λE
_
S
2
¸
2(1 −ρ)
=
2λE[S]
2
2(1 −ρ)
=
λE[S]
2
1 −ρ
=
λ2/µ
2
1 −rho
= E[S]
ρ
1 −ρ
• M/D/1
c
v
= 0 E[S] =
1
µ
E
_
S
2
¸
= E[S]
2
= S
2
E[W] = E[S]
ρ
2(1 −ρ)
• M/G/1
c
2
v
= 10 E
_
S
2
¸
= E[S]
2
+V ar(S) = 11E[S]
2
E[W] = E[S] 11
ρ
2(1 −ρ)
38
Chapter 4
Queueing Networks
4.1 Introduction
4.1.1 Basic Definitions
In this part we consider a ”multi-node” system in which a customer requires service
at more than one node. This kind of system can be viewed as a network of nodes,
in which each node is a service center having storage room for queues to form and
perhaps with multiple servers to handle customers requests. In queueing networks we
are faced with situation in which customers departing from one service center may mix
with customers leaving a second center and the combined flow may be destined to enter
a third service center. Thus there is an interaction among the queues in the network
and this ultimately may have a complicating effect on the arrival at downstream service
center. Customer arrival times can become correlated with customer service times once
customers proceed past their point of entry into the network and this correlation can
make the mathematical analysis of these queues difficult.
4.1.2 The Departure Process - Burke’s Theorem
If we know the various properties of the variables that are associated with the service
centers, the number of servers, their service time distribution, the scheduling disci-
pline and so on, then the only item missing is the stochastic process that describes the
arrivals. This linked to the departure processes from nodes that feed the particular
service center as well as the flow of customers directly from the exterior into the center.
Consider an M/G/1 system and let A

(s), B

(s) and D

(s) denote the Laplace trans-
form of the PDFs describing the interarrival times, the service times, and the interde-
parture times, respectively. Let us calculate D

(s). When a customer depart from the
server, either another customer is available in the queue and ready to be taken into
service immediately, or the queue is empty. In the first case, the time until the next
customer departs from the server will be distributed exactly as a service time and we
have
D

(s)|
server nonempty
= B

(s)
39
Politecnico di Torino Formulary ver. 1.1
On the other hand, if the fist customer leaves an empty system behind, we must wait
for the sum of two intervals: (a) the time until the next customer arrives and (b) the
service time of this next customer. Since these intervals are independently distributed,
the transform of the sum PDF is the product of the transforms of the individual PDFs,
and we have
D

(s)|
server empty
= A

(s)B

(s) =
λ
s +λ
B

(s)
We know that the probability of a departure leaving behind an empty queue is the
same as the stationary probability of an empty system, 1 −ρ. In this way we can write
the unconditional transform for the interdeparture PDF as
D

(s) = ρB

(s) + (1 −ρ)
λ
s +λ
B

(s)
For the case of an M/M/1 queue, the Laplace transform is given by
B

(s) =
µ
s +µ
where µ is the service rate. Substituting in D

(s) we obtain
D

(s) =
λ
µ
µ
s +µ
+
_
1 −
λ
µ
_
λ
s +λ
µ
s +µ
=
λ
s +µ
+
λ
s +λ
µ
s +µ

λ
µ
λ
s +λ
µ
s +µ
=
λ(s +λ)
(s +µ)(s +λ)
+
λµ −λ
2
(s +λ)(s +µ)
=
λ(s +µ)
(s +µ)(s +λ)
=
λ
s +λ
and so the interdeparture time distribution is given by
D(t) = 1 −e
−λt
t ≥ 0
We can conclude that the interdeparture times are exponentially distributed with the
same parameters as the interarrival times. This result can be written more generally
ad Burke’s theorem:
”Consider an M/M/1, M/M/c or M/M/∞ system with arrival rate λ. Suppose that
the system is in steady state. Then the following hold true:
1. the departure process is Poisson with rate λ
2. at each time t, the number of customers in the system is independent of the
sequence of departure time prior to t ”
We know that the systems, such as M/M/1, M/M/c or M/M/∞, are the only such
FCFS queues with this property. In other words, if the departure process of and
M/G/1 or G/M/1 system is Poisson, then G=M.
40
Politecnico di Torino Formulary ver. 1.1
4.1.3 Two M/M/1 Queues in Tandem
Consider a queueing system network with Poisson arrivals and two nodes in tandem.
We assume that the service times of a customer at the first and second nodes are
mutually independent as well as independent if arrival process. We now show that , as
a result of this assumption and Burke’s theorem, the distribution of customers in the
two nodes is the same as if they were isolated independent M/M/1 queues.
The rate of Poisson arrival process is λ and the mean service times at servers 1 and 2
be 1/µ
1
and 1/µ
2
, respectively. We introduce ρ
1
=
λ
µ
1
and ρ
2
=
λ
µ
2
as the utilization
factors and we assume that ρ
1
< 1 and ρ
2
< 1. Notice that node 1 is an M/M/1 queue,
and by the Burke’s theorem, its departure process (and hence the arrival process of
node 2) is Poisson. By assumption, the service time at node 2 is independent of node
1. But node 2 behaves like an M/M/1 queue, and can analyzed independently of node
1. From our result we know:
P (n at node 1) = ρ
n
1
(1 −ρ
1
)
P (m at node 2) = ρ
m
2
(1 −ρ
2
)
From the Burke’s theorem, it follows that the number of customers present in node 1
is independent of the sequence of earlier arrivals at node 2. Consequently, it must be
independent of the number of customer present in node 2. This implies that
P (n at node 1 ANDm at node 2) = P (n at node 1)· P (m at node 2) = ρ
n
1
(1−ρ
1
)· ρ
m
2
(1−ρ
2
)
Thus, under steady state conditions, the number of customers at node 1 and node 2 at any
given time are independent and joint distribution of customers in the tandem queueing system
has a product form solution.
4.2 Open Queueing Networks
4.2.1 Feedforward Networks
We have a feedforward network when the input to each node in the network is Poisson. Indeed,
since the aggregation of mutually independent Poisson processes is a Poisson process, the input
of the nodes that are fed by combined output of other nodes in Poisson. Likewise, since the
decomposition of a Poisson process yields multiple Poisson processes, a single node can provide
Poisson input to multiple downstream nodes. Feedforward networks do not permit feedback
paths since this may destroy Poisson nature of the feedback stream.
4.2.2 Jackson Networks
The work of Jackson shows that, even in presence of feedback loops, the individual nodes
behaves as if they were fed by Poisson arrivals, when in fact they are not. We consider now
the Jackson network. Take an open network consisting of M nodes, where there is at least one
node to which customers arrive from external source and there is at least one node from which
customers depart from the system. This network is a Jackson network if the following are true
for i, j = 1, 2, · · · , M:
41
Politecnico di Torino Formulary ver. 1.1
• node i consists of an infinite FCFS queue and c
i
exponential servers, each with parameter
µ
i
• external arrivals to node i are Poisson with rate γ
i
• after completing service at node i, a customer will proceed to node j with probability r
ij
independent of past history or will depart from the system, never to return again, with
probability 1 −

M
j=1
r
ij
The service centers in this network may be load dependent, meaning that the rate at which
customers depart from service can be a function of the number of customers present in the
node. The total average arrival rate of customers to service center is i by λ
i
; this is given by
the sum of the arrivals from outside the system plus arrivals from all internal service centers.
And we obtains the following equation:
λ
i
= γ
i
+
M

j=1
λ
i
r
ij
i = 1, 2, · · · , M
In steady state we also have a traffic equation for the network as a whole:
M

i=1
γ
i
= γ =
M

i=1
λ
i
_
_
1 −
M

j=1
r
ij
_
_
This states that, at equilibrium, the total rate at which customers arrive into the queueing
network from the outside γ must be equal to the rate which the leave the network.
A Jackson network may be viewed as a continuous-time Markov chain with state descriptor
vector k = (k
1
, k
2
, · · · , k
M
) in which k
i
denotes the number of customers at service center i. At
a given state k, the possible successor states correspond to a single customer arrival from the
exterior, a departure from the network or a movement of a customer from one node to another.
The transition from state k to state k(i
+
) = (k
1
, · · · , k
i−1
, k
i
+ 1, k
i+1
, · · · , k
M
) correspond to
an external arrival to node i and has transition rate γ
i
. The transition from state k to state
k(i

) = (k
1
, · · · , k
i−1
, k
i
− 1, k
i+1
, · · · , k
M
) corresponds to a departure from center i to the
exterior and has transition rate µ
i
(k
i
)(1 −

M
j=1
r
ij
). Finally, the transition from state k to
state k(i
+
, j

) = (k
1
, · · · , k
i−1
, k
i
+ 1, k
i+1
, · · · , k
j−1
, k
j
− 1, k
j+1
, · · · , k
M
) corresponds to a
customer moving from node j to node i and has transition rate µ
j
(k
j
)r
ij
. Let
P(k) = P(k
1
, k
2
, · · · , k
M
)
denote the stationary distribution of the Markov chain (P(k) is the equilibrium probability
associated with state k). We denote the marginal distribution of finding k
i
customers in node
i by P
i
(k
i
).
Jackson’s theorem provide the steady state joint distribution for the states of the network.
Jackson Theorem: ”For a Jackson network with effective arrival rate λ
i
to node i, and assuming
that λ
i
< c
i
µ
i
for all i, the following are true in steady state:
1. node i behaves stochastically as if it were subjected to Poisson arrival with rate λ
i
2. the number of customers at any node is independently of the number of customers at
every other node ”
Jackson’s theorem shows that the joint distribution for all nodes factors into the product of
the marginal distribution, that is P(k) = P
1
(k
1
)P
2
(k
2
) · · · P
M
(k
M
), where P
i
(k
i
) is given as a
42
Politecnico di Torino Formulary ver. 1.1
solution to the classical M/M/1-type queue. It is an example of a product-form solution. In
special case when all the service centers contain a single exponential server, the expression of
P(k) becomes:
P(k) =
M

i=1
(1 −ρ
i

k
i
i
ρ
i
=
λ
i
µ
i
The stability condition for a Jackson network is
ρ
i
=
λ
i
c
i
µ
i
< 1 i = 1, 2, · · · , M
To solve a Jackson network we need to solve the traffic equations to obtain the effective arrival
rate at each node. Each node is then solved in isolation and the global solution formed from
the product of the individual solutions.
Mean Number of Customers
The mean number of customer in node i, E[N
i
], is that of an isolated M/M/1 queue with arrival
rate λ
i
; this is given by:
E[N
i
] =
ρ
i
1 −ρ
i
i = 1, 2, · · · , M
It follows that the total mean number of customers in the network is given by:
E[N] =
M

i=1
ρ
i
1 −ρ
i
Mean Time Spent in Network
The average waiting time is related to the average time that a customer spends in the network,
and this can be found by applying Little’s Theorem:
E[W] =
E[N]
γ
γ =
M

i=1
γ
i
γ is the total arrival rate. The average time that a customer spends at node i, during each visit
to node i, is given by:
E[W
i
] =
E[N
i
]
λ
i
=
1
µ
i
(1 −ρ
i
)
In this case we have that W = W
1
+W
2
+· · · +W
M
. The average time that a customer spends
queueing prior to service on a visit to node i is:
E
_
W
Q
i
_
= E[W
i
] −
1
µ
i
=
ρ
i
µ
i
(1 −ρ
i
)
Throughput
The throughput of a singe node is the rate al which customers leave that node. The throughput
od node i is:
X
i
=

k=1
P
i
(k)µ
i
(k)
43
Politecnico di Torino Formulary ver. 1.1
where µ
i
(k) is the load-dependent service rate.The throughput of the entire open queueing
network is the rate ant which customers leave the network. If customers are not lost to the
network, nor combined nor split in any way, then at steady state, the throughput of the network
is equal to the rate at which customers enter the network.
4.3 Closed Queueing Networks
If Jackson network is a closed queueing network it is called Gordon and Newell network.
Consider a closed single-class queueing network composed of M nodes. Let n
i
be the number of
customers at node i. Then the total customer population is given by N = n
1
+n
2
+· · · +n
M
.
A state of the network is defined as n = (n
1
, n
2
, · · · , n
M
) with n
i
≥ 0 and

M
i=1
n
i
= N. The
queueing discipline at each node is FCFS and the service the distributions are exponential. Let
µ
i
be the mean service rate at node i. When the service rate is load dependent, we shall denote
the service rate by µ
i
(k). Let p
ij
be the fraction of departures from node i that go next to
node j and let λ
i
be the overall arrival rate to node i. Since the rate if departure is equal to
the rate of arrival, when the network is in steady state, we can write
λ
i
=
M

j=1
λ
j
p
ij
i = 1, 2, · · · , M
Now we introduce the visit ratio at node i, ν
i
. This gives the mean number of visits to node
i relative to a specified node, in our case we consider the node 1. So, ν
1
= 1 and ν
i
is the
mean number of visits to node i between two consecutive visits to node 1. Notice that ν
i
may
be greater (or smaller) than 1. If X
i
(N) is the throughput of node i in a closed network with
N customers, then we must have ν
i
= X
i
(N)/X
1
(N). At steady state the rate of arrival to a
node is equal to the rate of departure so that ν
i
= λ
i

1
which means that ν
i
uniquely satisfy
the system equation
ν
1
= 1 and ν
i
=

M
j=1
ν
j
p
ij
i = 1, 2, · · · , M
The major result for this closed network is that the equilibrium distribution is given by the
product form
P (n) = P (n
1
, n
2
, . . . , n
M
) =
1
G(N)
M

i=1
f
i
(n
i
)
where
f
i
(n
i
) =
ν
n
i
i

n
i
k=1
µ
i
(k)
if the node i is load dependent
f
i
(n
i
) =
_
ν
i
µ
i
_
n
i
= Y
n
i
i
if node i is load dependent
The constant G(N) is called the normalization constant. It ensures that the sum of the prob-
abilities is equal to one.
44
Part II
Exercises
45
Chapter 5
Preliminary Exercises
Exercise 1
Text
Compute the probability density function for the smallest among κ independent random vari-
ables, all distributed accordingly to a exponential probability density function with the same
parameter λ.
Solution
X
i
∼ Exp(λ) ∀ i = 1, . . . , κ
Moreover, X
i
are IID. The minimum will be given by:
Y = min{X
i
}
Therefore the probability density function f
y
(y) is the objective of the problem.
F
y
(y) = P (Y ≤ y) = P (min{X
i
} ≤ y)
But it is more easy to compute:
F
y
(y) = 1 −F
y
(y) = 1 −P (Y ≤ y) = P (Y ≥ y)
Indeed:
P (Y ≥ y) = P (min{X
i
} ≥ y) = P (X
1
> y , X
2
> y , . . . , X
κ
> y)
since they are all IID, it is possible write:
P (X
1
> y) · P (X
2
> y) · . . . · P (X
κ
> y) = [P (X > y)]
κ
= [e
−λy
]
κ
= e
−λκy
Now, given that F
y
(y) is obtained, to compute f
y
(y) it is possible use:
f
y
(y) =
dF
y
(y)
dy
f
y
(y) = −
dF
y
(y)
dy
Therefore:
f
y
(y) = −[−λκ · e
−λκy
] = λκ · e
−λκy
46
Politecnico di Torino Formulary ver. 1.1
It is simply f
x
(x) = λe
−λx
where λ = λκ, in conclusion:
Y ∼ Exp(λκ)

Exercise 2
Text
A barber opens his shop at time t
0
= 0. Customers arrive at shop randomly, accordingly to a
Poisson process, i.e., the probability density function of the time between two customers arrive
is:
a(t) = λe
−λt
· u(t)
Each air cut requires X seconds, where such X is a random variable.
Find the probability, P, that the second arrive customer does not have to wait and his
average waiting time W in the following cases:
. X is a constant: X = c;
. X is uniformly distributed among 0 and 2c: X ∼ U(0 , 2c).
Solution
Case 1: the customer does not wait - X = c
Consider:
t
t
0
t
a
1
t
d
1
X
where:
. t
a
1
is the arrival time of the first customer;
. t
d
1
is the departure time of the first customer;
. the orange line represent possible arrival times for the second customer.
Therefore:
P
_
2

customer does not have to wait
_
= P (t
a
2
> t
d
1
)
and:
t
d
1
= t
a
1
+X =⇒ t
d
1
= t
a
1
+c
In conclusion:
P (t
a
2
> t
d
1
) = P (t
a
2
> t
a
1
+c) = P (t
a
2
−t
a
1
> c)
but:
t
a
2
−t
a
1
∼ Exp(λ) =⇒ P (t
a
2
−t
a
1
> c) = e
−λc
47
Politecnico di Torino Formulary ver. 1.1
Case 2: the customer has to wait - X = c
Consider W the waiting time of the second customer; the average is:
E[W] =
_
0 t
a
2
> t
d
1
t
a
2
−t
d
1
otherwise
Since:
t
a
2
−t
d
1
=⇒ t
a
2
−t
a
1
+c =⇒ c −(t
a
2
−t
a
1
) if t
a
2
−t
a
1
< c
and t
a
2
−t
a
1
∼ Exp(λ). Thus:
E[W] =
_
0 t
a
2
> t
d
1
c −(t
a
2
−t
a
1
) otherwise
Let y = (t
a
2
−t
a
1
):
E[W] =
_
0 t
a
2
> t
d
1
c −y otherwise
The average waiting time of the second customer is:
E[c −y | y < c]
this can be computed as:
_
c
0
(c −y)f
y
(y) dy =
_
c
0
(c −y)λe
−λy
dy

By solving this integral:
c ·
_
c
0
λe
−λy
dy −
_
c
0
y · λe
−λy
dy =
c ·
_
−e
−λy
¸
¸
c
0
_

_
−y · e
−λy
¸
¸
c
0
+
_
c
0
e
−λy
dy
_
=
c · (1 −e
−λc
) −
_
−c · e
−λc
+
e
−λy
−λ
¸
¸
¸
¸
c
0
_
=
c · (1 −e
−λc
) +c · e
−λc
+
e
−λy
λ

1
λ
= c +
e
−λy
λ

1
λ
Case 3: the customer does not wait - X ∼ U(0 , 2c)
In this case:
t
d
1
= t
a
1
+X
and:
P
_
2

customer does not have to wait
_
= P (t
a
2
> t
d
1
) = P (t
a
2
> t
a
1
+X)
It can be written as:
_
2c
0
P (t
a
2
−t
a
1
> X) · f
x
(x) dx =
_
2c
0
e
−λx
·
1
2c
dx

This is solved by parts, where f = y and g

= λe
−λy
48
Politecnico di Torino Formulary ver. 1.1
This integral is solvable in such a way:
1
2c
·
_
2c
0
e
−λx
dx =
1
2c
·
e
−λx
−λ
¸
¸
¸
¸
2c
0
=
1
2c
·
e
−2λc
−1
−λ
= −
1
2λc
· e
−2λc
Case 4: the customer has to wait - X ∼ U(0 , 2c)
In this case we have not to compute:
E[c −y | y < c]
but, since:
t
a
2
−t
d
1
=⇒ t
a
2
−t
a
1
+X =⇒ t
a
2
< t
a
1
+X
therefore:
E[W] = E[X −Y | Y < x] = E[E[X −Y | Y < X , X = x]]
x
that can be solved by:
_
2c
0
__
x
0
(X −Y )f
y
(y) dy
_
· f
x
(x) dx =
_
2c
0
_
x +
e
−λx
λ

1
λ
_
·
1
2c
dx =
=
1
2c
·
_
4c
2
2

e
−2λc
λ
2

2c
λ
+
1
λ
2
_

Exercise 3
Text
Passengers arrive randomly at the bus stop. The random process describing passengers arrivals
is Poisson with rate λ = 1 arrival per minute. Also departures follows a Poisson random process,
independent from the customer arrival process, with rate µ = 2 buses per hour.
Assuming that passengers take always the first stopping bus and buses can carry an arbitrary
number of passengers, compute:
1. the average number of passengers that take the same bus;
2. the average number of passengers on the first bus departing after 9 am.
Solution
Task 1
Let N be the number of passengers in the same bus; the problem requests E[N]. Let X be
inter arrival time of buses:
X ∼ Exp(µ)
The process that counts the number of passengers arriving during X is N(x) and it is a Poisson
process with rate λ · X:
N(x) ∼ Poisson(λX)
49
Politecnico di Torino Formulary ver. 1.1
Therefore:
E[N] = E[E[N(x) | X]] = E[λX] = λ · E[X] = λ ·
1
µ
Since λ describe arrivals per minute, it is equivalent say:
1 arrival per minute = 60 arrivals per hour
In conclusion:
E[N] = 60 ·
1
2
= 30
Task 2
The situation to take care is:
t
0 bus 9 bus
x
2
x
1
where each random variable is exponentially distributed:
x
1
∼ Exp(µ)
x
2
∼ Exp(µ)
The average number of passengers that take the bus after 9, thanks to memoryless property, is
given by:
E[N] = E[E[N(x
1
) | x
1
]] +E[E[N(x
2
) | x
2
]] = 2 · E[E[N(x) | x]] = 2 ·
λ
µ
= 60

50
Chapter 6
Exercises on Queues
Exercise 1
Text
In a M/M/m system, arrivals are distributed according to a Poisson process and service time
are exponentially distributed with rate µ. The queue is served in FIFO and, at time t
0
= 0,
customer A arrives finding m people into the m servers and n people in the queue. After t
0
nobody arrives more.
Find:
1. the average time in which A starts being in service (waiting time);
2. the time in which the system will be empty.
3. Let X be κ if A is the κ-th customer leaving the system after t
0
. Find P (X = κ).
4. the probability that A ends his service before his predecessor B.
5. Let ˜ ω be the amount of time spent by A waiting to be in service. Find P (˜ ω > x).
Solution
Task 1
The average waiting time is:
E[W
A
]
It happen after n + 1 departures of customer in the queue. Since there are m servers, the
inter departure time is distributed accorded to Exp(mµ) because all of them are distributed
as Exp(µ). Therefore, the waiting time of A is the sum of inter departure times (T
d
) of n + 1
customers.
E[W
A
] =
n+1

i=1
E[T
d
i
]
Since all T
d
i
are IID:
E[W
A
] = (n + 1) · E[T
d
i
] = (n + 1) ·
1

=
n + 1

51
Politecnico di Torino Formulary ver. 1.1
Task 2
The time in which the system is empty is the time in which n + 1 + m departures will take
place. The distribution is not, as before, Exp(mµ) because, in some moments, it is possible
that not all servers are busy. Representing the situation with a Markov Chain:
0 1 2
m · · · m+ 1 m+ 2
λ
µ
λ

λ

λ

Therefore:
E[T
empty
] =
n + 1

+
1

+
1
(m−1)µ
+
1
(m−2)µ
+· · · +
1
µ
=
=
n + 1

+
m−1

i=0
1
(m−i)µ
Task 3
If κ = 1, A is the first customer leaving the system: it could not be possible since the discipline
is FIFO. Therefore:
P (X = 1) = 0
At least, A could leave the system after n + 1 customers: it means that people in the queue is
all in service into the m servers and A is the one that has the service time smaller.
Therefore:
P (X = κ) =
_
0 1 ≤ κ ≤ n + 1
− n + 1 < κ ≤ n + 1 +m
Indeed that probability is different than 0 in two cases:
. if all customers are served and A is the last one (m− 1 servers are idle and 1 busy, the
one that is serving A);
. if there are some customers in service and A is one of them (m servers, potentially, are
busy: actually they can be less than m, but surely more than 1).
In the first case we have to compute:
P (X = n + 2)

= P (A is the first leaving) =
1
m
since all servers are independent.
In the second case, instead, the probability that have to be compute is:
P (X = n + 3) = P (Ais not the first leaving) ·
· P (A is the second leaving | Ais not the first) =
=
_
1 −
1
m
_
·
1
(m−1)
=
1
m

The term n + 2 means that A is the first of the remaining m customers in queue.
52
Politecnico di Torino Formulary ver. 1.1
The probability that A is the second leaving given that is not the first, means that there
are m−1 servers to consider and each one is independent from the others. It is the same of the
previous case because servers are IID and the distribution is exponential, so the memoryless
property holds.
In conclusion:
P (X = κ) =
_
_
_
0 1 ≤ κ ≤ n + 1
1
m
n + 1 < κ ≤ n + 1 +m
Task 4
The probability that A ends his service before B given that the service time of B is greater
than the service time of A is:
P (A leaves before B| T
d
B > W
A
) =
1
2
because once they are both in service they have the same probability of end their service one
before the other.
Actually, the probability that A leaves before B is:
P (T
d
B > W
A
) · P (A leaves before B| T
d
B > W
A
)
where P (T
d
B > W
A
) is just given by the probability that m− 1 customer are still in service.
Therefore:
P (T
d
B > W
A
) =
m−1
m
Globally:
P (A leaves before B) =
1
2
·
m−1
m
Task 5
Given that ˜ ω is the waiting time of A, the probability:
P (˜ ω = x)
is simply the distribution. Therefore:
P (˜ ω = x) =
n+1

i=0
x
i
where x
i
∼ Exp(mµ). It means that:
n+1

i=0
x
i
=
n+1

i=1
e
−mµx
·
(mµx)
i
i!
This term is the Erlang(n + 1, mµ).

53
Politecnico di Torino Formulary ver. 1.1
Exercise 2
Text
Consider a M/M/1 system with arrival rate λ and departure rate µ. Knowing that customers
arrives always in pair, draw the transition diagram and write the flow balance equations.
Solution
The transition diagram is:
0 1 2 3 4
λ
µ
λ
µ
λ
µ
λ
µ
For a given node i, with i ≥ 2, flows balance equations are:

i−2
· λ) + (π
i+1
· µ)

= (µ +λ) · π
i

Considering i = 1:
µ · π
2
= (λ +µ) · π
1
While, for i = 0:
µ · π
1
= λ · π
0
Globally:
_
¸
_
¸
_
µ · π
i+1
= λ · π
i
i = 0
µ · π
i+1
= (λ +µ) · π
i
i = 1

i−2
· λ) + (π
i+1
· µ) = (µ +λ) · π
i
i ≥ 2

Exercise 3
Text
Consider a system in which the departure rate is µ and the arrival rate is
˜
λ, where:
˜
λ =
_
2 · λ when there are no customers in the system
λ otherwise
Find:
1. the transition diagram;
2. the balance equations, the steady state distribution and discuss the ergodicity;
3. the average number of customers in the system;
4. the average time spent by customers in the system;
5. the average waiting time spent before being served.

This is the incoming flow.

This is the outgoing flow.
54
Politecnico di Torino Formulary ver. 1.1
Solution
Task 1
The transition diagram is:
0 1 2
2 · λ
µ
λ
µ
λ
µ
Task 2
Considering i = 0:
λ · π
i
= µ · π
i+1
=⇒ π
i+1
=
λ
µ
· π
i
while for i = 0:
2λ · π
0
= µ · π
1
Therefore:
_
λ · π
i
= µ · π
i+1
i = 0
2λ · π
i
= µ · π
i+1
i = 0
where each π
i
is the stationary distribution. Replacing i + 1 with j:
π
j
=
λ
µ
· π
j−1
but it is possible substitute π
j−1
with his expression obtaining:
π
j
=
λ
µ
·
_
λ
µ
· π
j−2
_
Iterating, the last term will be:
π
j
= 2 ·
_
λ
µ
_
j
· π
0
This holds for each j. In order to be a distribution, the sum of all π
j
is forced to be equal to
one, therefore the two equations that represent the steady state distribution are:
π
j
= 2 ·
_
λ
µ
_
j
· π
0
(6.1)
n

j=0
π
j
= 1 (6.2)
Substituting (6.1) in (6.2):
n

j=0
_
λ
µ
_
j
· π
0
= 1
55
Politecnico di Torino Formulary ver. 1.1
It is possible rewrite the expression in:
n

j=1
2 ·
_
λ
µ
_
j
· π
0

0
= 1

π
0
·
_
_
2 ·
n

j=1
_
λ
µ
_
j
· 1 + 1
_
_
= 1 (6.3)
Let:
ρ =
λ
µ
So the sum:
n

j=1
ρ
j
converge if ρ < 1: under this hypothesis the system is ergodic. Assuming k = j −1:
n

k=0
ρ
k+1
=⇒ ρ ·
n

k=0
ρ
k
and the last term is the geometric sum, therefore:
n

j=1
ρ
j
= ρ ·
1
1 −ρ
Substituting in (6.3):
π
0
·
_
2 · ρ ·
1
1 −ρ
+ 1
_
= 1 =⇒ π
0
=
1
2·ρ
1−ρ
+ 1
=⇒ =
1 −ρ
1 +ρ
In conclusion:
_
¸
¸
_
¸
¸
_
π
i
= 2 ·
_
λ
µ
_
i
·
1 −ρ
1 +ρ
π
0
=
1 −ρ
1 +ρ
The initial π
0
, in terms of λ and µ, is:
π
0
=
1 −ρ
1 +ρ
=
µ −λ
µ +λ
(6.4)
Task 3
The average number of customer in the system is given by:
E[N] =

i=0
i · π
i
=

i=1
i · π
i
56
Politecnico di Torino Formulary ver. 1.1
since the term with i = 0 is null. Substituting the value of π
i
:
E[N] =

i=1
i ·
_
2 ·
_
λ
µ
_
i
·
1 −ρ
1 +ρ
_
Let:
ρ =
_
λ
µ
_
Therefore:
E[N] = 2 ·
1 −ρ
1 +ρ
·

i=1
i · ρ
i
(6.5)
The sum:

i=1
i · ρ
i
is the derivative of the geometric series, so:

i=1
i · ρ
i
= ρ ·

i=1
i · ρ
i−1
=⇒ ρ ·
_
d
dx
_

i=0
i · x
i
__
x=ρ
Since:

i=0
i · x
i
=
1
1 −x
the result is:
ρ ·
_
d
dx
_
1
1 −x
__
x=ρ
= ρ ·
_
d
dx
_
1
(1 −x)
2
__
x=ρ
=
ρ
(1 −ρ)
2
Substituting this value in (6.5):
E[N] = 2 ·
1 −ρ
1 +ρ
·
ρ
(1 −ρ)
2
=
2 · ρ
(1 +ρ) · (1 −ρ)
=

(1 −ρ
2
)
Task 4
The average time spent by customers in the system is given, using the Little Theorem, by:
E[T] =
E[N]
E[λ]
The value E[N] is just the average number of customer in the system computed in task 3, while
E[λ] is the expected value of arrival rate. It can be calculated as:
E[λ] = 2λ · π
0
+

i=1
λ · π
i
= 2λ · π
0
+λ ·

i=1
π
i
It can be re-written, by putting the common term λ into the sum, as:
2λ · π
0
+λ ·

i=1
π
i
= λ · π
0
+λ ·

i=0
π
i
57
Politecnico di Torino Formulary ver. 1.1
Since the distribution is stationary:

i=0
π
i
= 1
Therefore:
E[λ] = λ · π
0
+λ = λ · (π
0
+ 1)
Substituting the value of π
0
given by (6.4):
E[λ] = λ ·
_
1 −ρ
1 +ρ
+ 1
_
= λ ·
_
1 −ρ + 1 +ρ
1 +ρ
_
=

1 +ρ
Expressed in terms of λ and µ:
E[λ] =

1 +ρ
=
2λµ
µ +λ
Since:
E[T] =
E[N]
E[λ]
the result is:
E[T] =
_

(1 −ρ
2
)
_
÷
_
2λµ
µ +λ
_
=
ρ · (µ +λ)
λµ(1 −ρ
2
)
Task 5
The average waiting time spent before being served is E[W]: it is a part of the cumulative time
spent in the system. Indeed:
E[T] = E[W +T
s
]
where T
s
is the service time. Due to independence:
E[T] = E[W +T
s
] = E[W] +E[T
s
]
Therefore:
E[W] = E[T] −E[T
s
]
Since departures are exponentially distributed:
E[T
s
] =
1
µ
In conclusion:
E[W] = E[T] −E[T
s
] =
ρ · (µ +λ)
λµ(1 −ρ
2
)

1
µ

Exercise 4
Text
Consider a system in which the departure rate is µ and the arrival rate is λκ, where:
λκ =
λ
κ + 1
Find:
58
Politecnico di Torino Formulary ver. 1.1
1. the transition diagram;
2. the steady state distribution and discuss the ergodicity;
3. the average number of customers in the system;
4. the average time spent by customers in the system.
Solution
Task 1
The transition diagram is:
0 1 2
λ
µ
λ/2
µ
λ/3
µ
Task 2
For a given node i, the transition diagram is:
i i + 1
λ/i + 1
µ
therefore:
λ
i + 1
· π
i
= µ · π
i+1
=⇒ π
i+1
=
1
i + 1
·
λ
µ
· π
i
Replacing the value of π
i
:
π
i+1
=
1
i + 1
·
λ
µ
· π
i
=⇒ π
i+1
=
1
i + 1
·
λ
µ
·
_
1
i
·
λ
µ
· π
i−1
_
In general:
π
i+1
=
1
(i + 1)!
·
_
λ
µ
_
i+1
· π
0
Imposing that the sum of π
i
must be equal to one:
_
¸
_
¸
_
π
i+1
=
1
(i + 1)!
·
_
λ
µ
_
i+1
· π
0


i=0
π
i
= 1
Therefore:

i=0
1
i!
·
_
λ
µ
_
i
· π
0
= 1
59
Politecnico di Torino Formulary ver. 1.1
where:
π
0
=
1


i=0
1
i!
·
_
λ
µ
_
i
Let:
ρ =
_
λ
µ
_
The sum becomes:

i=0
ρ
i
i!
· π
0
It converges always because is the exponential series: the system is ergodic ∀ρ. In conclusion:
_
¸
_
¸
_
π
i
=
1
(i)!
·
_
λ
µ
_
i
· e
−λ/µ
=
1
(i)!
· ρ
i
· e
−ρ
π
0
= e
−rho
Task 3
The average number of customer is given by:
E[N] =

i=0
i · π
i
=

i=0
i ·
1
(i)!
· ρ
i
· e
−ρ
It can be re-written as:

i=0
i ·
1
(i)!
· ρ
i
· e
−ρ
= e
−ρ
·

i=0
1
(i −1)!
· ρ
i
= e
−ρ
· ρ ·

i=1
1
(i −1)!
· ρ
i−1
Imposing j = i −1:
e
−ρ
· ρ ·

i=1
1
(i −1)!
· ρ
i−1
= e
−ρ
· ρ ·

j=0
1
(j)!
· ρ
j
= e
−ρ
· ρ · e
ρ
= ρ
Task 4
The average time spent by customer in the system is given, applying the Little Theorem, by:
E[T] =
E[N]
E[λ]
The value of E[λ] is unknown:
E[λ] =

κ=0
λ
κ + 1
· π
κ
=

κ=0
λ
κ + 1
·
_
1
(κ)!
· ρ
κ
· e
−ρ
_
It becomes:
λ · e
−ρ
·

κ=0
1
(κ + 1)!
· ρ
κ
= λ ·
e
−ρ
ρ
·

κ=0
1
(κ + 1)!
· ρ
κ+1
60
Politecnico di Torino Formulary ver. 1.1
Imposing j = κ + 1 the sum becomes:

κ=0
1
(κ + 1)!
· ρ
κ+1
=

j=1
1
(j)!
· ρ
j
= e
ρ
−1
Therefore:
E[λ] = λ ·
e
−ρ
ρ
· [e
ρ
−1]

Exercise 5
Text
Consider a M/M/1 queue in which service times are exponentially distributed with parameter
µ and customers arrive according to a Poisson process with rate λ. The server is lazy: after
each service, the server takes a rest, during which possibly waiting customers can not be served.
Rest times are exponentially distributed with parameter α. At the end of the rest time, the
server becomes available to serve waiting customers. If no customers are waiting after the rest,
the server waits for the first customer arrival and starts to serve him immediately upont his
arrival.
Draw the transition diagram.
Solution
To identify an arbitrary state of the chain, two descriptors are needed:
. one describing the number of customers in the line;
. one describing the state of the server:
. A if the server is active and can serve a customer;
. R if the server is taking a rest.
The diagram takes care of a population up to 2 customers:
0-A 1-A 2-A
0-R 1-R 2-R
λ
µ
α
λ
µ
α
λ λ
α

61
Politecnico di Torino Formulary ver. 1.1
Exercise 6
Text
Consider a taxi station with 5 parking positions. Taxis arrive to the station according to a
Poisson process with rate µ = 2 taxis per minute. The process describing customer arrivals to
the station is independent and Poisson with rate λ = 1 customer per minute. An arriving taxi
can carry only one customer. When no customer are waiting the arriving taxi can use one free
position, if any. If no parking position is available and no customers are waiting, the taxi leaves
the station empty.
1. Model the system with a Markov with a suitable state definition.
2. Find the probability of having n customers.
3. Find the average number of waiting customers.
4. Find the average number of waiting taxis.
Solution
Task 1
By using:
. N
t
: label describing the number of taxis available;
. N
c
: label describing the number of customers;
is possible describe the system in a reliable way. Each state is composed in such a way:
N
t
-N
c
Therefore, the resultant Markov Chain is:
62
Politecnico di Torino Formulary ver. 1.1
0-0
1-0
2-0
3-0
4-0
5-0
0-1 0-2 0-3
λ
µ
λ
µ
λ
µ
µ
λ
µ
λ
µ
λ
µ
λ
µ
λ
Notice that it is not possible have taxis and customers waiting at the same time and the number
of customers can be any value, while the number of taxis is bounded (up to 5). When a customer
arrives (rate λ) and finds a free taxi (the branch going down of the chain) is immediately served,
while if the does not finds free taxis (the branch going right of the chain) he has to wait. This
kind of queue is and M/M/1 queue, where states can be identify by a label:
κ = 5 −N
t
+N
c
This order, labels states starting from the bottom to the top.
Having in mind this:
π
κ
= (1 −ρ) · ρ
κ
ρ =
λ
µ
Using i to label customers arrives and j for taxis, an equivalent notation is:
π
0 , i
= (1 −ρ) · ρ
(i+5)
π
j , 0
= (1 −ρ) · ρ
(j−5)
Task 2
The probability of having exactly n customers in the queue happens only if all taxis are already
busy, therefore the state of the queue to be considered is:
63
Politecnico di Torino Formulary ver. 1.1
0-n
This implies:
π
0 , n
= (1 −ρ) · ρ
(n+5)
Task 3
The average number of waiting customers can be computed as:
E[N
c
] =

κ=6
(κ −5) · π
κ
or, in an equivalent way:
E[N
c
] =

i=0
i · π
i
Task 4
The waiting number of taxis, instead, is:
E[N
t
] =
5

κ=0
(5 −κ) · π
κ
or:
E[N
c
] =
5

j=0
j · π
j

Exercise 7
Text
Consider a doctor shop with two waiting rooms: the first one has B − 1 seats (i.e. up to B
patients can be seated including the one being seen by the doctor), while the second can contain
any number (up to infinite) of standing customers. Assume that the arrival process is Poisson
with rate λ and that service times are exponentially distributed according to rate µ. Find:
1. the transition diagram and draw it;
2. the average number of seated customers;
3. the average number of standing customers.
64
Politecnico di Torino Formulary ver. 1.1
Solution
Task 1
The transition state diagram for this exercise is very simple:
0 1 2 B −1 · · ·
B B + 2
λ
µ
λ
µ
λ
µ
λ
µ
As usual:
π
κ
= (1 −ρ) · ρ
κ
ρ =
λ
µ
λ < µ
Task 2
If there are B customers all of them are seated, while if they are more, N, B are seated and
N −B are upright.
E[N
seat
] =
B

i=1
i · π
i
+B ·

i=B+1
π
i
Task 3
The average number of standing customers is:
E[N
upright
] =

i=B+1
(i · B) · π
i

Exercise 8
Text
Consider the following system:
λ
µ
µ
65
Politecnico di Torino Formulary ver. 1.1
Assume that arrivals are distributed to a Poisson process of rate λ and, when they arrive, they
select the shortest line; if a customer arrives and finds the two queues with the same number
of waiting customers, he has to select his own waiting line randomly. Departures takes always
place with average 1/µ.
When a customer ends his service, other waiting customers can move from a queue to the
other one in order to improve their service. Movements occurs in zero time and are simultaneous
to departures and just customers at the end of queue can move.
The system has global capacity equal to 6.
Find:
1. the transition diagram and draw it;
2. similarities with well-known systems.
Solution
Task 1
The transition state diagram, using as descriptors the number of customers into the different
queues, is:
0 , 0
1 , 0 0 , 1
1 , 1
2 , 1 1 , 2
2 , 2
3 , 2 2 , 3
3 , 3
λ/2
µ λ/2
µ
λ
µ
λ
µ
λ/2
µ λ/2
µ
λ
µ
λ
µ
λ/2
µ λ/2
µ
λ
µ
λ
µ
Since there are two queues the global departure rate is 2µ (therefore a customer leaves from
a single queue with rate µ), but arrival rates in the graph are different; this difference is based
on the current state of the system:
66
Politecnico di Torino Formulary ver. 1.1
. if the number of customers is equal in both queues, a new one enters with rate λ/2
because it can choose the queue in which it will wait;
. if the number of customers in queues are different, a new one is forced to enter in the
queue with less occupancy with rate λ.
Task 2
If there are no distinctions among queues the system behaves like a M/M/2/4 queue:
. 2 because the waiting line is composed by two servers;
. 4 because the global capacity is 6 element: since 2 can be in service, just other 4 customers
can be accommodated.
0 1 2 3 4 5 6
λ

λ

λ

λ

λ

λ

This chain has been obtained by aggregating intermediate states of the previous graph.
Exercise 9
Text
Consider a single server queuing system with service rate equal to µ customers per second with
a FIFO waiting line of limited capacity: at most 3 customers, included the one in service, can
be accepted. Customers arrive in groups and both inter arrival times and service times are
exponentially distributed. The arriving group enters in the system only if all customers can be
accepted otherwise the entire group is lost.
Find the transition diagram and the dropping probability for the following distributions of
customers:
. groups of one customers with rate 2λ;
. groups of two customers with group arrival rate λ;
. groups comprising, with the same probability, one, two or three customers; the group
arrival rate is λ.
Solution
First scenario
In the first case customers arrive one after the others as in an M/M/1/2 system; the transition
diagram is, therefore:
0 1 2 3

µ

µ

µ
67
Politecnico di Torino Formulary ver. 1.1
Since PASTA holds, the dropping probability is that the system reaches state 3:
P (loss) = π
3
For this system is also easy to compute the average delay expected, the throughput of incoming
and outgoing customers; indeed:
E[D] =
ρ
2λ · (1 −ρ)
=
1/µ
(1 −ρ)
because here:
ρ =

µ
The incoming throughput is defined as:
T
h
in
= λ · [1 −P (loss)]
therefore, in this case:
T
h
in
= 2λ · (1 −π
3
)
The outgoing throughput is:
T
h
out
= µ · (1 −π
0
)
Second scenario
For the second scenario, the transition diagram is:
0 1 2 3
λ
µ
λ
µ µ
The state 2 is a state for which a further arrival can not be accommodated because there is not
more rooms. In this case, therefore, the dropping probability is given by:
P (loss) = π
2

3
It is possible conclude that batch arrivals lead to more burstiness, increasing the dropping
probability and, consequently, reduce the throughput. In this scenario PASTA still hold.
Third scenario
The third case is the most complicated one; the transition diagram is:
0 1 2 3
λ
/
3
λ
/
3
λ/3
µ
λ
/
3
λ
/
3
µ
λ
/
3
µ
68
Politecnico di Torino Formulary ver. 1.1
Rates are all λ/3 because the probability of having different batches is uniform.
In this case, the size of batches implies difference in losses: batch with higher size are more
probably rejected than others, therefore the dropping probability is state dependent. In this
case PASTA does not hold any more. To evaluate the dropping probability:
. first the average arrival rate has to be computed: batches can carry one, two or three
customers, so in average they carry two customers; batches arrival rate is λ so the average
arrival rate for customer is 2λ;
. the rate in which customers are dropped is:
. in state 1 only the batch that carry three customers is lost at rate λ/3;
. in state 2 is possible lose the batch that carry two and three customers, always at
rate λ/3;
. in state 3 all batches are lost at rate λ/3.
In conclusion:
P (loss) =
π
1
·
_
3 ·
λ
3
_

2
·
_
2 ·
λ
3
+ 3 ·
λ
3
_

3
·
_
1 ·
λ
3
+ 2 ·
λ
3
+ 3 ·
λ
3
_

69
Chapter 7
Network queues exercises
Exercise 1
Text
Given the following network queue:
λ
1
/
2
λ
3
1
/
2
λ
2
1/3
2/3
1
λ
1
Assume that each queue is an M/M/1 with infinite storage capacity; moreover, consider arrival
and departure rates exponentially distributed.
Find:
1. the steady state distribution;
2. the average number of customers in all queues.
Solution
Task 1
First of all, arrival rates have to be computed: the Jackson’s Theorem holds because the
following conditions:
. service times are exponentially distributed;
. all queues have infinite storage capacity;
70
Politecnico di Torino Formulary ver. 1.1
. exogenous arrival processes are Poisson;
. routing is memoryless (Bernoullian);
are not violated; thanks to this assumption, the departure rate after a given queue (marked in
the picture in green) is equal to its arrival rate; thanks to this:
λ
2
= λ
3
=
λ
1
2
λ
1
= λ +
_
2
3
· λ
2
_
+ [1 · λ
3
]
Therefore:
λ
1
= λ +
_
2
3
·
λ
1
2
_
+
_
1 ·
λ
1
2
_
=⇒ λ
1
= 6λ
In conclusion:
_
¸
_
¸
_
λ
1
= 6λ
λ
2
= 3λ
λ
3
= 3λ
Now it is possible define the load for each queue:
ρ
1
=
λ
1
µ
1
=

µ
1
ρ
2
=
λ
2
µ
2
=

µ
2
ρ
3
=
λ
3
µ
3
=

µ
3
To ensure ergodicity, simultaneously, all loads must not violate the constraints:
_
¸
_
¸
_
ρ
1
< 1
ρ
2
< 1
ρ
3
< 1
With these hypothesis, the steady state distributions are:
π
(1)
i
= (1 −ρ
1
) · ρ
i
1
π
(2)
j
= (1 −ρ
2
) · ρ
j
2
π
(3)
k
= (1 −ρ
3
) · ρ
k
3
Thanks to the product form property:
π
ijk
= π
(1)
i
· π
(2)
j
· π
(3)
k
71
Politecnico di Torino Formulary ver. 1.1
Task 2
Since all queues are M/M/1, the average number of customers in an M/M/1 is given by:
E[N] =
ρ
1 −ρ
Therefore:
E[N
1
] =
ρ
1
1 −ρ
1
E[N
2
] =
ρ
2
1 −ρ
2
E[N
3
] =
ρ
3
1 −ρ
3
Globally, in the system there are:
E[N] = E[N
1
] +E[N
2
] +E[N
3
]

Exercise 2
Text
Consider the following closed-network queue:
λ
i
j
k
Assume that the number of customers is N = 5, find the Markov Chain that describe the model.
Solution
Every time, the number of customers must be equal to 5; some examples are:
0 0 5
0 1 4
1 1 3
and so on. So, as a descriptor, it is possible to use the number of customers in the system; with
this assumption, the Markov Chain is:
0 1 2 3 4 5

µ

µ

µ

µ
λ
µ

72
Chapter 8
Simulation of exams
Exercise 1
Text
Consider a system M/. . ./2 where arrivals are Poisson and service times are:
. Erlang 2 (E
2
r
) for q = 0;
. exponential for q = 1.
Assume q be the probability of exit immediately from the system by a customer and p = 1 −q
be the probability of going into the second stage.
Find:
1. the transition diagram;
2. if the system is ergodic;
3. flow balance equations;
4. the average number of customers in the system;
5. the average delay of the system.
Solution
Task 1
The state descriptor is composed by:
N
i
- St
1
- St
2
where:
. N
i
represents the number of customers in the system;
. St
1
represents the stage of the first server: A or B;
73
Politecnico di Torino Formulary ver. 1.1
. St
2
similarly with the previous state, represents the stage of the second server: A or B.
For the generic state (κAA):
(κAA) (κ + 1 AA) (κ −1 AA)
(κAB)
λ
2µq
2µp
For the generic state (κAB):
(κAA) (κ + 1 AB) (κ −1 AB)
(κBB)
(κ −1 AA)
λ
µq
µp
µ
For the generic state (κBB):
(κAA) (κ + 1 BB) (κ −1 AB)
λ

Therefore, in general:
74
Politecnico di Torino Formulary ver. 1.1
2 AA 3 AA
1 A
0 2 AB 3 AB
1 B
2 BB 3 BB
1
2
3
4
1
1
2
3
6
5
7
1
6
7
4 4
1
1
5
3
where:
. 1 means: λ;
. 2 means: µ;
. 3 means: µq; it is used when a customer immediately leave the system;
. 4 means: µp; it is used when a customer goes into the second stage;
. 5 means: 2µ; it is used when the leaving of a customer occurs by choosing one among
two in the same state;
. 6 means: 2µq; it is used when one customer among two can exit immediately;
. 7 means: 2µp; it is used when one customer among two goes into the second stage.
Task 2
The system is a particular case of an M/G/2; the average service time is:
E[s] =
1
µ
+p ·
1
µ
The first time is the service time always present, while the second is considered just with
probability p. Thanks to this, the maximum capacity of the system is:
2
E[s]
so, ergodicity is ensured when:
λE[s] < 2
75
Politecnico di Torino Formulary ver. 1.1
Indeed, for a M/M/2 the condition is:
λ
µ
< 2
where
1
µ
= E[s].
Task 3
Flow balance equations are written just for two states:
. for state 0:
λπ
0
= µqπ
1 A
+µπ
1 B

. for state (2 AA):
(2µq + 2µp +λ)π
2 AA
= λπ
1 A
+ 2µqπ
3 AA
+µπ
3 AB
Globally, the outgoing flow is:
(2µ +λ)π
2 AA
because:
2µq + 2µp =⇒ 2µq + 2µ(1 −q) =⇒ 2µ · (q + 1 −q)
Task 4
The average number of customers in the system is:
E[N] = 1 · (π
1 A

1 B
) + 2 · (π
2 AA

2 AB

2 B B
) +
+ 3 · (π
3 AA

3 AB

3 B B
) =
= 1 · (π
1 A

1 B
) +

κ=2
κ · (π
κAA

κAB

κB B
)
Task 5
The expected delay can be computed as:
E[D] =
E[N]
λ
by simply applying Little. Take care that the arrival rate is λ = E[λ].

Exercise 2
Text
Consider the following network queue:

Outgoing flows equal to incoming flows.
76
Politecnico di Torino Formulary ver. 1.1
λ
1/3
Q
1
Q
2
Q
3
2/3
1/3
1/3 2/3
2/3
Find:
1. if there is a steady state product form (Jackson’s Theorem);
2. if the system is ergodic;
3. the steady state distribution;
4. delays of the system:
. traversing time;
. total time spent into a queue.
Solution
Task 1
To verify if the Jackson’s theorem is ensured, the following constraint have to be verified:
. service times are exponentially distributed in every queue;
. all queues must have an infinite storage capacity;
. exogenous arrival processes must be Poisson;
. routing must be memoryless.
Since all these properties are verified, the system has a steady state product form.
Task 2
To find if the system is ergodic, first the following parameters, associated to queues, have to be
defined:
λ
1
such that
λ
1
µ
1
< 1
λ
2
such that
λ
2
µ
2
< 1
λ
3
such that
λ
3
µ
3
< 1
77
Politecnico di Torino Formulary ver. 1.1
All the constraints must be verified simultaneously. The resultant system is:
_
¸
¸
¸
¸
¸
_
¸
¸
¸
¸
¸
_
λ
3
=
1
3
· λ
1
λ
2
=
2
3
· λ
3
λ
1
= λ +
2
3
· λ
1
+
1
3
· λ
3
+
2
3
λ
2
Therefore:
_
¸
¸
¸
¸
¸
_
¸
¸
¸
¸
¸
_
λ
3
=
1
3
· λ
1
λ
2
=
2
9
· λ
1
λ
1
=
27
2
· λ
Task 3
By exploiting the product form, first are defined:
ρ
1
=
λ
1
µ
1
ρ
2
=
λ
2
µ
2
ρ
3
=
λ
3
µ
3
such that:
π
ijk
= [(1 −ρ
1
) · ρ
i
1
] · [(1 −ρ
2
) · ρ
j
2
] · [(1 −ρ
3
) · ρ
k
3
]
Task 4
By applying Little, it is possible to compute both requests. For what concern the traversing
time of a given queue κ, if λ
κ
is assumed to be the arrival rate:
E[Trav
κ
] =
E[N
κ
]
λ
κ
where E[N
κ
] is the average number of customers of the queue κ.
For what concern the total time spent in a given queue κ, it can be computed starting from
the average time spent in the system:
E[Time in the system] =
E[N]
λ
=
E[N
1
]
λ
·
E[N
3
]
λ
·
E[N
3
]
λ
Since each term is the time spent in a given queue:
E[Time in the queue κ] =
E[N
κ
]
λ
For Q
1
there are two kinds of delays:
. one, the traversing time, that considers the measurement time as:
λ
λ
1
78
Politecnico di Torino Formulary ver. 1.1
by applying Little, this is:
E[Trav
Q
1
] =
E[N
1
]
λ
1
it must be shortest than the other!
. the second one, instead, looks at the total time spent in the queue:
λ
2/3
λ
x
λ
1
since the internal flow is not considered, the new arrival rate is:
λ
x
= λ
1

2
3
· λ
1
=
1
3
· λ
1
and, therefore, the average time spent in Q
1
is:
E[Tot time
Q
1
] =
E[N
1
]
λ
x
= 3 ·
E[N
1
]
λ
1

Exercise 3
Text
Consider an M/M/1 in which arrival and departure rates are exponentially distributed with
parameters λ and µ respectively and the server, after having served a packet, takes a rest.
Vacation time is also exponentially distributed with parameter α.
Find:
1. the transition diagram;
2. the ergodicity condition.
Solution
Task 1
The state descriptor must contain the number of customers actually present into the system
and the state of the server:
. A if it is active;
. V if it is in vacation.
With this consideration, the markov chain is:
79
Politecnico di Torino Formulary ver. 1.1
0 A 1 A 2 A 3 A
0 V 1 V 2 V 3 V
λ λ λ
λ λ λ
α α α α
µ µ µ
If the parameter α = µ, the system is exactly an M/E
2
r
/1.
Task 2
The time devoted for each customer is:
1 service time + 1 vacation time =
1
µ
+
1
α
Therefore the maximum capacity C of the system is that value and, to ensure ergodicity:
C · λ < 1 =⇒ λ ·
_
1
µ
+
1
α
_
< 1
Performances of this system are reduced with respect to a traditional M/M/1: indeed, the time
in which the server is working is reduced. The efficiency is:
E =
1
µ
1
µ
+
1
α
<
1
µ

Exercise 4
Text
Consider a M/M/2 in which one server is lazy: if the queue is empty, one server becomes
inactive until κ customers are again the system. Arrival and departure rates are exponentially
distributed with with parameters λ and µ respectively.
Find:
1. the transition diagram;
2. the ergodicity condition.
Solution
Task 1
In this case, the state descriptor must contain the number of customers in the system and the
actual state of the server lazy; again, is it possible to consider:
80
Politecnico di Torino Formulary ver. 1.1
. A if it is active;
. V if it is in vacation.
With this consideration, the markov chain is:
1 V 2 V
. . .
κ −1 V
0 1 A 2 A
. . .
κ −1 A κ
λ λ
λ
λ λ
λ λ
λ λ
µ µ
µ
µ
2µ 2µ
2µ 2µ
Task 2
To discuss the ergodicity of the system, it has to be considered on the long term: it has the
same performances of an M/M/2 without rest because for n > κ:
π
n+1
=
λ

· π
n
Indeed, the series for the M/M/2 is convergent, so also the series for this case converge: this is
due to the property that adding an arbitrary number of terms at the beginning of a series does
not affect the convergence. Therefore, the system is ergodic if:
λ

< 1

Exercise 5
Text
Assume that the following random variable has to be simulated:
X = Y +Z
where:
. Y is an hyper-exponential: Y = H
2
y
;
. Z is Rayleigh:
f
z
(t) =
t
σ
2
· e

t
2

2
Write the pseudo-code to obtain X.
81
Politecnico di Torino Formulary ver. 1.1
Solution
Since X is sum of two independent random variables, it is possible to generate them indepen-
dently.
For what concern Y , the hyper-exponential distribution is:
H
2
y
= p
1
· µ
1
· e
−µ
1
t
+p
2
· µ
2
· e
−µ
2
t
where p
2
= 1 −p
1
. Therefore, the pseudo-code to generate it is:
generate u=uniform(0,1)
if (u<p1)
negexp( µ
1
)
else
negexp( µ
2
)
For what concern Z, it is possible to compute the cumulant and then invert it:
F
z
(t) = 1 −e

x
2

2
=⇒ u = 1 −e

x
2

2
Now:
1 −u = e

x
2

2
=⇒ log {1 −u} =
x
2

2
=⇒ x =
_

2
· log {1 −u}
Therefore, the pseudo-code to generate it is:
generate u=uniform(0,1)
apply the formula Z =
_

2
· log {1 −u}

Exercise 6
Text
Consider an M/M/1 system with group services: the server provides services for 1, 2 and 3
customer simultaneously with arrival time λ and service time µ, independent on the group size.
The number of served customer is always the largest as possible, given the number of customers
in the waiting line (if in the waiting line there is just one customer, it is served immediately
without waiting other arrivals).
Find:
1. the general transition diagram and define when it holds;
2. when the system is ergodic.
82
Politecnico di Torino Formulary ver. 1.1
Solution
Task 1
The state descriptor has to take care of the number of customers currently in the system and
on the number of currently in service (this can be 1, 2 or 3). The general transition diagram
consider a node n and looks for possible states reachable from a basic state (n, 1): it means
that there are n customer in waiting line and 1 in service.
n, 1
n, 2
n −3 , 3 n −2 , 3 n −1 , 3 n, 1
λ
λ
λ
µ
µ
µ
This holds just for N = 5 because at the beginning there are transient effects.
Task 2
The capacity of the system, on the long term, is:
C = 3µ
Therefore, the system is ergodic when:
arrival rate
capacity
< number of servers =⇒
λ

< 1

Exercise 7
Text
Consider an E
2
r
/M/1/2 queuing system with group arrivals (each group has at most 3 cus-
tomers). If not all customers of a group can be accepted, only those one that not exceed the
capacity of the system are accepted. The average group interarrival time is λ
−1
, while the
average service time is µ
−1
.
Find:
83
Politecnico di Torino Formulary ver. 1.1
1. the transition diagram for the Markov Chain that model the system;
2. when the system is ergodic;
3. the steady state distribution;
4. the average delay;
5. the average waiting time.
Solution
Task 1
The state descriptor has to take care of the number of customers and the stage of the system
(A/B):
N , A/B
The transition diagram is:
0 , A 1 , A 2 , A 3 , A
0 , B 0 , B 2 , B 3 , B
µ µ µ
µ µ µ
2λ 2λ 2λ



2λ 2λ
Arrival rate are 2λ because the average is
1
λ
but there are two stages A/B. The state 3 B
has an arrow towards 3 A because, if customer arrives are all refused, but the system changes
state.
Task 2
Since the system is finite (up to 3 customer can be present: 1 in service and 2 in waiting line)
the system is ergodic.
Task 3
The steady state distribution is not reported, but only balancing equations for some states are
written:
state 0 , B : 2λ · π
0 , B
= µ · π
1 , B
+ 2λ · π
0 , A
state 2 , A : (2λ +µ) · π
2 , A
= µ · π
3 , A
84
Politecnico di Torino Formulary ver. 1.1
Task 4
The average delay can be computed by applying Little:
E[D] =
E[N]
E[λ]
where:
. E[N] is the average number of customers in the system;
. E[λ] is the average arrival rate.
For what concern the first quantity:
E[N] = 0 · (π
0 , A

0 , B
) + 1 · (π
1 , A

1 , B
) + 2 · (π
2 , A

2 , B
) + 3 · (π
3 , A

3 , B
) =
=
3

i=0
i · (π
i , A

i , B
)
For the average arrival rate:
E[λ] = 0·(π
0 , A

1 , A

2 , A

3 , A
)+3

·2λ·(π
0 , B
)+2

·2λ·(π
1 , B
)+1

·2λ·(π
2 , B
)+0

·(π
3 , B
)
Task 5
The average waiting time E[W] can be computed starting from the average delay:
E[D] = E[W] +E[S]
where E[S] is the average service time and:
E[S] =
1
µ
Another approach is to compute first the average number of waiting customers, then apply
Little:
E[W] =
E[N
waiting
]
E[λ]
where:
E[N
waiting
] =
3

i=1
(i −1) · (π
i , A

i , B
)
because i customers are present and 1 is in service: i − 1 represent the number of waiting
customers.


3 because all customers can be accepted.

1 customer is dropped.

2 customers are dropped.

all customers are dropped.
85
Politecnico di Torino Formulary ver. 1.1
Exercise 8
Text
Consider an M/E
2
r
/2/1 queuing system with group arrivals in which groups arrivals follow a
Poisson process with rate λ and the average service time is equal to µ
−1
. Each arrival brings
into the queue 2 customers and if one of the two can not be accepted, it is discarded; the same
behaviour happens in case both of them can not be served.
Find:
1. the transition diagram for the Markov Chain that model the system;
2. the average delay.
Assume to consider the particular case M/E
2
r
/2/∞: when the system is ergodic?
Solution
Task 1
The state descriptor has to take care of the number of customers and all possible stages of the
system (AA/AB/BB):
N , AA/AB/BB
With respect to the previous exercise, now there are two servers, so there are 3 combinations
of possible stages.
The transition diagram is:
2 AA 3 AA
1 A
0 2 AB 3 AB
1 B
2 BB 3 BB
λ
λ
λ
λ
λ
λ
4µ 4µ


2µ 2µ




When there are two customers that potentially can exit from the system, the departure rate
is 4µ because each Erlang 2 with rate µ has two stages. From any state x, BB it is possible
reach states x − 1 , AB because one customer exit (and a new one come starting in stage A),
but the other one is still in the system in stage B.
86
Politecnico di Torino Formulary ver. 1.1
Task 2
As the previous exercise, by applying Little:
E[D] =
E[N]
E[λ]
Therefore:
E[N] = 1 · (π
1 , A

1 , B
) + 2 · (π
2 , AA

2 , AB

2 , BB
) + 3 · (π
3 , AA

3 , AB

3 , BB
)
E[λ] = 2 · λ(π
0

1 , A

1 , B
) +λ · (π
2 , AA

2 , AB

2 , BB
) + 0
Task 3
In general, for a system with 2 server, an M/M/2 in which customers arrives one at time, the
ergodicity condition is:
λ · E[S] < 2 =⇒
λ
µ
< 2
considering λ and µ as arrival and departure rate respectively. For batch arrivals (groups of 2
customers at time):
2λ · E[S] < 2 =⇒

µ
< 2 =⇒
λ
µ
< 1

Exercise 9
Text
Assume that instances of a random variable X have to be generated starting from:
n
f
x
(n)
0
β
α
1
Solution
There are two possible approaches.
87
Politecnico di Torino Formulary ver. 1.1
Approach 1
α · β
2
+β · (1 −α) = 1
β ·
_
α
2
+ 1 −α
_
= 1 =⇒ β =
1
1 −
α
2
Approach 2
In this case the function have to be split into:
n
f
x
(n)
0
β
α
n
f
x
(n)
0
α
1 −α
The graph on the left it is not a distribution; to be a distribution, it has to be normalized as
follows:
n
f
x
(n)
0
β

α
where such β

is:
β

=
2
α
Now the distribution is:
f
z
(n) =
_
_
_
2
α
2
· n 0 ≤ n ≤ α
0 otherwise
The first value is due to: cα = 2/α =⇒ c = 2/α
2
. In this way, by looking at values of n:
_
X = first graph if 0 ≤ n < α
X = second graph if α ≤ n ≤ 1 −α
88
Politecnico di Torino Formulary ver. 1.1
The second part is easy to be generated:
X|
α≤n≤1−α
= Uniform{α,1,&seed}
For what concern the first, by applying the inversion on the cumulant:
F
z
(n)

=
2
α
2
· n
2
for 0 ≤ n ≤ α
so:
t =
2
α
2
· n
2
=⇒ n =

α
2
· t
Since t can be generate as an uniform from 0 to 1:
X|
0≤n<α
=
_
α
2
· Uniform{0,1,&seed}}

Exercise 10
Text
Assume that a wireless network has to be simulate under the following hypothesis:
. use a spatial approach;
. consider nodes distributed as a Poisson process with rate λ;
. nodes are placed in an independent and uniform manner.
Solution
By using a spatial approach, it is possible to introduce axis x and y to describe a generic
coordinate of a node:
x
y
distribution: Poisson(λ · Area)
To generate a Poisson process to place nodes:
n=Poisson)λ);

This is the integral of f
z
(n)
89
Politecnico di Torino Formulary ver. 1.1
for(k=1; k<= n; k++){
x[k]=Uniform(0,1,&seed);
y[k]=Uniform(0,1,&seed);
}
first it is generated the number of nodes to put into the topology, then they are placed in a
given coordinate.
Each node is placed exactly in the center of a disk with a given radius:
R
and disks can not overlap. To generate it, there are two methods:
1. generate module and phase to exploit polar coordinates:
module=Uniform(0,1,&seed);
phase=Uniform(0,2π,&seed);
2. generate a square outside the disk to have the radius R = 1/2:
then generate the point on the rectangle surface.

Exercise 11
Text
Given a set of random variables:
_
¸
¸
¸
¸
_
¸
¸
¸
¸
_
X
1
= . . .
X
2
= . . .
.
.
.
X
n
= . . .
compute the confidence interval.
90
Politecnico di Torino Formulary ver. 1.1
Solution
As notation, the estimated value are denoted as . . . while non estimated value does not have
the line over them.
To compute the confidence interval, first the estimate mean and variance have to be com-
puted:
avg =
n

i
1
x
i
n
= α
var =
1
n −1
·
n

i
1
(x
i
−avg)
2
= β
where x
i
are samples. To find the variance as estimator of the mean value, the estimated
standard deviation has to be computed:
stdev =
_
var
n
=
_
β
n
After that, it is possible to conclude that:
avg

= N

_
avg , stdev
_
The probability that an error is behind a threshold γ is:
P (|avg −avg|) < γ
Since:
avg −avg

= N
_
0 , stdev
_

= N
_
0 ,
_
β
n
_
the expression:
|avg −avg| < γ
is simply:
−γ ≤ |avg −avg| ≤ γ
To find this interval:
_
γ
−γ
N
_
0 ,
_
β
n
_
= F(γ)
The confidence interval associated to level α (typical values for it are 0.9, 0.95, 0.99) is:
Conf = [avg −γ , avg +γ]
because γ is the solution of the equation:
F(γ) = α


Normal distribution
91
Part III
Appendix
92
Appendix A
Formulas
Queue Type of Formula Formula
M/M/1 Ergodicity Condition
λ
µ
< 1
Avg Service Time E[S] =
1
µ
Second Moment of Service Time E
_
S
2
¸
=
2
µ
2
Avg Number of Customers E[N] =
ρ
1 −ρ
Variance V ar(N) =
ρ
(1 −ρ)
2
Avg Delay E[W] =
1/µ
1 −ρ
Throughput X = λ
Traffic Intensity U =
λ
µ
M/M/1/N Avg Number of Customers E[N] =
ρ[1 −(N + 2)ρ
N+1
+ (N + 1)ρ
N+2
]
1 −ρ
2
·
1 −ρ
1 −ρ
N+2
Average Delay E[D] =
ρ[1 −(N + 2)ρ
N+1
+ (N + 1)ρ
N+2
]
(1 −ρ)(1 −ρ
N+2
)
λ

1 −
ρ
N+1
(1 −ρ)
1 −ρ
N+2

Throughput in input t
in
= λ(1 −π
N+1
)
Throughput in output [N=0] t
out
=
λ
1 +ρ
Loss Probability
ρ −1
ρ
≈ 1 −
1
ρ
M/M/c Ergodicity Condition
λ

< 1
Avg Number of Customers E[N] =


i=0

i
Avg Delay E[N] =


i=0

i
λ
93
Politecnico di Torino Formulary ver. 1.1
M/M/c/0 Avg Number of Customers E[N] =
ρ
1 −ρ
M/M/∞ Avg Number of Customers E[N] =
λ
µ
Avg Delay E[W] =
1
µ
M/M/1/N-1/N Avg Number of Customers E[N] =

N
i=0

i
Avg Arrival Time E[λ] =

N
i=0
(N −i)λπ
i
Avg Delay E[D] =

N
i=0

i

N
i=0
(N −i)λπ
i
M/E
r
/1 Y is an Erlang process Y = X
1
+X
2
+· · · +X
r
Mean of Y E[Y ] =
1
µ
Second Moment of Y E[Y
2
] =
1
µ
+
1

Coefficient of Variation c
v
=
_
V ar(x)
E[X]
Variance V ar(Y ) =
1

2
M/G/1 Pollack Klimchine E[q] =
E[θ
2
] +E[θ] −2E[θ]
2
2(1 −E[θ])
Second Moment of Service Time E
_
S
2
¸
= E[S]
2
+V ar(S) = 11E[S]
2
Avg Delay E[D] =
λE[S]
2
2(1 −ρ)
+E[S]
Avg Waiting Time E[W] =
λE[S]
2
2(1 −ρ)
M/D/1 Avg Service Time E[S] =
1
µ
Second Moment of Service Time E
_
S
2
¸
= S
2
Avg Delay E[D] = E[S]
ρ
2(1 −ρ)
Jackson Networks Stability Condition [i=1,2,..,M] ρ
i
<
λ
i
c
i
µ
i
Mean Number of Customers E[N] =

M
i=1
ρ
i
1 −ρ
i
Avg Waiting Time E[W] =
E[N]

M
i=1
γ
i
[γ is the arrival time]
Avg Time spent in node i E[W
i
] =
1
µ
i
(1 −ρ
i
)
Throughput X
i
=


k=1
P
i
(k)µ
i
(k)
94
Politecnico di Torino Formulary ver. 1.1
For what concern the M/M/k/0/N, the blocking probability is:
P
block
=
(N −k)λπ
k

k
i=0
(N −i)λπ
i
where:
(N −k)π
k

k
i=0
(N −i)π
i
<
π
k

k
i=0
π
i
= π
k
computed for:
N −i ≥ N −k
95
Appendix B
Integrals
In the following formulas are always omitted the sum of the constant c.
Fundamentals
_
x
α
=
x
α+1
α + 1
_
1
x
= ln |x|
_
a
x
=
a
x
ln a
_
a
κx
=
a
κx
κlog a
a > 0 , a = 1
_
e
x
= e
x
_
e
κx
=
e
κx
κ
_
x · e
κx
=
e
κx
κ
2
· (κx −1)
_
sin x = −cos x
_
cos x = sin x
96
Politecnico di Torino Formulary ver. 1.1
Integrals that can be bring back to fundamentals
_
f
n
(x) · f

(x) =
f
n+1
(x)
n + 1
_
f

(x)
f(x)
= log |f(x)|
_
e
f(x)
· f

(x) = e
f(x)
_
a
f(x)
· f

(x) =
a
f(x)
ln a
Techniques
By substitution
Imposing:
g(t) = x =⇒ dx = g

(t)
It is possible obtain:
_
f(x) dx =
_
f[g(t)] · g

(t)dt
By parts
_
f(x) · g

(x)dx = f(x) · g(x) −
_
f

(x) · g(x)dx
97
Appendix C
Series

i=0
x
i
=
1
1 −x

i=0
i · x
κ
=
1
1 −x
κ

i=0
i · x
i
=
x
(1 −x)
2

i=0
i
2
· x
i
=
x · (1 +x)
(1 −x)
3

i=0
i
3
· x
i
=
x · (1 + 4x +x
2
)
(1 −x)
4

i=0
i
4
· x
i
=
x · (1 +x) · (1 + 10x +x
2
)
(1 −x)
5

i=1
x
i
i
= log
e
_
1
1 −x
_

i=0
x
i
i!
= e
x

i=0
i ·
x
i
i!
= x · e
x

i=0
i
2
·
x
i
i!
= (x +x
2
) · e
x

i=0
i
3
·
x
i
i!
= (x + 3x +x
2
) · e
x

i=0
i
4
·
x
i
i!
= (x + 7x
2
+ 6x
3
+x4) · e
x
98

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.