Queueing - Theory-Birth and Death Process
Queueing - Theory-Birth and Death Process
Jaroslav Sklenar
University o f M a l t a
Contents
Introduction
1 Elements of Queuing Systems
2 Kendall Classification
3 Birth and Death Processes
4 Poisson Process
4.1 Merging and Splitting Poisson Processes
4.2 Model M/G/oo
5 Model M / M / l
5.1 PASTA
6 General Results
6.1 Markovian Systems with State Dependent Rates
7 Model with Limited Capacity
8 Multichannel Model
9 Model with Limited Population
9.1 Model with Spares
10 Other Markovian Models
10.1 Multichannel with Limited Capacity and Limited
Population
10.2 Multichannel with Limited Capacity and Unlimited
Population
10.3 Erlang's Loss Formula
10.4 Model with Unlimited Service
11 Model M / G / l
12 Simple Non-Markovian Models
13 Queuing Networks
13.1 Feed Forward Networks
13.2 Open Jackson Networks
13.3 Closed Jackson Networks
14 Selected Advanced Models
14.1 State Dependent Rates Generalized
14.2 Impatience
14.3 Bulk Input
14.4 Bulk Service
14.5 Systems with Priorities
14.6 Model G/M/l
15 Other Results and Methods
References
Appendices
Introduction
This text is supposed to be used in courses oriented to basic theoretical background and
practical application of most important results of Queuing Theory. The assumptions are
always clearly explained, but some proofs and derivations are either presented in appendices
or skipped. After reading this text, the reader is supposed to understand the basic ideas, and to
be able to apply the theoretical results in solving practical problems. Symbols used in this text
are unified with the book [1].
Acknowledgement: Many thanks go to Ms. Nadia Tagliaferro who wrote down many
examples and derivations presented during my lectures. Due to her hard work the text is now
more complete and easier to understand.
Population o f Customers
Arrival
Q u e u e Service Output
O
Population of Customers can be considered either limited or unlimited. Unlimited population
is an abstraction used in theoretical models of systems with a large number of possible
customers (a bank on a busy street, a motorway petrol station). In unlimited population
systems the number of customers in the system does not affect the arrival process. Example
of a limited population may be a number of processes to be run (served) by a computer or a
certain number of machines to be repaired by a service man. In limited population systems the
number of customers in the system affects the arrival (more customers in the system means
less frequent arrivals; if all are in there are no arrivals at all). It is necessary to take the term
"customer" very generally. Customers may be people, machines of various nature, computer
processes, telephone calls, data packets, manufactured components, etc.
Arrival defines the way customers enter the system. Mostly customers arrive randomly with
random intervals between two adjacent arrivals. Typically the arrival is described by a
random distribution of intervals also called Arrival Pattern. Models exist both for single and
batch (bulk) arrivals.
Queue represents customers waiting for service (of course the queue may be empty).
Typically the customers being served are considered not to be in the queue. Sometimes the
customers form a queue literally (people waiting in a line for a bank teller). Sometimes the
2
queue is an abstraction (planes waiting for a runway to land, machines waiting for a repair).
There are two important properties of a queue: Maximum Size and Queuing Discipline.
Maximum Queue Size is the maximum number of customers that can wait in the queue.
System Capacity is the maximum number of customers in the system (maximum queue size
plus the number of service channels). Queue is always limited, but some theoretical models
assume an unlimited queue length. If the queue length is limited, some customers are forced
to renounce without being served.
Queuing Discipline represents the way the queue is organised (rules of inserting and
removing customers to/from the queue). There are these typical ways:
1) FIFO (First In First Out) also called FCFS (First Come First Serve) - orderly queue.
2) U F O (Last In First Out) also called LCFS (Last Come First Serve) - stack.
3) SIRO (Serve In Random Order).
4) Priority Queue that may be viewed as a collection of FIFO queues for various priorities.
5) Many other more complex queuing methods that typically change the customer's position
in the queue according to the time spent already in the queue, expected service duration,
and/or priority. These methods are typical for computer multi-access systems.
Many quantitative parameters (like average queue length, average time spent in the system)
do not depend on the queuing discipline. That's why most models either do not take the
queuing discipline into account at all or assume the normal FIFO queue. In fact if there are no
priorities the most important parameter that depends on the queuing discipline is the variance
of the waiting time. There is this general rule (that may be used for example to verify results
of simulation experiments):
The two extreme values of the waiting time variance are for
the FIFO queue (minimum) and the LIFO queue (maximum).
Theoretical models (except priorities and networks) assume only one queue. This is not
considered as a serious limiting factor because practical systems with more queues (bank with
several tellers with separate queues) may be viewed as a system with one queue, because the
customers always select the shortest queue. Of course, it is assumed that the customers leave
after being served. Systems with more queues (and more channels) where the customers may
be served more times are called Queuing Networks.
Service represents some activity that takes time and that the customers ask and possibly wait
for. Again take it very generally. It may be a real service carried on persons or machines, but
it may be a C P U time slice, connection created for a telephone call, being shot down for an
enemy plane, etc. Typically a service takes random time. Theoretical models are based on
random distribution of service duration also called Service Pattern. Another important
parameter is the number of servers that are called channels. Systems with one channel only
are called Single Channel Systems; systems with more channels are called Multichannel
Systems. Theoretical models assume that the channels are all equal and the load is distributed
evenly. Similarly to arrival there are models for single and batch services.
Output represents the way customers leave the system. Output is mostly ignored by
theoretical models, but sometimes the customers leaving the server enter the queue again
("round robin" time-sharing systems). Also in limited population models leaving customers
are assumed to ask again (typically after some random time) for service.
3
Queuing Theory is a collection of mathematical models of various queuing
systems that take as inputs parameters of the above elements and that provide
quantitative effectiveness parameters describing the system performance.
Because of random nature of processes involved; queuing theory is rather demanding and
most models are based on very strong assumptions (not always satisfied in practice). Many
systems (especially queuing networks) are not soluble at all, so the only feasible technique
that may be applied for their analysis is simulation.
Nevertheless models of queuing systems are practically very important because of the typical
trade-off between various costs of providing service and the costs associated with waiting for
the service (or leaving the system without being served). High quality fast service is
expensive, but costs caused by customers waiting in the queue are minimum. On the other
hand long queues may cost a lot because customers (machines e.g.) do not work while
waiting in the queue or customers leave because of long queues. So a typical problem is to
find an optimum system configuration (e.g. the optimum number of channels). The solution
may be found by applying queuing theory or by simulation.
From the Optimization theory point of view, systems optimized by using queuing theory
mostly don't provide a continuous objective function. Typically there are several
configurations and the problem is to select the best one.
2 Kendall Classification
The Kendall classification of queuing systems and their models (1953) exists in several
modifications. The one used in [1] is based on 5 symbols:
A/B/X/Y/Z
Where:
Sometimes another symbol is added for a limited population size (number of possible
customers). These symbols are used for arrival and service patterns:
4
3 Birth and Death Processes
Stochastic process is a collection of random variables {X(t), t e T] defined on a probability
space and indexed by a parameter t (usually assumed to be time). So for each value of t there
is a random variable X(t) with values in a certain state space S. If the state space is discrete
(denumerable - not necessarily finite), the process is called a discrete-state stochastic process.
If the state space is continuous we deal with a continuous-state stochastic process. Similarly
with respect to the time set there are discrete-time stochastic processes and continuous-time
stochastic processes.
Birth-death process is a stochastic process with continuous time and discrete state space
S={0,1,2, ... } such that from any state n e S\{0} only transitions to the neighbouring states
n+l and n-l are allowed. From state 0, the only allowed transition is to state 1. If the state
space is finite: S = {0,1,2, ... , m-1, m}, the only allowed transition from the last state m is to
the state m-1.
When interpreting the current state n e S as the current population in a system, a birth occurs
with the rate X >0 resulting in the state n+l. For a finite state process X =0. A death occurs
N M
with the rate ju >0 resulting in the state n-l. Note that typically XQ>0, on the other hand
N
always jUo=0.
Markovian birth-death process has transition probabilities dependent only on the current
state (not on the past history how the current state has been reached). Exactly:
Linear Markovian processes have the above probabilities dependent linearly on n and At:
ju =jiu, n>0 where X is the state independent birth/arrival rate and // is the state
n
5
Example: Collecting and processing applications may involve all three types of birth-death
processes:
to - collection starts
t\ - processing starts
t2 - dead-line for accepting applications
?3 - dead-line for processing
# of applications to process
Pure death
process
time
Poisson process
if /L=/l
Poisson process is a pure birth Poisson birth-death process defined by a single constant
parameter - arrival rate X - that is of course also time independent. Poisson process has
a fundamental place in derivation of many queuing theory models, so we shall study it
in more detail in the next chapter.
4 Poisson Process
Using the above classification we can summarize the properties of the Poisson process where
P[x] means "the probability of the event jc":
1) P[one arrival in the time interval it, t+h)] = Ah + o(h), where A is a constant.
3) The above probabilities do not depend on t ("no memory" property = time independence =
stationarity).
Let p {t) = P[n arrivals in the time interval (0, t)]. To find this function we apply the usual
n
approach: study how the quantity changes over a very short interval, try to find the differential
equation and solve it. By using the above assumptions 1) and 2), it is possible to express the
probability p (t+h). First we list the events that result in the state "n arrivals till {t+h)":
n
6
1. n arrivals by t, no more arrivals during h
2. (n-\) arrivals by t, one more arrival during h
3. (n-2) arrivals by t, 2 more arrivals during h
The above events are mutually exclusive, so we can add their probabilities:
By re-arranging equations (1), by taking the limit for h —> 0 and by using the property of the
function o(h) we obtain the following set of equations:
h^Q fa h^Q fa
As the terms at the left hand sides of (2) are the derivatives, we have the set of differential
equations:
at at
< ?0
To find po(t) we use directly the second equation of (3) ^ — = -A. p (t)
Q or
dt
M
^Eo^l + 2p (t) = 0 which gives the solution p (t) = ce~
0 Q
dt
1
To prove it, differentiate: p' (t) = -Ace' ' 0 = -Ap (?) 0
To find the constant c we assume that the system is initially empty, po{0) = 1:
Po(t)
p (0) = c = l
0
p (t) = e
0
Graphically:
-> t
Similarly we can find p\(t) by inserting po(t) in the first equation of (3):
7
Giving the solution
Xt x
Pl (t) = ce~ + \te~ '
To find the constant c we again assume that the system is initially empty:
P,(0)=c = 0
P\{t) = Ate~ Zt
to prove differentiate.
2
ao
Similarly for n = 2 we get: p (t)
2
Generally (can be proved by induction - see Appendix 1) we obtain the following formula:
(4)
The following figure shows how the probabilities typically change with time. Note also that
for a fixed time, say t\, we get a collection of probabilities that define the distribution of the
discrete random variable "number of births/arrivals in (0, t\f\
See Appendix 2 for the derivation of (4) based on the generating function.
Because of the assumption 3) the formula (4) holds for any interval (s, s+t), in other words
the probability of n arrivals during some time interval depends only on the length of this time
interval (not on the starting time of the interval).
Number of arrivals N during some time interval t is a discrete random variable associated
t
with the Poisson process. Having the probabilities of the random values - (4), it is possible to
find the usual parameters of the random variable N . Let E[X] be the expected (average) value,
t
Var[X] the variance, and c[X] the standard deviation of a random variable X:
8
vn-1
WN,1 = f > „ ( 0 = f > ^ f ^ ' =^ f ^ L - =Ate^e* = At (5)
(5) gives the interpretation of the constant A that is the average number of arrivals per time
1
unit. That's why A is called arrival rate [s" ]. Formula (4) shows that the number of arrivals
during some time t has the so-called Poisson distribution with mean value At. In Appendix 2
the expectation of N and its variance are computed directly by using the generating function.
t
2 2
Var[Ag = Y « ^ ^ - ( A t ) =At (6)
Another random variable associated with the Poisson process is the random interval between
two adjacent arrivals. Let X be the random interval. To find its distribution, let's express the
cumulative distribution function (cdf) F(x):
_/Lt
F(x) = F[X <x] = P[at least one arrival during the interval x] = 1 - po(x) = 1 - e
Because the interval duration is a continuous random variable, it is possible to compute the
probability density function (pdf)f(x) as the derivative of the distribution function:
F(x) = 1 - e AX
•AX
f(x) = Ae (8)
9
The distribution (8) is called exponential distribution (sometimes negative exponential
distribution). Its moments computed by integration by parts are:
1
(9)
(9) gives another interpretation of the constant A. Its inverted value is the average interval
between arrivals. Like the number of arrivals, the distribution of intervals between arrivals
does not depend on time. Note the big value of the standard deviation (equal to the average
value). It means, that the exponential distribution is "very random" with the coefficient of
variation equal to 1. In fact all intervals from 0 to co are theoretically possible. So it may
happen that there will be clusters of very close arrivals separated by very long intervals. Of
course not all practical distributions can be treated as exponential ones. There is this general
rule:
If a large number of independent event streams are merged together, and if events in
each stream occur at a very low rate, then the resulting stream is approximately a
Poisson process with exponential intervals.
This rule is more or less satisfied by systems with large populations (each potential customer
represents one low rate stream).
Some Poisson process examples (small error examples):
F[T>t + s/T>s]=F[T>t].
1) Using the cdf of the exponential distribution the probability of exceeding a certain value t
can be computed as follows:
10
2) Using the above result and elementary Probability Theory formulae the probability on the
left hand side can be written as:
In other words:
"Information about s - time of last arrival (or time when the service has started) - is useless
when assessing probability of the next arrival (or next end of service)".
Graphically:
In both cases the probability of next arrival (end of service) during the next t time units is the
same. Note that for other than exponential distributions this counterintuitive property is not
true. Assume for example any distribution with bounded support [0, s+t] with s and t being
equal to the values depicted above for the case a). Now the probability of next event during t
is 1 for the case a), while it is less than 1 for the case b).
When the exponential distribution is applied to a service, the rate is called service rate (/J).
The parameter /j is the average number of completed services per time unit (provided there
are always customers waiting in the queue), its inverted value 1/// is the average duration of
the exponential service. The variance and the standard deviation can be computed by
replacing X by jU in the formulae (9). Unlike arrival, exponential service is an abstraction that
is hardly satisfied by real systems, because mostly it is very unlikely to have very short and/or
very long services. Real service duration will be typically "less random" than the theoretical
exponential distribution.
Note that unlike //, the quantity 1/jU has a clear interpretation. This explains why software
packages (like QTS) often assume X and 1/// as model inputs.
11
Another very important parameter of queuing systems with one service channel is the ratio p
of the arrival and the service rates called traffic rate:
P =- (10)
The value of p shows how "busy" is the channel. It is obvious, that for p > 1 the queue will
grow permanently and the system will thus be unstable (in the sense that it will never reach
equilibrium with constant probabilities of its states). Later we shall see that for most
theoretical models p must not be even equal to one.
In this chapter we shall prove that merging, random selection and random splitting of Poisson
processes preserves the Poisson properties, so the resulting processes are still Poisson. These
results are very important for the analysis of queuing networks.
We have two independent Poisson processes with rates X\ and X2 respectively. By merging
we understand registration of events (arrivals) of both processes.
Theorem 2: The merge of two independent Poisson processes with rates X\ and X2 is a single
Poisson process with the rate (X\ + Xi).
Proof: We compute the cumulative distribution function F(x) of the merged process:
F(x) = P[at least one arrival during the interval x] = 1 - P[no arrival during x] =
Merging two Poisson processes can be generalized into merging of n independent Poisson
n
processes with rates X\, X% ... X into a single Poisson process with the rate X = ^ X . Apart
n l
from obvious use in queuing networks we shall also use this result in the limited population
model.
We create a new Poisson process from the original one in such a way, that each event (arrival)
is selected with the probability p.
12
Theorem 3: The resulting process created by random selection from a Poisson process with
rate X with probability p is a Poisson process with the rate pX.
Proof: We compute the probability of an arrival in the selection process during a short
interval h —> 0:
P[arrival in selection process during h] =
We create two Poisson processes from the original one in such a way, that each event (arrival)
is selected with the probability p into one process and with the probability (1 - p) into the
other process.
Theorem 4: If a Poisson process with rate X is randomly split into two subprocesses with
probabilities p and (1 - p), then the resulting processes are independent Poisson
processes with rates pX and (1 -p)X respectively.
Proof: We note that splitting is very similar to selection, so by the Theorem 3 the two
processes are Poisson with the rates pX and (1 -p)X. To prove independence we are going to
use a result about dividing sets with random numbers of items with Poisson distribution. Let
N ~ Poisson(a) represent the fact that N has Poisson distribution with mean a. Then the
following theorem will be used:
Theorem 4.1: If the elements of a set with /V items such that N ~ Poisson(a) are randomly
assigned into 2 groups with probabilities p\ and p% = (1 -p{) then the sizes N\ and
N2 of the two sets are independent and distributed as N\ ~ Poisson(/?ia) and N2 ~
Poisson(p «)- 2
Proof: We compute the probability that the sets have n\ and «2 items respectively:
P[A^ = n a iV = n ] = P[N = n a iV = n / N = n = n + n. ]F[N = n} =
v 2 2 t v 2 2 x 2
71 I e _
Pi Pi , I |n=n+n 1 2 -" '
v n !n .
1 2 j
Above we used the multinomial form of the binomial distribution. The result proves the
theorem, the product shows that the two numbers are independent. •
Now we prove that the two split Poisson processes are independent. We take any two time
intervals h and h in the two processes. Let
N\{I\) = number of events in the subprocess 1 in h
N2(h) = number of events in the subprocess 2 in h. Let I = I\ c\ h. Then:
NM =N ^ I ) + n 5), N
2(ii) = N (I)+N (I
2 2 2 n 7J
13
The arrivals in non-overlapping intervals I fl I and I fl I are independent by the
x 2 2 t
properties of Poisson process. So for independence of N\(I\) and A^C^) we need independence
of N\(I) and A^CD that are created by random split of a number generated by Poisson
distribution with mean By the supporting theorem Ni(I) and A^CO are also independent, so
Ni(h) and N2(h) are independent. •
Splitting of a Poisson process into two subprocesses can be generalized into splitting into n
n
Properties of the Poisson process allow surprisingly simple derivation of the equilibrium
system state probabilities of the M/G/co systems. We assume a Poisson arrival with rate X and
ample service where all customers are served immediately. The service takes on average V/u
and we assume that service times and arrival are all independent. Note that the only
assumption on the service time is a finite mean V/u. There is no queue, so the system state
represents the number of busy channels.
z
Theorem 5: Steady state probabilities of M/G/co systems are limp (t) = ^AlMl n e - 'f
So at equilibrium the number of busy channels follows the Poisson distribution with mean
X//u. This famous insensitivity result is very useful in various applications. Note that ample
service may represent self-service, so for example we can use this result to find the mean
number of customers in a department store, etc.
Proof: We prove Theorem 5 for a distribution with finite support. Assume that service time
takes finitely many possible values s\, ... , st with probabilities pi, ... , pt- We also assume
that time t is greater than the maximum possible service time. We can consider arrival of
customers with service time si as a Poisson process with arrival rate Xpi. Then at time t, the
number of customers of type i present in the system are those who have arrived in the time
interval {t-su t). We know that this number has a Poisson distribution with mean XpiSi.
Together the total mean number of customers in the system at time t is:
k k
Y &p s =XY P s =XI
J i i J i i
1=1 1=1
Above the second sum is the mean service time equal to l/ju. There is another result that we
use stating that the sum of independent random variables with Poisson distributions is also
Poisson. This completes the proof. Any continuous distribution can be approximated by a
distribution with finite support with arbitrary precision. See the book [17] for exact proof
based on differential equation approach as we did for Poisson process above.
14
5 Model M/M/l
The M / M / l model is made of a Poisson arrival (arrival rate X), one exponential channel
independent of the arrival (service rate //), unlimited FIFO queue, and unlimited customer
population.
FIFO
Z
•> P = — (traffic rate)
jU
Because arrival and service are independent Poisson processes, it is possible to find
probabilities of various states of the system that are necessary to compute the required
quantitative parameters. System state is the number of customers in the system. It may be any
nonnegative integer number. Let p (f) = P[n customers in the system at time t]. Using the
n
property 2) of the Poisson processes involved the following state diagram applies:
In the state diagram we use the fact that two events of the same type (two arrivals or two
completions of services) cannot happen exactly simultaneously so transitions are possible
only between neighbouring states. This is the reason why most theoretical results in queuing
theory assume Poisson (Markovian) processes. Using the state diagram it is possible to
express the probability p (t+h) by using the reasoning similar to the one used for Poisson
n
Note that in (11) we use the facts that the four cases that result in n customers in the system at
time t+h are mutually exclusive and each case is made of independent events. So for example
the first case is made of these events:
Here are all events together with their probabilities without o(h) terms:
15
P[no arrival during h] = (1 - Ah)
By re-arranging equations (11), by taking the limit for h —> 0 and by using the property of the
function o(h) we obtain the following set of equations:
l i m Pn( t + h
) Pn(0 = _
{X + ^ ( f ) + %p (f) + ju (t)
Pn+l ,n>0
+ h
ton Pott )-Po(?) -A (t) + ju (t) (12)
Po Pl
fc-rf) h
As the terms at the left sides of (12) are the derivatives, we have a set of differential
equations:
d p M )
--(A + u)p (t) + A _ (t)
n Pn 1 + up (t),n>0 n+1 ^ ± = -Ap (t) 0 + ju (t)
Pl (13)
dt dt
Equations (13) are called Kolmogorov - Chapman Differential Equations. Their (very
complicated) solution is a set of equations showing how each probability changes with time.
Typical curves are as follows.
. Puti) ,
0 • t
Fortunately we actually do not need these functions. Because of the third assumption
(stationarity) after some transient period the system will become stable provided that it is not
overloaded (A < //, see later). Of course the state will permanently change, but the
probabilities of various numbers of customers in the system will be constant. So the functions
Pnif) become constants p . Constant functions have zero derivatives, so the set (13) becomes a
n
+ > 0
VP*u-(A + V)Pn Ap«-i=° ' " MPi-Ap =0
0 (14)
By dividing the equations (14) by //we get the following set of equations that contain only
one parameter p - the traffic rate:
l 0
Pn 1 = ( +P)Pn
+ -PPn-X > " > Pl=PP Q (15)
16
See Appendix 5 that shows how equations (14) can be obtained by the stochastic balance
method. Next we solve the equilibrium equations (15) directly, see Appendix 4 for the
solution by the generating function.
2
p = (l+p)p\ - ppo = (l+p)ppo - ppo = p p
2 0
Similarly p and p\ may by used to express p?,, etc. which gives the general formula for p that
2 n
n
Pn = p"po = (MjU) Po (16)
The value of the normalizing probability po can be computed by using the obvious
requirement, that the sum of all probabilities must be equal to 1:
1 = 1 i v i n : = 1
Z Pn = P Q H P ' = Po ~T~ g g Po " P for p < 1. (17)
1
n=0 n=0 P
In (17) the sum of geometric series has been used. From (17) it is obvious that the traffic rate
p must be less than 1, otherwise the sum of probabilities would not be 1 (not even limited).
Inserting (17) to (16) gives the general formula for p : n
p„=p"(l-p)=(-)"(l--) (18)
jU jU
Formula (18) represents a very important result used later to obtain all the characteristics of
the M / M / l model. The relatively simple derivation of (18) was enabled by the Poisson
process assumptions used when expressing the probabilities in (11). The equations (18) may
be used directly to express these probabilities:
00 00 00 00 1
m +<! k n
TPm = Hp (\-p)=2>" d-p)=p"a-p)T,p =/>"(i-P)I—=p
m=n in-n k=Q k=Q P
17
Now the formula (18) will be used to derive quantitative characteristics (measures of
effectiveness) of the M / M / l model. (18) is the distribution of the discrete random variable
number of customers in the system (probabilities of all possible random values). So it is
possible to compute the expected value L that is the average number of customers in the
system (sometimes called L ): S
CO CO CO
L = ^ = ^ _ (19)
l-p ju-A
In Appendix 4 the mean system size L is computed directly from the generating function.
Note again, that p must be less than 1, otherwise the number of customers in the system will
grow permanently. In a similar way it is possible to find the average number of customers in
the queue LQ. We assume, that the customer being served is not a part of the queue. So n
customers in the system means that the queue length is n-l.
P
n=\ n=\ n=\ A P AP
P
hp (20)
I-P
In (20) we have used the fact, that the second sum is a complement to po and (17). Note that
(20) may be also used to compute LQ provided L is known or vice versa. It is also possible to
find an average queue length LQQ provided there is a queue. Explanation:
queue length
Area = A
•"QQ
I',
•> time
queue]. To find the conditional probability, let's use the general formula:
18
P[A/5] = — that looks in our case like that (for n > 2):
P[5]
^r P[queue length is n-l and there is a queue]
n o„
P[queue length is n-1 / there is a queue] = " -
P[there is a queue]
n=2
Using the above formula for p -y , we may find LQQ\
n q
„2 „2 „2
P P P
T in-\)p
J n
LQ _ l-p _ \ -P _\-p
L =Y (n-l)p _
QQ J n u ij
n=2
r. r. r. r. ^_2
1 2
TPn TP' V-P) P ^ P W - P ) p T,Pn
n-2 n-2 n-0 n-Q
L Q Q = ^ ~ (21)
l-p
Note that in QTS LQQ is called L . The average queue length is a parameter that represents
Q
the quality of service especially from user's point of view. Another parameters that we need
are the average time W spent in the system (sometimes called Ws) and the average time WQ
spent in the queue. These parameters are necessary for example to compute costs caused by
customers waiting for service. There is a very important the so called Little's formula, that
gives the relation between the average number of customers in the system L and the average
time W spent in the system and between the average number of customers in the queue LQ and
the average time WQ spent in the queue:
First we give the justification (not formal proof) of the formula (22): let's assume that the
average time spent in the system is W. During this time the average number of newcomers is
WA, because A is the arrival rate (average number of arrivals per unit time). So at the instant a
customer is leaving the systems, it sees (on average) WA customers left in the system.
Because in the stable state the average number of customers in the system is L, we have the
above formula. Similar justification can be given for LQ and WQ (average number of arrivals
during the time spent in the queue is AWQ, that is the average number left in the queue when
leaving the queue, that is LQ).
We assume a stable system (p <1). By observing the system at the time t, we can obtain the
following figures:
19
A(t)
We can also compute the arrival rate: A. = , A —> A for t —> oo
t
The total system time spent by all customers is given by the integral: R(t) = J N(s)ds
Similarly we can compute the following:
R(t)
Average number in system: L T , L —> L
: for t —> x
Then we have:
1 w (
P x _ 1
P
— W =^0 = (-^—)- Wp (24,25)
A 1-p ju jA-A p A 1-p ju ß-A
There is another obvious relationship between the average time spent in the system and the
average time spent in the queue, because the total time spent is made of the time in the queue
(that may be zero) and the time of the service:
w=w +- 0 (26)
(26) can also be obtained from (24). Using the Little's formula, it is possible to express a
similar relation between L and LQ by multiplying both sides of (26) by A:
L = L + —= L +p 0 0 = L +r
0 (27)
jU
Where r = p is the average number of customers being served (that of course must be less
than one). For multichannel models with c parallel channels r = A/jU= cp, see later.
r
~^ r
20
For a customer it is also important to know the probability, that the time spent in the system
(or in the queue) will be greater than a certain value. Together with the queue length this
probability represents the quality of service from user's point of view. These formulae may be
used:
w w
P[spending more than t in system] = e P[spending more than t in queue] = pe (28)
Of course the probabilities of spending less than t in the system (or in the queue) are
complements of the above values to 1. Because the time spent is a continuous random
variable, the probability of spending exactly some time t in system (queue) is zero, but using
the formulae (28), we can compute the probability that the time spent will be in a certain
interval (t\, ti)\
P[spending more than t\ and less than t2] = P[more than t\] - P[more than t2]
Appendix 6 gives the derivation of the distribution of system and queue times that are then
used to find the formulae (28).
( 1 + 2 )
Var[L]=^ T Var[L ] ^ e = V
p(2 P)
Var[W]= Var[W ]= ~
0 2 2 (29)
5.1 PASTA
In this chapter we prove an important property of systems with Poisson arrival called P A S T A
(Poisson Arrivals See Time Averages). Some theoretical models are based on system states as
seen by arriving or departing customers. So let's define the following probabilities of a stable
system (p = A/c/u < 1) without any assumptions on arrival and service patterns:
p = P[n customers in the system] = portion of time with n customers in the system
n
21
A(T) = total number of arrivals during time interval T.
A (T) = total number of arrivals during time interval T that see n customers in system.
n
It can be shown that A (T) = D (T) + d, where d e {-1, 0, 1}. As a stable system empties
n n
infinitely many times, the difference between the number of arrivals and departures is in any
time interval limited. So A(T) = D(T) + D, D < oo. Then by using the definition of arrival and
departure probabilities we have:
DJT) + d D,(T) d
„, l Ag>
= im = l i m Dip = , i m D(T) D(T) = lim DJJ) a
Generally a ^ p„. To verify that, let's consider a D/D/l system with constant arrival intervals
n
equal to 2 and constant service time equal to 1. Then clearly ao = do = 1 and a„ = d = 0, n > 0. n
For equilibrium (time) probabilities we have po = p\ = 1/2 and p = 0, n > 1. Equality holds n
Theorem 7: If the arrival process is a Poisson process and inter-arrival times and service
times are independent, then a = p . n n
Proof: Let N(f) be the system state at time t. Then we can define the arrival and time average
probabilities as follows:
=\imF[N(t)
Pn = n]
a =\im¥[N(t)
n = n /an arrival occured just after time t]
Let A(t,t+S) be the event that an arrival occurred just after time t, so we assume that <5—>0.
Then we have
Note the key step in the above derivation based on A(t,t+S) being independent of system state.
So for Poisson arrivals we have the P A S T A property and moreover we know that also
departures leave time averages. Note that in the derivation of system time and queue time
distributions in Appendix 6 we have used the P A S T A property by replacing arrival
probability by the time one.
22
6 General Results
Analysis of the M / M / l model in the previous chapter contains some results that are general.
Let's consider a multichannel single queue system possibly with limited capacity and limited
population and without any assumptions about the distributions:
GIGIclKIM
Here X is the actual arrival rate. Note that for systems with limited capacity it can be smaller
than the rate of attempted arrivals. There are c identical parallel channels with mean service
duration l/jj (service rate //) each. There are no assumptions on arrival and service
distributions. Let's also assume that the system can reach a steady state in which p = P[n
n
customers in the system]. Clearly the sufficient steady state condition is:
X r
(30)
p = — = — < 1 or X<c/u
CjU c
These are the definition formulae for the average number of customers in the system (L) and
the average number of customers in the queue (LQ):
(31)
71 = 0
Let T be the random actual time spent in the system and TQ the random actual time spent in
the queue. Then by definition:
W = MT] W =MT ]
0 0
(32)
Length (31) and time (32) parameters are related by Little's formulae:
L = XW L
Q = XWQ (33)
23
Multiplying both sides of (34) by A together with (30) and (33) gives:
L = L +cpQ = L +r Q (35)
where
r = cp = — (36)
is the average number of served customers. Note that (33) - (35) are general conversion
formulae among the four effectiveness parameters (L, LQ, W, WQ). We shall refer to them later
in various models because it is enough to derive only one of the four effectiveness
parameters. (36) gives the average number of served customers. Then the average number of
customers in one channel is r/c = p = A/(c/J) (the traffic rate). Using this we can compute the
probability ps that a channel is busy. In any channel there is either no customer with
probability l-ps or one customer with probability ps- Using these two states and their
probabilities we can compute in other way the average number of customers in one channel:
IxpB +0x(l-p ) = p
B which gives PB = A/(CJU) = p (37)
Two more general results can be found for single channel G / G / l systems. From (31) we get -
see also (20):
CO CO CO
p =l-p
0 or P = 1-P Q (39)
Note that all results in this chapter are very useful because there are no limiting assumptions
about the arrival and the service patterns.
Derivation of the M / M / l model can be generalized for systems where the arrival is still
Poisson and service exponential, but the rates depend on the system state. State diagram:
P o = P o f l ^ L (40 )
24
By using the stochastic balance and assuming stability we get:
\
Pi= — Po
Pi = ~ -Pi -Po
\ + fi 1 \ P0-—P0 " 0 ~~ " 0
p2 ji 2 .th. P2P1 A*iA*2
Similarly
p = 3 pQ SO we assume p =p \ \
n Q ,n>0
Proof by induction:
M k
p = Po\ Y[ 1 J^J P
°^ K
Y \ —
Mk+i 1=1 M ^ t + i 1=1 M 1=1 A
d
p* i=pon—
+
1=1 Mi
Note that for constant rates (40) becomes (16). See also Appendix 7 where the formula (40) is
found by balancing rates through cuts.
25
has to leave (renounce) without being served. This fact may be expressed by state dependent
arrival rates that drop to zero when the system reaches its capacity:
X 0<n<K
I,
0 n>K
n
» -nJl^L > Pn =p p (0<n<K)
0
P n P
~ ° l U J P =0(n>K)
n
Unlike M / M / l model, the models with limited capacity always reach a steady state, whatever
is the value of the traffic rate p = X/jU. The value of po can again be found from the fact, that
the sum of all probabilities equals to 1, but now the sum has a limited number of terms:
K K+l
l-p 1- p
TuPn=A>2>" = Po(-r— }=1 g i y i n g : p
° =
7 K+\
ifp* 1
n=0 11=0 1 P 1 P
K +l
By inserting p we get a formula for p :
0 n
n
p a-p)
l-p" 0<n<K (41)
v —<
1
p=l
K +l
Like with the M / M / l model the above probabilities are used to compute the measures of
effectiveness of the M / M / l / K model. So for the average number of customers in the system L
we have for p = 1:
K 1 ^ 1 (K + 1)K K
L and for p ^ 1:
= 2>«=7T-r2> K +l
n=0 iv ~r 1 n = Q
1 1 1
n=0 P n=0 P n=0 P
K + 1
Above the last two terms have been at first appended (their sum is zero) and then the third
and the second terms from right were swapped. This forms a geometric series whose sum is
the first term in square brackets, the second term is the rest. So after multiplying the two
terms in square brackets we have the formula (42).
26
K+\
P (K+l)p
K+\
I-P l-p
(42)
K_
~2
The first term in (42) is the mean size of the corresponding M / M / l model, the second term
represents the loss caused by the limited capacity. Remaining characteristics of the system
may be obtained by using the conversion formulae (33) - (35). For convenience we present a
summary of conversion formulae where each parameter is expressed by the other three (and
the basic parameters A, //, p):
L = L +p
0 = AW = AW +p 0 L =L-p Q = AW =AW-p
Q
(43)
w = -=w ,+1=^+1
t w 0 = ^ = w - - = - - -
A ju A ju A ju A ju
There is only one problem when using the conversion formulae (43). Not all systems have the
basic parameters (A, ju, p) constant. For example the M / M / l / K model changes A that becomes
zero when the number of customers in the system is K. To use the formulae (43) correctly, we
have to insert the average or effective arrival rate that we shall call A a. It is the arrival rate of
e
those customers who enter (are not rejected), so A s < A. Graphical explanation:
e
27
Maximum K-1 in queue
A
r
A ^eff
> A - A {{ e
Let PK be the probability that the system is full = probability that a customer is rejected.
K-\
X X
eff =Yu nPn = ^ P n = M£ P n ~ P) K = A (l " P )
K
(44)
n=0
The second sum is true because X = 0 and n is never bigger than K. The third term was
K
simplified because the sum of all probabilities is 1. p^can be computed by (41). Having L
computed by (42), the other three parameters of M / M / l / K models can be computed as
follows:
W
P K = ^ S = -T = l ^ r , w =w-±-
Q L =A W =Ml-p W
Q eff Q K Q
(45)
Also:
peff = —— = p(l- p)
K and L = L + p Q eff where p jf < 1 is the average number of customers
e
being served.
8 Multichannel Model
The M/M/c (multichannel) model is made of a Poisson arrival (arrival rate A), c independent
identical exponential channels with service rate JJ each, FIFO (or not specified) unlimited
queue, and unlimited customer population. In multi-channel systems customers may be
served by any channel. Selection of the channel (if there are more idle channels) is not
specified, because the four system parameters are independent of the selection algorithm. It is
possible to assume for example a random selection that will cause equal utilisation of the
channels.
28
Unlike in the M / M / l / K model the arrival rate X is constant for all system states. But because
the number of working channels may change, there is no constant effective service rate that
may also be called departure rate (number of customers served during a time unit). A l l
channels have the service rate /u (average service duration I//J), but if there are two working
channels, the average number of customers served during a time unit will be 2/u, for three
working channels 3/u, etc. until the maximum value c/u for all channels working. So we have a
state dependent service (departure) rate:
\n/i 0<n<c
[c/u n> c
n
X...X X
P=n Po=-TTPo forl<n<c
/ix2/ix3/i...n/i nl/u
X...X A"
p„ = p = n p
n for n > c
r II ~> r U • n-C II * U
/ux2/ux3/u...c/uxc/u...c/u clc /u
X
The condition for a system to reach a steady state has the form p = — <1 where p is the
c/u
traffic rate of the M/M/c model. Using p and r = cp the formulae for p may be written in the n
following way:
r
c » _ r" 0 Po
\<n<c
Pn c n
(46)
n
c~P'Po _ r p 0
•I
n> c
clc
Po
n=0 n=0 n-c+\ n =o n\ cl n=0
-1 n
g(£PT + (cpY •+ - (47)
tt, n\ c\(l-p) n=0
n\ c\(l-p) n=Q n\ c!(l-r/c)
Formula (47) is not very difficult to evaluate because c is mostly not big, the second term in
2 3
square brackets is evaluated only once, and the sum is in fact this: 1 + r + r 12 +r 16 + ... -
each term is obtained from the previous one by multiplying by v/k, k=\,2,...c. In the M/M/c
model, the queue exists only if there are more than c customers in the system. So to compute
the average queue length LQ, we have - see (31):
29
L = X (n-c)p C
= X {n-c) -p p =p^ -p, n C c £ (n-c)p" c l
=//+' c^ - ^ m ^ 1
Q n 0
• n=c+\
+1 c d P
c! ap 2>" c\ dp l-p c! (l-p)
m-1
m 1 d_
Above we used the following: £ m p 5>"
m=\ dp
_ in-I
Q
(48)
~c!(l-pf
L = L +r = L + *
Q Q W =^-
Q W=^
ju A A
independent service rate of one exponential channel, the queue is FIFO (or not specified) and
unlimited. In this model we have a state dependent arrival rate given by the following
formula:
( M -ri)A 0<n<M
A,
0 n>M
Pn=Po[[— = Po[ 1
(
A {M-n)\"
Pn=Po [M(M -1)...(M - n + 1)]
jU {M-n)\
P = Po r n! p r
0 \<n<M
n
[nlj [n J
30
Ml n
Pn = P0 r nI p r0 \<n<M (49)
(M-n)\
Scaling factor p can be found by computing the sum of all probabilities that equals to 1:
Q
f Ml r „
5> =i B
Po (50)
n=0
(50) and (49) together with (31) and (43) can be used to compute the effectiveness parameters
numerically. For single channel systems a closed formula can be found. If L is the average
number of customers in the system, then (M - L) is the average number of customers outside.
This means that the effective arrival rate is A& = AiM - L). Then the average traffic rate equal
to the average number of served customers - see (36) for c = 1 is:
A eff = A(M-L)
(51)
ju ju
A(M-L)
L =L-r„„ =L
n = L-(l-p ) 0
The last two terms represent an equation that solved for L and after inserting for LQ gives:
L = M-^(l- ) Po L Q = M - ^ ( l - P o ) (52)
W (53)
A
eff A(M - L) A eff A(M-L)
In limited population models the customers are typically machines. Then the natural
requirement is the maximum expected number of operational machines. This number can be
increased by using the so-called spares. These are machines ready to replace any machine that
breaks down. Assume that the number of spares is S. Then the above model can be
generalized as follows:
MA 0<n<S
A, (M + S-n)A S<n<M +S
0 n>M+S
31
10 Other Markovian Models
This Chapter contains basic results for several Markovian models that have not been dealt
with so far, mostly combinations of previous relaxations of the very strong assumptions of the
M / M / l model.
This model is a combination of the M/M/c, M / M / l / K and limited population models from
chapters 7, 8, and 9. Let's take logical assumptions that K> c, otherwise there would be no
queue and M > K, otherwise there would be no capacity limitation. Then we have these state
dependent rates:
where X is the arrival rate of one customer and ju is the service rate of one channel. Inserting
these state dependent rates into (40) gives:
(M-n)!
P = Pofl
n
M M
. l +
= Por" —[M(M -1)...(M — n +1)]
(M-n)!
Ml
Pn = P0 R
Po r 0<n<c
n\(M-n)\
Pn=A = Po r c<n<K
(M -n)\ c\ [nj
p =0
n n>K (54)
Closed formulae for this model are not available, the probabilities have to be computed
numerically using (55) and (54). Effectiveness parameters can then be computed by using
definition formulae (31) together with Little's formulae (33) where the effective arrival rate
has to be used:
32
10.2 Multichannel with Limited Capacity and Unlimited Population
rn
Pn = Po^~i; = Po —. 0<n<c
n 1 X 1
p =0 n n>K (57)
^4 r r (1 - p )
P^l
c-l n K r n c!(l-p)
(58)
Z-+Z—
rt-0 ** * n-c ^ u
• 2- + - ( Ä - - C + l) P=l
n=0
r cl l-p
IX
r
I c c! r = - , p = —,p = —
/J. fJC c (K-c + l) p =l
cl
Closed formulae for this model are available. We can use (31) to find the average queue
length:
K n c n n—c
L Q = X(n-c) =^Y(n-c) r Pn r and using r r - p" 0
gives:
L - n—c .c n~c c n-c
n-c+l n=c+l n c r c
c r
r r prp c
d / \ —c
prp c
d l-p K-c+l
Po P Po P 0 0
• n=c+l
I>-c)//
1=1 cl dp ;=i 5>' cl dp I-P
33
L C + 1 Kc
Q = If ^ 2 [ 1 - P ^ 2
-(l-p)(K-c + l)p ] p*l (59)
c!(l-p)
L =^-{K-c
Q + \){K-c) p =\ (59')
2c!
When using the Little's formulae (33) we have to use the effective arrival rate given here by
the formula (44). So we have:
WQ = ^ Q = — W = ± = — ^ — P K = ^ ~ (61)
X eff X(\-p ) K X eff A(l-p ) K
F K KC
C C\
Note that the results from the chapter 10.1 can be also used for multichannel with limited
population and unlimited capacity. Just replace K with M in formulae (54) - (56) because
the number of system states is limited by the number of customers only.
The M/M/c/c model is a multichannel with c channels and the system capacity c (it means no
queue). If all c channels are busy, the customer must leave without being served. For this
model the formula (58) simplifies to:
c n
Po Y- (62)
After inserting to (57) - first case - we get the following formula for p : n
Pn=^ T d
0<n<c (63)
z -
From (63) we get the famous Erlang's loss formula for n = c that also holds for M/G/c/c
models with general service time distribution. This is another useful insensitivity conjectured
by Erlang and proved later. For the proof and more discussion see book [1].
34
As the name implies it can be used to compute the probability of loosing a customer in an
M/M/c/c model for given r = X/jU. This formula was largely applied in design of old telephone
exchanges that were basically M/M/c/c systems. X was then the number of attempted phone
calls per unit time (mostly one hour) and l/ju was the average call duration. As there were
many clients, the Poisson arrival assumption used to be more or less satisfied and due to the
insensitivity it is not required for call duration.
Another problem is the numerical evaluation of the formula (for c being typically a large
r
number). One approach is to multiply the numerator and the denominator in (64) by e . A l l
terms are then Poisson probabilities - see (4) - that can be taken from tables or in Matlab
r
there is the function p o i s s p d f (c, r) that with these arguments returns re lc\. Note also that
the denominator is the cdf, so in Matlab the loss probability can be computed directly as
poisspdf(c,r)/poisscdf(c,r).
The M/M/co model deals with systems where all customers are always served immediately
(no queue) by identical exponential channels. The only interesting parameter of this system is
the distribution of the number of busy channels represented by probabilities p (where n is the n
number of customers = number of working channels in the system). Arrival rate is constant,
service rate is state dependent /j = n/u. By using (40) we get the formula for p :
n n
Note that the system state has Poisson distribution that we already know from the chapter 4.2.
From the above formula it is possible to find the probability of not more than n customers in
the system:
r
P[not more than n customers] = ^ — e~ (66)
y£=0 & !
Using (31) and simple derivation we can get the average number of customers in the system L
equal to the average number of working channels:
co ^ co ^ y.n co ^ co ^ j.m
r r r r
L = V np = e " Y n — = e ' V V
n = e~ rS\ — = e~ re = r = — (67)
=i
n =i n\
n (n-l)l n=l ml
m=Q jU
Note that for unlimited service models LQ = WQ = 0 and W= 1/jU. Similarly with the previous
model, results obtained for this theoretical model can be applied in those cases, where waiting
is not possible because of the nature of the system. The above formulae can be used for
example to find the required number of channels that will always serve a certain percentage
of customers. Self-service is another example.
Formula (40) can be used for other models with state-dependent rates. For example if we
assume any rates up to a certain state K and then constant rates with XI/u < 1, then the
probabilities and the effectiveness parameters can be computed exactly. Closed formulae are
also available for systems with 2 different service rates. Other systems can be evaluated
approximately by taking large numbers of terms of infinite sums.
35
11 Model M/G/l
The M / G / l model is made of a Poisson arrival (arrival rate X), one channel independent of the
arrival with any (general) distribution, FIFO (or not specified) unlimited queue, and unlimited
customer population. For the channel we must know the mean service duration 1/// and its
standard deviation a (note that a is the standard deviation of the service time - not of the
rate). These parameters can be obtained for example experimentally. For the M / G / l model we
can use the so-called Pollaczek - Khintchin formula that is maybe the most important result of
queuing theory for single queue systems. For LQ it is this, where p = r = A//J is the usual
traffic rate:
e M
2(1-/?) L J 2(1-/?)
Other parameters can be computed by conversion formulae (43) without any problems,
because the rates are not state dependent. The above formula is very important, because we
do not need any more the very controversial assumption of exponential service. Arrival is still
Poisson, but this assumption is typically much more acceptable than an exponential service.
Note that the output is not Poisson because of general service distribution.
Several proofs of the formula (68) exist, Appendix 8 contains the derivation based on
moments.
Model M / E / 1 k
The M / E ^ / l model is made of a Poisson arrival (arrival rate X), one channel independent of
the arrival with Erlang distribution, FIFO (or not specified) unlimited queue, and unlimited
customer population. Values of a random variable with Erlang distribution are sums of k
independent equally exponentially distributed random values. So it is represented by two
parameters: mean value of the corresponding exponential distribution (l/jU when applied to
E
service, XIX when applied to arrival) and the multiple k called shape factor. The distribution
E
is then called Erlang type k or E\ distribution. The mean value and the standard deviation of
the Erlang distribution are defined by these formulae:
2
E[X] = - = — Var[X] = a [ X ] = 4 r = - ^ (69)
ju juE ju kju
E
For k = 1 the Erlang distribution becomes exponential. For bigger k the Erlang distribution is
less and less random, for k —> co the values become constant equal to 1/jU. Erlang arrival
means registering every k-th arrival, Erlang service means being served by k equal
36
exponential services in serial. Erlang distribution is often used as an approximation of other
more general (typically experimentally obtained) distributions. Because the expected value
and the standard deviation are known, it is possible to use the Pollaczek - Khintchin's
formula (68):
Q
2(1 -p)
1 +i (70)
k
Model M / D / l
The M / D / l model is made of a Poisson arrival (arrival rate A), one channel independent of the
arrival with constant service time XIp (constant service rate //), FIFO (or not specified)
unlimited queue, and unlimited customer population. A n example of an M / D / l system can be
a car wash line, runway for planes to take off, and all other systems with practically constant
service time. Because cr= 0, the Pollaczek - Khintchin formula (68) simplifies to:
2
L =—
0 (71)
2
2(1-/7)
Model D / M / l
The D / M / l model is made of an arrival with constant intervals XIX (constant arrival rate X),
one channel independent of the arrival with exponential service (service rate //), FIFO (or not
specified) unlimited queue, and unlimited customer population. For this system the average
number of customers in the system L may be computed by the following formula:
£ = (72)
Po
p
p =\—e
Q that is sometimes expressed graphically (for 0 < p < 1).
This model is a special case of the G / M / l model that we shall deal with later.
Model D / D / l
The D / D / l model with constant arrival intervals XIX and constant service time lip. is either
unstable (for /?= Alp > 1) or it has only two states: none or one customer with probabilities:
There is no queue, the average number of customers in the system L is equal to pi, and the
time spent in the system is the service time l/p.
37
13 Queuing Networks
Queuing networks are systems that contain two or more single queue systems that are not
independent. Note that so far all systems were made of one queue; after being served the
customer had left the system. In queuing networks a customer may pass through more
services that we are going to call stations; at each station (that can be a multichannel) there
may be a queue of waiting customers. There are many practical examples of queuing
networks:
A l l theoretical models are rather complicated and all exact results are based on very strong
assumptions. In this text we present just a basic summary of results.
As the name suggests, these systems involve acyclic networks without feedbacks. It is
obvious that in order to specify the input to a station, we have to know what is the process
generated by a single queue system. We know that the output from a stable system with
unlimited capacity has the rate X, but what is the distribution? There is a very important result
given by the following theorem.
For proof see Appendix 9. This theorem suggests a simple method, assuming that all stations
with successors are M/M/c/co systems:
Use the theorems about splitting and joining of Poisson processes to find rates of input
Poisson processes of all stations. Then solve the stations separately as M/M/c/co systems.
Moreover the stations without successors can be M / M / c / K , M / G / l or anything that we can
solve. Obviously we assume stability (X < c/J) of all stations.
Theory on Open Jackson networks (1965) represents the fundamental result about queuing
networks. Using the following figure we first summarize the assumptions.
38
k = number of nodes (stations) (subscript 0 is reserved for the environment)
T
r= 0"oi ro2 ... rok) = vector of input probabilities where ro, = P[arrival to station i]
k
Obviously ^ r = 1 0i
i=l
R = \fij\ = matrix of transition probabilities
where r j = P[moving to j after service in /], i,j =1,2 ,..., k. Possibly r„ > 0
t
r,o = P[leaving network after service in /]. This figure is in fact not needed, because it
complements the sum of the i-th row of R to 1:
k
T
\i = (pi fj.2 . ..fJk) where //, = exponential service rate of one channel of station i
T
c = (c\C2 ... Ck) where c, is the number of channels in station i
T
n = (m ri2 . ..nk) is the network state vector where n, = number of customers in station i.
The above variables define the network including its topology. Note that all services are
exponential, all arrivals are Poisson. For computed figures we use these symbols:
X ,
Pi = —— < 1 = traffic rate at i. If p, > 1 for at least one i, the network is unstable.
39
In order to solve the network we need the probabilities p(n) = p of various network states. n
They can then be used to obtain various effectiveness parameters of the stations and the
whole network. First let's solve the so-called Traffic Equations to obtain values of v, and A,-.
The total input to station i is given by the input from outside and all other stations:
= r r r
\ Yi + K u + ^ 2 2 , + ••• + \ ki where Xfji is the rate of the traffic from j to i. Solution:
4 ;vZV.. i = 1, ... ,k
Using X =Av ,y = r A i i i Qi
Xv XV r 1 L X 0
i = K i + Z 3 3i = - ' >
v r v r
i= oi+H j ji i= l-,k
T T
v =r+R v => (I-R )v = r
After obtaining v we compute X and p easily. Solving the traffic equations thus provides all
figures related to individual stations. To find the probabilities of network states, we can apply
the fundamental Jackson Theorem about the solution in product form. This is the Jackson
theorem for single channel stations:
For proof see Appendix 10. The normalizing constant C = po = P[empty network] can as
usual be computed from the sum of all probabilities equal to 1:
00 GO
£ - " £ C V ? . . . A * = I
A
n =0 { n =0 k
1
^ CO CO v f V 1
ff AY 1
1
C= p „ = ( l - A ) - ( 1 - A ) = fl( -A)
p(n) = f I a - A K (74)
40
Using (74) we can compute marginal probabilities of states in individual stations:
GO GO GO GO
V
Z - Z Z - - - Z A - T # P J ^ . . / £
P[n. customers in station i] = p,-(n,.) = p p^' 0
«I = 0 n _] = 0
( n =0i+[n =0 k
GO GO GO GO
n, X 1
«1 X 1
n,- i X 1
n.-.i X 1
n t i
= n ( i - A ) A " ' n ? r - = ( i - A ) A '
PoPt L A • • Z A - i 2. A ; ; • • • Z A
«I=0 = 0
From above we see that we get the same probabilities as for the M / M / l system though
stations are not M / M / l (due to feedbacks, the inputs and services are not generally
independent). Nevertheless the equilibrium probabilities are equal, so we can use the M / M / l
formulae to compute the effectiveness parameters.
Product form solution given by Theorem 9 can be generalized to networks with multichannel
stations. Marginal probabilities are then the same as those for the M / M / c systems. Another
generalization considers classes of customers that have their own behaviour (input and
transition probabilities). This partially relaxes the very strong Markovian behaviour
assumption on Jackson networks.
From the theory of Jackson networks it follows that we can obtain marginal probabilities of
the stations and solve them as M / M / l or M / M / c systems by known formulae. Let the
effectiveness parameters of station i be L„ Wt, LQ , and WQI. Also let's repeat that v, is the {
mean number of visits to station i by each customer. Individual parameters can be arranged
into vectors:
T T T
W = (W ..W )
v k
T
W =(W ..W )
Q QV Qk
T
L = (I ...L,)
1 L =(L ...L ,)
G G 1 G v = (v ...v,)
1
k
Mean total number of customers in the network: L = ^ L.
(=i
1=1
k
= y T
Mean total time in network (sojourn time): W = Z V
* ^ W where v,-Wj is the mean time
1=1
spent by customers in station i.
T
Mean total time spent by waiting in all queues: W Q = v W where e V,-WQ,- is the mean time
spent by customers waiting in queue of station i.
k k
Probability of all stations being busy: P[all busy] = ]~~[(1- p,(0)) = Y\Pi
1=1 1=1
41
13.3 Closed Jackson Networks
ViPi Z / W / .«'=1. *
In the above one equation is redundant. We solve the equations by fixing one p , removing
one equation and solving the remaining equations for the others.
Jackson Theorem about product form solution holds, but there is a problem to find the
normalizing constant C because there is a finite, typically very large number of states. Two
algorithms to compute the constant C approximately (Buzen, M V A ) are described in [1].
For about 10 years till 1975 only Jackson networks were used to analyse mathematically
computer and other systems that could have been formalised as queuing networks. Since
1972, there were signs of possible extensions that were published in definitive version in
1975. Today these generalised networks are called BCMP networks, where the abbreviation
is made of initials of the authors (Baskett, Chandy, Müntz, Palacios). This is a simplified
overview of the extensions of B C M P networks compared with Jackson ones:
• There are classes of customers (customers of different types). A class may represent for
example a fixed path in the network.
• Network state is a vector of vectors of various lengths, because for each station (queue)
the currently present customers may have different classes.
• Movement in network is Markovian, but probabilities for various classes may be different
and a customer may change its class when moving between stations. Probabilities may be
state dependent.
• There may be a very general service made of parallel, serial, and cascade combination of
exponential/Erlang individual channels that may approximate practically all service
distributions.
• There are four possible service/queuing disciplines:
- FIFO, single state dependent server
- Time-sharing service with state dependent slices
- Sufficient number of servers (no queue)
- LIFO, single server with absolute (pre-emptive) priorities of customers
• Model with limited queues is also possible.
• Poisson arrival with a state dependent rate.
42
There are (complicated) formulae to compute state probabilities and consequently other
system characteristics.
Apart from the above exact (rather complicated) methods, there are also approximate
methods that intentionally simplify the assumptions to get maybe less accurate, but much
more simple procedures to obtain the results. For example the so-called Decomposition
Method studies stations (and their queues) independently. Instead of the joint probability p(n),
it gives the mean number of customers at each station and its response time. There are several
other methods based on forming subsystems (groups of servers) that are analysed separately
with possible further analysis of their interaction. Another method called Diffusion
Approximation uses results from thermodynamics. Movement of customers in the queuing
network is viewed as a chaotic Brownian movement of molecules. To model the network
behaviour the differential equations of thermodynamics are used.
We have found formula (40) that has been used to derive basic Markovian models. In
addition to models from chapters 7 - 10 it can be applied to several other situations. To
simplify next derivations, let's express it as follows:
n n
/L Pi
P =PoY[—
n = Po n M
where M„=]~[—
For all Markovian systems with finite number of states with maximum state K it can be
applied directly to compute the probabilities numerically, the normalizing constant is also
computed numerically by
n=\
The effectiveness parameters are then computed by definition formulae (31), to apply Little's
formulae we need the effective arrival rate computed numerically by
K-i
X
K B = Yu nPn
n=0
Moreover for single channel systems we can use formulae (34) and (38) to compute the mean
service duration directly:
_ L = i g .+ l z £ o = w + E [ r ] s o E [ r ] = IzA>
L j
i i i y i j!
A
eff \ff \ff \ff
43
For general case with infinite number of states and at least one rate permanently changing, we
can obtain only approximate solution by considering only limited (large) number of states.
There is an exact solution to systems with infinite number of states where after some k the
rates remain constant with stable traffic rate:
n-l
+ M^P"']'
in-I
1
= [1 +I X+ *
n-\ P
Definition formula (31) results in:
a. k oo Y 00
_ M d
0
L
= T Pn=H Pn Po
J
n n +
Z kP n M = L
k + P0 k M
~k~T Z L
= k P< +
„k-l
"
P dp \ +\ j
n=l n=\ n=k+\ P n=k+\ n=k
f k+\ \
1 l-p M, d M K
k
(k + l)p (l-p) k+l
+ p
Lk+Po' k 1 h+Po k 1
p- dp I-P l-p p- dp l-p (I-P) 2
Note that in QTS™ there are two models called "Infinite Birth-Death Model" and "General
State-Dependent Birth-Death Queue".
Several special cases have also been studied. In QTS™ there is an unlimited capacity single
channel model called "Simple Markov Queue with State-Dependent Service" with constant
arrival rate and two service rates switched at a given system state k:
Exact closed formulae for p and effectiveness parameters are available, for details see [1].
0
This model can be used in practical situations when for example after reaching a certain
queue length the service is given some help. Alternatively the service rate may at certain
system state decrease due to panicking and/or other reasons.
14.2 Impatience
These models try to incorporate human impatience into queuing models. There are generally
three forms of impatience. Balking is the reluctance to join a long queue, reneging is the
44
reluctance to remain in the queue after long waiting and jockeying is changing queues if
parallel channels have different queues. Models of the first two cases are available.
Balking
Reluctance to join a long queue can be modelled by state dependent arrival rate where the
basic arrival rate (valid for the empty system) is multiplied by a decreasing the so-called
balking function bin) that is the probability of joining the queue in system state n. We assume
constant service rate and other M / M / l assumptions satisfied:
\=Ab(n) ju =ju
n 0<b(n + l)<b(n)<l b(0) = l p = p (A/ju)"
n Q f\b{i-1)
(=1
In QTS™ there is the model " M / M / l with Balking ..." with two available balking functions:
1
bin) = e~ b(n)
n +1
Reneging
Leaving a queue before service can be modelled by an increasing state dependent the so-
called reneging rate r(n) added to the service rate that results in state dependent departure
rate. We assume constant arrival rate and other M / M / l assumptions satisfied:
1
A =A
n ju =ju + r(n)
n r(n + l)>r(n) r(0) = r(l) = 0 p„ = p 2"f]
0
=1 p + r(n)
,; r
n=\ V 1
(=1 "r" '
V ,=i ^r(n)
rin) = e'
where n/ju is the estimate of the waiting (system) time in state n. Balking and reneging can be
combined in one model in obvious way.
45
14.3 Bulk Input
There are situations where the assumption of single arrivals is limiting. For example people
may arrive and ask for individual service in groups, in manufacturing a number of parts arrive
to a machine on a palette and then they are processed one at a time, etc. To still make use of
the Markovian results, we shall assume that batches of various sizes arrive in separate
independent Poisson processes with particular rates, so these are the assumptions:
k=i
Ck = probability that an arriving batch has size k: c = X IX k k
The problem is that the process is not a Birth-Death process anymore because each arrival
makes a possibly long "jump" in the state diagram to the right. Without any restrictions on the
batch size, each state n can be reached by an arriving batch from all states 0, 1, ... n-l and
also from state n+l by a service completion. By an arrival to state n, any state n+l, n+2, ...
can be reached. So by using the stochastic balance approach, we obtain the following
equations:
c
Input rate to state n = p v + £ n+1 Pnk X k = p v + X^
n+1 P- k
n k
k=\ k=\
oo
Output rate from state n = p u + ^ p \ nJ n = p u + pX
nJ n
k=\
n
c n 0
Together: p (// + X) = p {i + X^ P - k
n n+1 n k > > P^ = PtM
After a (long) derivation based on two generating functions of steady-state probabilities and
batch size probabilities respectively a closed formulae are obtained:
2
p + r1&[K ] 1 J
X X~E[K]
L =^ - rr==—
— pp == — = rE,[K]<l L =L-p
Q X = XE>[K]
eff
2(1 -p) ju ju
Z L
E[K ] = k , K[K] =k,p = rK[K] = rk
2
_ p + rE[K ] _ p + pk _k + l
T
i—d — 2(1-/7)
—
2(1-/7)
— x •p
2 l-p
2
2p +(k-l)p
L q = l _ p = ... = tt-Z^L 1UL X = XE[K] = Xk
eff
2(1 -p)
Note that the first ratio in the formula for L is the increase caused by k > 1 as compared with
M / M / l and for single arrivals (k = 1) we get the L of M / M / l .
46
14.4 Bulk Service
Similarly to the previous chapter there are situations where the assumption of single services
is limiting. For example people are served in groups (various attractions), in manufacturing
the parts are processed (painted) in batches, etc. Regarding the batch size, in existing models
it is not considered random, but there is a given (maximum) batch size K. To start a service
with less than K customers in the queue there are two cases. Either the service can start with a
smaller number than K customers or it has to wait until all K customers are available for a
complete batch. Both cases have practical applications, so we consider them separately.
These systems (called Type 1 in QTS™) assume the following in addition to usual M / M / l
properties:
From the above it follows that in the state diagram end of service from states 1, 2, ... K
moves to state 0. From states n>K end of service moves to state n-K. As in M / M / l arrivals to
state n move state to n+l. This results in the following stochastic balance equations:
Ap =MPi+MP2+---
0 + VP K
n 1
p {H + X) = Ap _ + MPn+K
n n x >
The second equation takes the form that can be solved by the method of operators explained
in Appendix 11. For this purpose we rewrite it for the state n+l and assuming p \=Dp we n+ n
obtain:
K+l
[juD -(jU + A)D + A]p n =0 n>0
Let (ro, r\, ... , r ) be the roots of the characteristic equation. Then we know (see Appendix
K
K
C r
Pn=Yj i i
i=0
Since all probabilities sum to 1, it is obvious that constants C, of all roots such that |r,| >lmust
be zero. To examine the number of roots less than 1 we can use the Rouche's theorem of
complex analysis. The result is, see [1] for the derivation, that there is exactly one real root in
(0,1) that we shall call ro. So the probabilities are given by
47
n
p =Cr
n 0 «>0,0<r <l 0
To find the constant C we as in M / M / l use the fact that all probabilities sum to 1 that
provides C = po = 1 - r . So we get the formula similar to the one of M / M / l with p replaced
0
by r : 0
p =(l-r X
n 0 n>0,0<r <l
Q
L =- ^ - L =L-p
Q p =- W=- W =W--
Q
l-r0 n A n
So the only problem is finding TQ possibly for large K. You may use the function "roots" of
MATLAB.
In these systems (called Type 2 in QTS™) the service always takes K customers. So if less
than K customers are available, the server waits until there is a complete batch. This is typical
for example in various manufacturing applications. Other assumptions are the same as above.
In the state diagram the states n > K behave in the same way as above, but states n < K can
only be left by arrival and entered by arrival to state n-l or end of service in the state n+K. So
we get the following stochastic balance equations:
VP -^Pn+^Pn-l=
n+K
Q
l<n<K
jup -Ap =0
K 0
The first equation is the same as for the above case, so the solution p = Cr£ holds, but only
n
for states n> K-l. To find the constant C it is necessary to use the other balance equations.
Several methods exist, see [1].
Another version of the bulk systems has been solved. The batch size has to be in the range
[k,K], if less than k customers are available, the server has to wait. Unlike in the first case, if a
batch smaller than K is served, additional arrivals have to wait until the service ends.
In all models studied so far we made no distinction among customers. There are queuing
applications where priorities of customers have to be considered. Examples of high priority
customers are emergency patients, processes in control computers that take care of important
events, priority messages and packets in communication, etc. There are situations with more
than two priorities. We can view these systems as one (multi)channel serving several FIFO
queues made of customers with given priority. It is a rule that lower number represents higher
priority, so customers in the queue of priority n are served only if all queues for priorities 0, 1,
48
... , n-l are empty. The arrival can thus be modelled by separate independent (Poisson)
processes with generally its own arrival and service rates. It is necessary to resolve the
situation what to do if a customer arrives and a lower priority customer is served. In the so-
called non-preemptive model the current service is always completed. In the preemptive
model the lower priority service is interrupted by a higher priority arrival. This generates
other problem what to do when the interrupted customer re-starts later its service. We either
continue the preempted customer's service from the point of preemption (called preemptive
resume) or else start a new service (preemptive repeat). Note that for Markovian systems
there is in fact no difference because due to the memoryless property of the exponential
distribution the rest of the service has still the same exponential distribution.
Several modifications of the priority systems have been studied, see models available in
QTS™. A l l derivations are long and tedious because due to several subscripts involved they
are based on multi-dimensional generating functions. Next we outline the assumptions and
derivation ideas of two example systems.
So we have two separate independent Poisson processes with rates X\ (higher priority 1) and
A2 (lower priority 2), common service rate /J of a single exponential channel and p = A//J = {X\
+ Xi) //j = Ai/jU + fa/ju = p\ + pi < 1. System states are represented by three figures m, n, r
such that:
Pm,n,r = W[m customers of priority 1 in the system, n customers of priority 2 in the system,
customer of priority r = 1 or 2 in service]
State diagrams take 9 forms according to the values of these three numbers. Two most
general forms are presented next together with associated stochastic balance equations.
m > 0, n > 1
49
m > 1, n > 0
For this system the M / M / l assumptions are still valid, so the M / M / l formulae based on X, //,
and p can be used for composite effectiveness parameters ignoring the customers priorities.
Rates p\ and pi represent the percentage of time when the server is busy serving customers of
priority 1 and 2 respectively. To obtain effectiveness parameters for the two priorities it is
necessary to solve the stochastic balance equations. The following results have been obtained:
PPI p
w, w =w + -
l Ql
1-A 1-A Ju-X l
. P (\ + PPi-Pi) PP P
2 2
w,Q2 w =w +
2 Q2
\l-p){li-\)
Note that due to non-preemption the figures for high priority are not independent of low
priority customers. For example the term (1 + p - p\) > 1 in the formula for L\ represents the
increase caused by non-preempting low priority customers. The rest would be the M / M / l
system size. Also the convergence of the high priority figures requires only p\ < 1. So the
stability assumption p < 1 holds for lower priority (and the whole system). The mean waiting
of high priority customers is also longer than the M / M / l value that would have only p\ in the
numerator.
In this model we have three separate independent Poisson processes with rates X , r = 1,2,3, r
the service rates ju of a single exponential channel are generally different for the three priority
r
classes. Also X = X\ + Xi + A 3 , p = XI/JUJ + X2//J2 + X3//J3 = p\+ pi + p$ < 1. System states are
represented by three figures m, n, r such that:
p ,n,r =
m P[»* customers of highest priority 1 in the system, n customers of priority 2 in the
system, r customers of lowest priority 3 in the system]
State diagrams take 8 forms according to the values of these three numbers. The most general
form is presented next together with the associated stochastic balance equation.
50
0 = " ( A + + \Pm-l,n,r + ^lP ,n-l,r
m + \P ,n,r-l
m + MAn+1,
P,
i-l i i-1
i = 1,2,3
(I-ZAJCI-ZA,) a-5>„)
rt=l
For the highest priority 1 the above simplifies to M / M / l formulae due to pre-emption.
To solve this non-Markovian model we shall apply the approach based on the so-called
imbedded Markov chain. The random system size represents in this case a non-Markovian
continuous time stochastic process with discrete states 0, 1, ... . Within this continuous time
process we shall define a discrete time process such that the time points are arrival times with
states equal to the system size seen by arriving customers. State changes are then caused only
by customers leaving the system during the interval between successive arrivals. As the
service is independent of the system size (provided it does not get empty - see later), we have
state changes independent of the history given only by the duration of inter-arrival intervals.
In other words the assumptions of discrete time Markov chains are satisfied. These will then
be the derivation steps:
create an imbedded Markov chain and find steady state arrival probabilities {a } n
use the arrival probabilities to find the mean queue and system times
use Little's formulae to find the mean queue and system size.
Let X be the random state (system size) immediately before the n-th arrival, let B be the
n n
random number of customers served during the interval between arrivals n and n+l and let T
be the random interval (independent on n). Then we have:
51
X =X +l-B
n+1 n n B<X+l X>0
The second inequality is true because only customers present after the n-th arrival can be
served. The service is exponential, so the amount of service given already to the served
customer till the arrival is irrelevant, the rest still has the same exponential distribution. So
we can also denote the random number of customers served during an interval as B
independent on n. The probability that it takes a particular value m can be computed as
follows because departures are a Poisson process with rate ju:
Having this, we can find the transition probabilities of the imbedded Markov chain:
Above the zero case is obvious because the maximum value of j is i+l. Also note that the
formula holds only for j > 0 because then the system does not empty and the departure
Poisson process does not stop. We shall compute the probability pto as the complement to 1:
1=0
We can now arrange the transition probabilities into the one step transition probability matrix
P that defines the imbedded Markov chain. Let b be the probability of n services during an
n
inter-arrival time:
l-b bn 0 0
Q
0
k K h h
l-Th b b .
/ J k n n-\
Having the transition probability matrix, we can find the steady state arrival probabilities a =
CO
T T
(ao, fli, ... ) by solving the stationary equations a P = a , = 1. Note that adding the sum
l=o
is necessary because P is a singular stochastic matrix. From the matrix equation we get the
following:
52
k=0
a =
0 ^aj(l-^b ) k
j=0 k=0
As the equations contain infinite sums, we shall solve them by the method of operators
explained in Appendix 11. Assuming = Dat we can rewrite the above equation for i > 1 as
follows:
2 3
a - {a _^b + aJb + a b + •••) = 0
t t 0 { M 2 a _ (D-b -
t { 0 Db - D b - D b
x 2 3 )=0
CO
n=0
We know that b is a probability, so the second term is the probability generating function of
n
the probabilities {b }. Let's call it p\z) after changing D to the usual z. So we have:
n
n=0
We have already found the formula for b , so we can insert it for P(z):
n
n n ,z z)
J3( ) = Yb z
Z n =X f , z a{t)dt = \e* a(t)dt = \e"e" a{t)dt = \e^ dA(t)
Next we compare the above with the definition formula of the Laplace-Stiltjes transform by
considering only non-negative values of t:
•r:
st
A\s) = \e- dA(t)
0
By inserting s = ju(l-z), we get our formula. So we can express the characteristic equation by
using the LS transform of the cdf A(t):
t
z= A ( u(l-z))
J
Next we show that the equation p\z) = z has exactly one root TQ in (0,1) because only this root
can have a nonzero constant in the solution for the operator. For the function P(z) we get:
CO CO CO
0 2
AO) =b < 1 0 A D = I>» =1 PXz) = 2> ^ n > = 2>(" "*)V~ >0
53
So P(z) is for z > 0 an increasing strictly convex function because all probabilities b are n
positive. Solving the equation p\z) = z can be expressed as finding the intersection point of
the functions y = z and y = fi(z). Graphically:
We can see that there are two cases that differ by the value of J3'(l) and we also note the
following:
x
u 1
/?'(!) = y]nb = E[number of completed services during an interval]=uIE[interval]= — = —
n
n=l X P
No solution case has P\\) = IIp< 1 that is an unstable system with p> 1. So the condition of
the solution case with exactly one root in (0,1) is the system stability p < 1. The solution for
arrival probabilities is then
a =Cr; n>0 n
CO CO -i
Again we see the analogy with the M / M / l formulae, so they can be used to compute the
effectiveness parameters at arrival times L , L Q , WA, WQA. The first two are not very useful
A A
because they are the mean system and queue size seen by arriving customers. Fortunately the
other two are the actual mean system and queue times because in their derivation we have
actually used the arrival probabilities a - see Appendix 6. So having WA = W, WQA = WQ we
n
can use Little's formulae to compute L and L by using the (actual) arrival rate X. For
Q
1 /
W= W= N 2 L=M =- ^ - L N = W N = - ^ -
Q 6 6
fi(l-r ) 0 Kl-r ) 0 l-r 0 l-r 0
One problem remains, computation of TQ, because for many distributions we cannot find the
LS transform A of the cdf in closed form. It is easy for discrete distributions because the LS
definition formula takes the summation form and the characteristic equation becomes:
GO
Mt (l z>
z = A\ju(l-z)) = ^ e- - -
i
i=l
54
This algebraic equation can be solved numerically, for example by the function "fsolve" of
M A T L A B where we take a starting point close to 0.
Systems D/M/l are a special case with constant inter-arrival time T = XIX. In the above
algebraic equation there is only one term, so we solve
(l-z)
n z) p
z = A\ii(\-z)) = e-» '- or z=e
p p
l-q = e or q = l-e with root q =1- r
Q 0
Effectiveness figures are then computed as follows, see also (72) in chapter 12.
1
W =± - W =
Q -^ L = XW=?- L =XW =^-^-
Q Q
/jq 0 juq 0 q Q q Q
- A group of models exist for Erlang arrival and/or service. These models are based on the
fact that Erlang distribution is a sum of exponential distributions, so the processes can
still be treated as Markovian. These models can be used for example as an approximation
of systems with general (empirical table) distributions because by changing the shape
factor we can choose a distribution close to the empirical one. Also systems where
Poisson arrivals are distributed circularly to several services and/or systems where the
service is made of several exponential stages fit exactly the Erlang assumptions.
- Models for other non-Markovian models are available. Some are based on iterative
algorithms, some on approximations: M/G/c, M/D/c, G / M / l , H / M / l (Hyperexponential
arrival), G/Ek/1, G / H / l , G / G / l (approximation only).
55
is using visual environments that support fast creation of simulation models without
programming. Programmed simulation is necessary for dynamic systems with changing
topology, situations where speed is important like applications where a simulation model is a
part of an on-line system, or various special applications like simulation-based optimization.
References
[I] Gross, D.- Harris, C M . (1998) Fundamentals of Queuing Theory, John Wiley & Sons.
[2] Cohen, J.W. (1969) The Single Server Queue, North Holland.
[7] Newell, G.F. (1982) Applications of Queuing Theory, Chapman and Hall.
[8] Gelenbe, E. - Pujolle, G. - Nelson, J.C.C. (1987) Introduction to Queuing Networks, John
Wiley and Sons.
[10] Banks, J. - Spoerer, J.P. - Collins, R.L.: (1986) IBM PC Applications for the Industrial
Engineerer and Manager, Prentice Hall.
[12] Kelton, W.D. - Sadowski, R.P. - Sadowski, D.A.: (2002) Simulation with Arena,
McGraw-Hill.
[13] Pidd, M . (1992) Computer Simulation In Management Science, John Wiley & Sons.
nd
[14] Bratley, P., Fox, B.L. and Schräge, L.E. (1987) A Guide to Simulation - 2 Edition,
Springer
[15] Banks, J., Carson, J.S. and Nelson, B. (1996) Discrete Event Simulation, Prentice-Hall
Inc.
[16] Chen, H., Yao, D.D. (2001) Fundamentals of Queuing Networks, Springer.
[17] Tijms, H.C. (2003) A First Course in Stochastic Models, John Wiley & Sons.
56
Appendix 1: Proving formula (4) by induction
3. We show that if the formula holds for k, it also holds for k+l. To show that we insert (4)
with n replaced by k and k+1 respectively in (3):
dp JO
' --Ap (t) k+l + Ap (t) k
dt
d_
-A e +A e
dt (k + iy.
K j (jc+ 1)1 kl
k+l
A (k + l)t k
_ lt (At) k+l
_ xt (At) k+l
-z,AW k
_ lt
e H (-A)e =-A e +A e
(k+iy. (k+iy. (k + iy. k\
k
AXtf _ (At) _ u u
A e =A e •
kl kl
We define the generating function P(z,t) for a discrete random variable with probabilities p (f) n
by:
2
P(Z, t)=Y,Pn (OZ" = P (t) + (t) 0 Pl Z + P (t)Z 2 + ...
n=0
where z is generally complex, such that |z| < 1. The above is a generalization of the formula
for "probability generating function" of a discrete random variable taking values on some
n
subset of non-negative integers P(z) = ^ p z n by adding the time parameter. First we show
n=0
why obtaining P(z,t) solves our problem. By differentiating P(z,t) and inserting z = 0, we
obtain the required probabilities:
dP(z,t)
[ (t) + 2zp (t) +
Pl 2 ..] = (t)z=o Pl
dz
2
d P(z,t) P"(0,t)
2
[2p (t) + 6zp (t) + ...] = 2p (t)
2 3 2 (t)
Pl
dz
n
d P{z,t) n
P: \o,t)
nlp (t)-->p (t)
n n
dz" J=0
57
Moreover by inserting z = 1 in the first derivative, we obtain the expected value. Note that N t
dP(z,t)
= [ (t) + 2p (.t)+3p (t) + ...] =
Pl 2 3 Y,np (t)=E[N ]
n t
cz
To find the function P(z,t) let's first rewrite the differential equations (3):
l l ]
Z p[(t) = -A (t)z +Ap (t)z
Pt 0
00 00 00
n n
ZP'AOZ" =-AY (t)z +Y A _ (t)z
jPn J Pn l
2
P(z,t) = p (t) + p (t)z + p (t)z {) x 2 +...
/ > l : n 2
' ' -p' (t) + p[(t)z +
0 P 2' (t)z +.
ct
The first sum on the right is P(z,t), the second sum can be arranged as follows:
n 1
X A/v, (t)z = Az^ P„-\ (Oz- , (let m = n-1)
n=\ n-1
n m
f A _ (t)z =A f P (t)z =XzP(z,t)
j Pn l Z J m
m=0
^ ^ l l = -XP{z,t) + XzP(z,t)
dt
P\z,t)-A(z-l)P(z,t)=0
Hz X)t
P(z,t) = ce ~ ... prove by differentiation.
58
To find the constant c we assume i arrivals already registered at time 0 (generally time origin
can be placed anywhere).
p„(0) = 0 ...i*n
p„(0) = l ...i = n
00
B
P(z,0) = 2> (0)z =z'' B
l
Also P(z,0) = c = z
Kz X)t
Together P(z,t) = z''e ~
Next we shall assume that the system is initially empty (i = 0): P(z,t) = eMz-\)t
1 d"P(0,t)
P (0
n
n\ dz"
Az
P(z,t) = e 'e-
d"P(z,t) n X7X M
\At) e e
dz"
(AtY
A
p„(t) = —7~e~ ' where n = 0, 1 , o o
n\
We can use P(z, t) to generate the moments directly. First the expectation:
dP(z,t)
^np (t) n = E[N,]
dz =1 n=l
dP(z,t) lz Xt
{At)e 'e =>E[N,] = At
dz
2 1,-2
^f^ = 2p (t) + (3)(2)p (t)z + (4)(3)p (t)z +...
2 3 4 = ^n(n-l) (t)z
Pn
n-2
dz
2
d P(z,t) 2 Azr -At
2
dz
2
d P(z,t) : 2 n{n -1) p it) = E[/V, (/V, -1)] = (At) e e~ |2 Xzt M
= (Ar) 2
n
2
dz H 2
59
Now we compute the variance Var[N ]: t
2 2
Var[N ] = t E[N ]-(E[N ])
t t
2 2
WN, (N, ~ 1)] = MN ~N,] = MN ] - WN ] t
2
Var[N, ] = E[N, (N, -1)] + E[iV, ] - (E[N, ])
2
Var[N,] = (Atf + At-(At)
2 _ 2
Var|W,] = Y n ^—-e * -(Af) = ^ cr[N ] = JVar[iV,] = y[H
t
^ «!
3. We show that if the formula holds for k-l and k, it also holds for k+l. To show that we
insert (16) with n replaced by k-l and k respectively in (15):
Pn+i =
1
C + P)Pn ~ P P„-i (multiply both sides by z")
u s e
(Pi= P P ) Q d later
n
P +i "
n
z
= (1 + P)P„z" ~ P P„-iZ (make equal subscripts and exponents)
l n+l n n x
zp z n+l = (l + p)p z n -pzp _{Z ~ (sum both sides for n = 1 ... oo)
n
GO GO GO
z_1
Z = c +p)Z
1
- p^Z /vi*" -1
m m
£ P m z = P ( z )- P o - Pl z £ p „ z " = P(z) - P o £ p m z = P(z)
rn-2 n-l m-Q
60
_1
z [P(z) - pp z - ] = (1 + p)[P(z) -
Q Po p ]-pzP(z)
Q
l
z~'P{z) - pp - z~ p =P(z)-
Q Q p + pP(z) - P P
0 q - pzP(z)
i i
p (\-z )
0 = P(z)[l + p-p -z- ] Z (xz)
2
P (z-l)
0 = P(z)[z + zp-p z -l]
P(z) = - ^ -
l-p z
00
n=0
Po
Also P ( l ) 1 => Po = X
~P
1-p
Together where p = —
1- pz
To find the system state probabilities p we can differentiate P(z) and insert for z = 0 (see the n
1 2
P(z) = ( l - p ) : :(1-/>)(1 + P Z + (P Z) +...)
l-p z
00
P(z) = £ ( l - p ) p V
«=0
As with the Poisson process we can use the function P(z) to find directly the mean system
size L. Generally, assuming that N is the random system size:
dP(z)
=Y n =wm=L
j Pn
=1 17 = 1 =1
: n=\
So in our case:
1-P
P(z)
1 - pz
-(-pz)
= (l-p)
fife ^ (1-pz) 2
: =1
1-P //
61
Appendix 5: Obtaining equations (14) by the stochastic balance method
Consider the state n. In equilibrium the total "flow" into n and out of n must be equal. In
other words the rates of entering n and leaving n must be equal. To express these rates, let's
define the following:
v
v '
total no. of leavings state n per unit time = leaving n rate
Similarly:
Together:
p A + p U = p .]A + Pn+lfJ,
n nJ n
Let Wo{t) be the cumulative distribution function of the random variable TQ = time spent in
the queue and similarly let W(t) be the cumulative distribution function of the random
variable T= time spent in the system. These cdf s may look like that:
62
Po--
-> t > t
Note that WQ(J) is a general random variable with nonzero probability of waiting time 0.
First we consider the M / M / l system in order to find formulae (28). We know that for this
system we may use the so-called P A S T A property that says that arrival (and departure) and
time probabilities are for systems with Poisson arrival equal: a = p . See chapter 5.1. for
n n
related theorems.
W(t) = P[system time < t]= P[ (1 service < t) A (system empty at arrival)] +
Note that above we use the fact that the rest of the service that is on at arrival is still
exponentially distributed due to the memory-less property of the exponential distribution. To
express the probability in the above formula we need the so-called Erlang distribution that is
the distribution of the sum of k exponentially distributed variables with expected values l/Ak
each (rate Ak). The expected value of Erlang distribution is then k(\IAk) = XIX (rate X). The
parameter k = 1, 2, 3, ... is called the shape factor. The probability in the above formula is
then the cdf F(t) of an Erlang distribution for k = n+1. In the next derivation we use the
known pdf/(0 of the Erlang distribution modified for the expectation 1/A:
Xk(Xkt) lkt
fit) —e ,t>Q [f(t) = 0,t<0l F{t) = \f{x)dx
(k-l)l
In our case each exponential service has the expectation l/jj, so we have to insert Ak=/u:
63
Xk = p ^ m = ^ K - e "
(k-iy.
n=0
J p"(l-A>
W ( 0 = (1 - p^e^e^dx = (1 - p)//JV M 1
- p )
<&
By integration we get:
1
W(t) = (l-p)fi -fu(l-p) __| ° - 1 _ ~f»(X-p)
e e
M M { l)
W(t) = l-e =l-e =\-e' "- cdf,f>0
t( l)
w{t) = {n-X)e >'- pdf,f>0
(/ 1)
P[r>f] = l - W ( 0 = e"' '"
w
Above T is the random system time. By inserting for W = we get P[T >t]-e which
is the first formula of (28).
P"(l-P)
{ (n-1)!
64
M(1 p)t
W (t) = l-p
Q e~ - cdf, t > 0
M(l p)
w (t)=pp(l-p)e- - '
Q pdf, t > 0
Ma p)
P[T Q >t] = l-W (t) = p e~ - '
Q
w W q
P[X >t] = p e
e =p e which is the second formula of (28).
Having the distributions, we can also compute the quantiles, so we can answer questions like
"what is the maximum time for 80% of customers to wait?". Let the quantile level be a. By
using WQ(/) we get:
M(1 p)t
W (t) = \— p e
0 " =a => t = — Similarly for the system time.
Now we assume that the system is a multichannel with possibly limited capacity, so in
general P A S T A does not hold. Also for multichannel waiting occurs only if arrival occurs in
state n > c. So we get the following:
As above we express P[ (n-c+l services completed by t)] by the cdf of the Erlang distribution
with shape factor n-c+l with underlying exponential rate cp (for n > c all channels work):
p cp(cpx)"
F(t) = \f(x)dx =\ dx
(n-c)\
A
Also P[no waiting] = P[system size < c at arrival] = Z «
71=0
Together we get:
c-l
r cp(cpxf CMX
~ dx
n=0 (n-c)l
65
Further derivation depends on the particular system type (M/M/c, M/M/c/K), see [1].
P[arrival to occur]
P[arrival to occur]
= l i m # ^ ^ = lim/ & ^ = 4 ^ =^ n<K , a =0
K
'K
ra-0 n=0 ^ rt-0
We prove the formula (40) by balancing rates through a cut between two states in the state
diagram. As a stable system empties infinitely many times, the rates of moves from left to
right and vice versa are for all cuts equal.
An h /
A-n-l ^
0
L Mi
1 n-l) )«
Mn+l
\ n+l)
So for the cut between states 0 and 1 we get:
PA = PiMi - Pi = — Po
M
PA
.
= P2M2 =>
A,
Pi =—Pi
/LA
=^ ^P L
0
jU 2 fij^
PnK ~ Pn+lMn^ Pn + Pn
M„
+1
By induction we see that (40) holds for n = 1, 2. Assuming that it holds for n = k, we insert in
the above equality to show that (40) also holds for n = k+l:
I. Pi * A. A.
D
p k + i=^p k =—PoT\—=PoT\—
f*k+i Mk+i 1=1 Mi 1=1 Mi
66
Appendix 8: Derivation of the Pollaczek - Khintchin formula
Let's observe the system at departure times. Then we define the following:
fO n=0
n' = n-S(n) + j where 5(n) = \ (8.1)
[1 n>0
The idea of the derivation is that at equilibrium the departure (and the arrival) probabilities
are equal to the time probabilities (PASTA) and so the moments are also equal:
2
E[n'] = E[n] = L and E[(n ') ] = E[n ]
2
Next we find the first two moments of j. Let f(t) be the probability density of the service
duration. Also IE [/TV] = At is the expected number of arrivals provided the next service takes t.
Then we get:
GO oo
E[ j ] = JMj/t]f(t)dt = AJtf(t)dt = A/jU = p (8.2)
Above the second integral is the expected service time equal to l/ju. Note that the same result
would be obtained for a discrete service distribution. To find the second moment, we use the
well-known formula for the variance, here applied to the number of arrivals during t:
2 2
E [ / /1] = Var[ j 11] + (E[ jl t]) = At + (At)
The above is true, because the number of arrivals has Poisson distribution for which the mean
and the variance are both equal to At - see (6). Now we can compute the second moment:
cc cc cc cc
2 2 2 2 2 2
E [ / ] = JE[j /t]f(t)dt = \(At + (At) )f(t)dt = \(At)f(t)dt + A \t f(t)dt = p + A E[t ]
0 0 0 0
2 2 2 2 2 2 2 2
Wf] = P + A (Var[t]+(E[t]) ) = P + A (a + (1/ju) ) = p + A a + (A I ju)
2 2 2 2
E[j ] = p + A a +p (8.3)
67
2
We shall also need the expectation of 6{n) and 6 (n) that are equal by the definition of 6{n).
By taking the expectation of both sides of (8.1) we obtain
Next we use the fact that the moments od n and n' are equal and from (8.2) we get:
2
E[S(n)] = E[S (n)] = p (8.4)
2 2 2
E[(n') ] = E[n ] + E[S (n)] + E [ / ] - 2E[n£(n)] + 2E[n/] - 2E[£ j]
To simplify, we use the following: E[n/]=E[n]E[/] for independent n and 7 and similarly for
Sj, nSin) = n by the definition of 6 and equations (8.2) and (8.4):
2 2
E[(n') ] = E[n ] + p + E [ / ] - 2E[n] + 2E[n]E[j] - 2E[^]E[ j]
Next we cancel the equal second moments and applying (8.2), (8.3) and (8.4) we get
2 2 2 2 2 2 2 2 2
2E[n](l - p) = E[j ] + p - 2p = (p + X a + p ) + p - 2p = 2p(l -p) + X a +p
2 2 2
2p(\-p) + X a +p
E[n] = L P+
2(1 ~P)
Let T be the random time between successive departures whose cumulative distribution
function C(t) we want to find. Let's also define:
N(t) = number of customers in the system at time t after the last departure. In steady state
F[N(t) = n]=p n at any time.
We can use the probabilities F (t) to compute the marginal probability F[T > t] and C(t):
n
So by finding the probabilities F (t) we solve our problem. We use the differential approach
n
as we did with the M / M / l model, again for simplicity most o(f) terms are omitted:
68
F (t+dt) = F[N(t+dt) = n A T > i\ = o{i) +
n
P[no arrival during dt] P[no departure during dt] P[n in system at time t] +
P[one arrival during dt] P[no departure during dt] P[n-1 in system at time t] n > 0
Again we rearrange the above terms, take the limits for dt —> 0 and by using the definition of
derivatives we obtain the following set of differential equations:
lt
solution F {t) = p e~
n n whose validity we prove by inserting in the above differential
equations. To find F _ {t) andF '(Owe use the formula (46) for equilibrium probabilities of
n x n
A jun
p n 0<n<c Pn-i 0<n<c p n 0<n<c
Pn
jun
Of Pn-X
T
A" A uc
— Po n>c — P»-i n
^ c
— p n>c
lfc\c n
A "
Xt
^-pe 0<n<c
A " -Xt
F
n- 0) = P -^
l n
F \t) = -A.p e
n n
l*c -X,
— pe n>c
A "
Inserting into the differential equation, first case gives:
M At lt -Xt
K V) = -hp e n =~{A + u)F (t) + AF _ (t) = ~U + Cju)p e
Cj n n { n +A^- p e-n = -Ap e
n
The second case differs only by n replacing c and validity for the third case is obvious. Now
we can compute the required cdf C(t):
69
C(t) = 1- £ F n (0 = 1 - £ p e-» H = 1 - e"* X A = l - -if«
n-0 « = 0 H-0
So the intervals between departures have exponential distribution with rate X and hence the
output is the Poisson process which proves the Theorem 8.
Let's start with notation in order to simplify the stochastic balance equalities:
n/+ = (m, ... ,n,-+l, ... tik) compared with n, one more customer in station i
ni- = (m, ... ,n,-l, ... tik), m > 0 compared with n, one less customer in station i
n/+j- = (m, ... ,n&\, ... ,n.j-l, ... nt), rij > 0 compared with n, one more customer in station i
and one less customer in station j.
To prove Theorem 9, we show that the network state probabilities satisfy the stochastic
balance. Let /„ be the total arrival rate into the network state n. Then
I = 'Y_ YiPm-
n l transitions caused by one arrival to network
;=1
k
+ J r
^ / i ioPm+
l transitions caused by one departure from network
k k
+^ ^ fJ r p _
i ij ni+j transitions caused by moves among stations
Er=tftf...p?, P n = C R \ P n i _ = ^ , p ni+ = P n P i , P n i + j . = p A , P = ~
Pi pj Mi
K = o n
n
We divide both sides by positive CR and we insert for p, and pf.
70
A
1=1 A 1=1 M 1=1 ; = l , j ^ ' M j 1=1
* ft
i=l 7=1,1* 7
rd
In the 3 sum we change the summation index to i and we join the three sums:
k k
1=1 A; A; j-\
This simplifies to ^ ^ / l , = =A •
/-1
Let's assume a sequence {CIQ, a\, ...} such that the items are linked by a n+1 = Da n ,\fn>Q
where D is a linear operator. As a n+m = D'"a , Vm, n > 0 and D° = 1 then a linear difference
n
equation
('n+k
n+k C D > = 0
Ca + C a
n n n+1 n+i +••• + C a n+k n+k = £C fli =0 can be re-written as £ i " K
V ;="
Let the roots of the algebraic characteristic equation V C . D ' " =0be r\, r , ... , r . Then the 2 k
i=n
k
solution to the above difference equation is a = V d , . / f where J, are constants to be found by n
1=1
boundary conditions. To verify this claim, let's first show that any single term d r" of the sum
is a solution to a . Inserting in the difference equation gives:
n
71
It is true since r, is a root of the characteristic equation. Similarly inserting a = ^d r" gives n t
0
i=n y'=l 7=1 i=n 7=1 V, V i=" yy
A s an example let's use this method to find the steady state probabilities o f the M / M / l
system. Equation (14) for n > 0 with n replaced by n+l takes the form
2
[liD -(A + v)D + A] Pn =0
n n
So the solution is p =d (l) n 1 +d 2 • d + d p . A s the boundary conditions we use the
l 2
second part of (14) for n = 0 and sum of all probabilities equal to 1. W e see that d\ = 0,
n
otherwise the sum of probabilities does not converge. So P n = d p and for n = 1, =
2 Pl dp .
2
n
From (15) we have that p = pp , so d = l 0 2 P o , Pn = pp 0 that is (16).
72