Spe4 Modeling Queue
Spe4 Modeling Queue
© 2023
Nguyen, VM. Man ‡
Tran, Van Hoai and Nguyen, Phuong Duy †
‡ Faculty of Science - Mahidol University
† Faculty of Computer Science & Engineering - HCMC University of Technology
CHAPTER 4: Stochatic Processes
WEEK 4: Probabilistic Modeling of Queues
Stochatic Processes
WEEK 4: Probabilistic Modeling of Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
1. The figure looks simple, but in fact Queuing Systems (QS) is critical for Design Optimization.
2. Since knowledge of queues can directly be used to solve the optimization problems of system
design and capacity planning,
as determining the number of servers, the number of queues, the system architecture,
an optimum queuing discipline, a schedule for service...
SPE needs both Discrete & Continuous random variables?
E[𝐴(𝑡)]
𝜆𝐴 = 𝜆 = = arrival rate Arriving process
𝑡
1
E[𝐼] = = = mean inter-arrival time Arriving process
𝜆
𝜇 = service rate Service process
1
E[𝑆] = = mean service time Service process
𝜇
𝜆𝐴
𝜌 = = utilization, system’s
𝜆𝑆
(or arrival-to-service ratio) performance
Jobs are sent to a printer at random times, according to a Poisson process of arrivals, with a rate
of 12 jobs per hour. The time it takes to print a job is an Exponential r. variable, independent of
GUIDANCE for solving. The problem’s inputs give us a summary in the above data table.
(a) When is it expected to be printed? A job is sent to a printer at noon, i.e. 12:00.
1
The mean service time E[𝑆] = = 2 minutes, hence that job should be printed on 12:02.
𝜇
(b) Require the fact that arrivals follow Poisson process, studied next. ■
AIM: We now determine performance measures from the description of the system.
Six important performance measures of a stable system use random variables below.
𝑆=𝑠 service time per one customer mean E[𝑆] = 1/𝜆𝑆 = 1/𝜇
Most of the time, our goal is to find the distribution of 𝑋(𝑡), the total number of jobs in the
system. The other characteristics of a queuing system will be assessed from that. As a result, we
shall obtain a complete performance evaluation of that queue.
𝑝𝑛 = P[ there are 𝑛 jobs in the system in the long-run] = lim P[𝑋(𝑡) = 𝑛].
𝑡→∞
For a queuing system in statistical equilibrium, the departure rate is equal to the arrival rate,
hence the throughput is
𝜆 = 𝜌 · 𝜇. (4.3)
Little’s law hence can be used for a system or any part of the system.
relateing expectations of the number of jobs, the response time, and the arrival rate.
Meaning Little’s law requires no assumptions about arrival or service time distribution, the size
of population, or limits on the system. Here we view
DISCUSSION.
First, E[𝑅] must be interpreted as the mean time in the system for customers that actually “enter”
the system (and not include customers that were turned away).
Second, the average rate of departure from the system (if the system is stable) is also 𝜆𝐴.
This is called conservation of customers, whereby customers are neither created nor destroyed;
therefore the average customer entering rate equals average customer departure rate (if the
system is stable).
We call this Rate-equality Principle for queuing systems.
Third, Little’s law requires no assumptions about arrival or service time distribution, the size of
population, or limits on the system.
■ EXAMPLE 4.2.
If the average system time (staying in a system of a customer) is 2 hours, and customers arrive
at a rate of 3 per hour then on average, there are E[𝑋] = 𝜆𝐴 E[𝑅] = 3 · 2 = 6 customers in the
system during time length 120 minutes.
(2) (Queue in a bank). You walk into a bank at 10:00. Being there, you count a total of
10 customers and assume that this is the typical, average number. You also notice that on the
average, customers walk in every 2 minutes.
When should you expect to finish services and leave the bank?
GUIDANCE for solving. We have E[𝑋] = 10 and 𝜇𝐴 = 2 min. By the Little’s Law,
E[𝑋]
𝜆𝐴 E[𝑅] = E[𝑋] =⇒ E[𝑅] = = E[𝑋] 𝜇𝐴 = 20 𝑚𝑖𝑛
𝜆𝐴
So, your expected response time is 20 minutes, and you would leave at 10:20. ■
Consider problem
A monitor on a disk server showed that the average time to satisfy an I/O request was 100
milliseconds.
The I/O rate was about 100 requests per second.
What was the average number of requests at the disk server?
HINT: Using Little’s law, the average number of requests in the disk server
Compute
Knowledge box 4.1 (We compute the pdf of the Poisson arrivals by Theorem 3.1.).
by the stationarity of the increments, so this distribution completely characterizes the entire
process. ■
Exponential systems
We use the term exponential systems to refer to queue systems in which the inter-arrival
time and service time both have exponential distributions.
4.2.1 Exponential systems in SPE- The M/M/1 queue with Key results
The simplest exponential system is referred to as the M/M/l queue. The M/M/1 briefly is a
system where i) it is equipped with a single server,
ii) the service process is exponential (denoted by the middle M), and
This implies that the inter-arrival times between events are exponential, see Theorem 4.1.
Let 𝐴𝑛 denote the time when the 𝑛-th customer arrives, and thereby
𝐼𝑛 = 𝐴𝑛+1 − 𝐴𝑛, an interarrival time (between the 𝑛𝑡ℎ to the (𝑛 + 1)𝑠𝑡 event),
⏞ ⏟
𝐴𝑟𝑟𝑖𝑣𝑎𝑙 𝑡𝑖𝑚𝑒𝑠 0‖ − − − − − −An − − − −An+1 − − − − −− 𝐴𝑛+2 − −− >
In = An − An−1 ↑ 𝑆𝑛+1 ↑
3. The arrival process and the service process are independent of each other. ■
In addition, the server adopt a work-conservation policy; that is, the server is never idle when
there are customers in the system.
If the arrival times 𝐴𝑛 form a Poisson process with arrival rate 𝜆, then the inter-arrival times
{𝐼𝑛 = 𝐴𝑛 − 𝐴𝑛−1 : 1 ≤ 𝑛 < ∞} are independent and identically exponentially distributed, i.e.
they follow a common exponential variable with the above parameter 𝜆.
Mathematically, the i.i.d. series {𝐼𝑛} ∼ 𝐼 = Exp(𝜆) has the common cdf
If the inter-arrival times {𝐼𝑛} are iid exponentially distributed with an arrival rate of 𝜆, with
a cdf 𝐹 (𝑡) = P[𝐼𝑛 ≤ 𝑡] = P[𝐼 ≤ 𝑡] = 1 − 𝑒−𝜆𝑡, a mean E[𝐼𝑛] = 1/𝜆 and pdf 𝑓𝐼 (𝑡) = 𝜆 𝑒−𝜆𝑡,
then the number of arrivals 𝑁 (𝑡) in the time interval [0, 𝑡) forms a Poisson process with
parameter 𝜆 𝑡.
An arriving process follows Poisson random variable Pois(𝜆) if and only if the time differences
of consecutive arrivals follows exponential random variable Exp(𝜆).
both the inter-arrival times between customers {𝐼𝑛 : 1 ≤ 𝑛 < ∞} is exponential, and
Arrival process is a Poisson process or Poisson stream. Moreover, by Knowledge box 4.1
the number of arrivals 𝑁 (ℎ) = 𝑘 over a given interval (𝑡, 𝑡 + ℎ) has a Poisson distribution
(𝜆 ℎ)𝑘 𝑒−𝜆 ℎ
P[𝑁 (ℎ) = 𝑘] =
𝑘!
Inter-arrival time 𝐼𝑛 = sequence of IID (identically and independently distributed) and exponen-
tial r.v.
■ EXAMPLE 4.3.
Suppose that people immigrate to a country at a Poisson rate of 𝜆 = 1.5 persons per day.
GUIDANCE for solving. Due to Equation 4.7 we see that the inter-arrival times are i.i.d. random
1. The expected (mean) time E[𝑇 ] until the 100𝑡ℎ immigrant arrives: the time 𝑇 from the beginning
100
∑︁
until the 100𝑡ℎ arrival is 𝑇 = 𝐼𝑗 , so the corresponding E[𝑇 ] (known the expectation sum is
𝑗=1
additive)- is E[𝑇 ] = E(𝐼1 + . . . + 𝐼100) = 100 * E(𝑌 ) = 100 * (1/1.5) = 66.7(𝑑𝑎𝑦𝑠).
2. The probability that the elapsed time between the 100𝑡ℎ immigrant and the next immigrant’s
arrival exceeds 2 days: 𝑃 (𝐼101 > 2) = 𝑒−1.5.(2) = 𝑒−3 = 0.4979.■
NOTE: About the role of time unit and rate in modeling time-dependence systems
in mass service theory (Queuing Theory).
in a time interval
(𝜆)𝑛 −𝜆
Probability pdf: P[𝑋 = 𝑛] = 𝑒 cdf: 𝐹 (𝑡) = P[𝑋 ≤ 𝑡] = 1 − 𝑒−𝛽𝑡
𝑛!
distribution or the survival function
A) Use Poisson: What is the probability the trains at a station depart less than two trips in 20
minutes?
B) Use exponential: Assume that 𝛽 = 𝜆 as above.
If use time unit in minute now, what is the probability we complete a homework between 5
and 8 minutes, assuming the rate of completing 1 homework is 𝛽?
A) Denote 𝑋 the number of trains departing from the station. What is 𝑋? what is 𝜆? Shall we
compute P[𝑋 < 2]?
B) We should suitably utilize essential differences between Poisson and exponential distributions.
We study the mean number of jobs and few key relevant performance indexes of simple queue
with one server (being either exponential system or not).
Let the transient-state 𝑋(𝑡) be the number of jobs in the system at time 𝑡, and
Theorem 4.3
We have the following results ♡
𝑛
(︀ )︀
(𝐴) 𝑝𝑛 = P[𝑋 = 𝑛] = 𝜌 1−𝜌
𝜌
(𝐵) E[𝑋] = , (4.8)
1−𝜌
𝜌
(𝐶) V[𝑋] = ,
(1 − 𝜌)2
To obtain (4.8).(B) and (4.8).(C) we should realize that the distribution of 𝑋(𝑡) is Shifted
Geometric, because 𝑌 = 𝑋 +1 has the standard Geometric distribution with parameter 𝑝 = 1−𝜌,
for 𝑦 ≥ 1 then P[𝑌 = 𝑦] = P[𝑋 = 𝑦 − 1 = 𝑛] = 𝑝𝑦−1 = 𝜌𝑦−1(1 − 𝜌) = 𝑝(1 − 𝑝)𝑦−1.
* The utilization of the server (the probability of having at least one job in the system), actually
𝜆
is the arrival-to-service ratio 𝜌 = = 1 − 𝑝0 = P[𝑋 > 0]
𝜇
=⇒ P[“ server is busy ′′] = 𝜌 =⇒ P[“ server is idle ′′] = 1 − 𝜌
SYSTEM PERFORMANCE EVALUATION Methods and Algorithms
4.3. The M/M/1 queue - Characterization via Performance Metrics 32
What if your simple queue really becomes an exponential system like the 𝑀/𝑀/1 system?
Waiting time 𝑊
When a new job arrives, it finds the system with 𝑋 jobs in it. While these 𝑋 jobs are being
served, the new job awaits its turn in a queue. Thus, its waiting time 𝑊 = 𝑆1 + 𝑆2 + · · · + 𝑆𝑋
just consists of service times of 𝑋 earlier jobs, Recall that
Response time 𝑅: the time a job spends in the system, from its arrival until its departure.
Response time 𝑅 consists of waiting time (if any) and service time. The expected response time
can then be computed as
E[𝑆] 𝜌 E[𝑆]
E[𝑅] = E[𝑊 ] + E[𝑆] = + E[𝑆] = (4.11)
1−𝜌 1−𝜌
ASSUMPTION: The system is functional (𝜌 < 1), so all the jobs go through the entire system.
Thus, each component is subject to the same arrival rate 𝜆 = 𝜆𝐴. With 𝜇 is the service rate,
𝜌
E[𝑋] = 𝐿 = , and
1−𝜌
𝜌2
E[𝑋𝑤 ] = 𝐿𝑤 = , here are the main performance characteristics:
1−𝜌
⎧
⎪ E[𝑆] 1
⎪
⎪ E[𝑆] = 1/𝜇 =⇒ E[𝑅] = = ,
1 − 𝜌 𝜇 (1 − 𝜌)
⎪
⎪
⎪
⎪
⎪
⎪
⎪
⎪
⎨
(4.12)
⎪ E[𝑆] 𝜌 𝜌
⎪
⎪ E[𝑊 ] = = ,
⎪
⎪
⎪
⎪ 1 − 𝜌 𝜇 (1 − 𝜌)
𝜆
⎪
⎪
⎩ P[ server is busy ] = 𝜌 = =⇒ P[ server is idle ] = 1 − 𝜌.
⎪
⎪
𝜇
The Little’s Law certainly applies to the 𝑀/𝑀/1 queue and its components, the queue and the
Messages arrive to a communication center at random times with an average of 5 messages per
minute. They are transmitted through a single channel in the order they were received.
The arrival rate 𝜆𝐴 = 5𝑚𝑖𝑛−1 and the expected service time E[𝑆] = 10 seconds or (1/6) min are
given. Then, the utilization is ?
This also represents the proportion of time when the channel is busy and the probability of a
non-zero waiting time. The average number of messages stored in the system at any time
E[𝑋] =? = 5, =⇒ E[𝑋𝑤 ] =?
the average number of messages are waiting, and E[𝑋𝑠] = 𝜌 = 0.83 ones are being transmitted.
When a message arrives to the center, its waiting time 𝑊 (until its transmission begins) and
response time 𝑅 have respectively means
4.4
The generic 𝐺/𝐺/𝑚 queue
QUESTION.
Are all queues exponential like 𝑀/𝑀/1 queue? NO, we have G| G| 𝑚 queue where neither
arrivals are Poisson nor service times are exponential!
For the generic G| G| 𝑚 queue, with 𝑚 servers, 𝑚𝜇 is the overall service rate, then the utilization
𝜆
ratio 𝜌 = . Rules for all queues firsty applied to 𝐺/𝐺/𝑚 queues are the followings.
𝑚𝜇
The expected number of jobs in the queue (the queue length) 𝑄 = E[𝑋𝑤 ].
(I) If we know distribution of 𝑋 or its densities 𝑝𝑘 then the expected number of jobs
∞
∑︁
𝐿 = E[𝑋] = 𝑘 𝑝𝑘 = E[𝑋𝑤 ] + E[𝑋𝑠] (4.14)
𝑘=1
𝐿 = E[𝑋] = 𝜆 E[𝑅]
♦ The Mean number of jobs in the queue = Arrival rate × Mean waiting time,
E[𝑋𝑤 ] = 𝜆 E[𝑊 ].
The Response Time 𝑅 = 𝑊 + 𝑆 is the total time that a job spends in the queuing system
1
𝑅 = 𝑊 + 𝑆 =⇒ E[𝑅] = E[𝑊 ] + E[𝑆] = E[𝑊 ] + . (4.15)
𝜇
(6) If the service time 𝑆 is independent of the number of jobs 𝑋𝑤 in the queue,
then 𝑆 also independent of waiting time 𝑊 , thereore
ASSIGNMENT 1.
Each team has 3-4 students, time due 23:00 Friday of WEEK 7, max score 8 pts]
Write a program (self choosing either Python or similar language) to quantify major processes
and compute key PERFORMANCE METRICS of the general 𝐴/𝑆/𝑚/𝐵/𝐾/𝑆𝐷 queue, with
𝑚 = 1 server and the two processes of arrival 𝐴 and service 𝑆 is exponential, or can be generic
G.
◇ Describe in the report specific probability distributions of the G| G| 𝑚 queue before you go,
where G is a wellknown distribution (𝑀, 𝐸, or 𝐻... as follows).
◁ The more distributions you employ exactly for arrival process and the service process the higer
score you obtain.
HINT: If the program can express only M| M| 1 the team get only 8 pts.
You could use term and notation reminded below for the general 𝐴/𝑆/𝑚/𝐵/𝐾/𝑆𝐷.
Common Distributions
𝑀 : Exponential,
𝐸𝑘 : Erlang with parameter 𝑘,
𝐻𝑘 : Hyper-exponential with parameter 𝑘,
𝐷: Deterministic → constant,
𝐺: General → All.
Memoryless:
Remembering the past history does not help.
3. Service Disciplines SD
First-Come-First-Served (FCFS);
Last-Come-First-Served (LCFS);
Last-Come-First-Served with Preempt and Resume (LCFS-PR);
Round-Robin (RR) with a fixed quantum.
SIRO (Service-In-Random-Order):
The job to be served next is selected at random.
Small Quantum → Processor Sharing (PS) (**)
Shortest Processing Time first (SPT);
parameter 𝑡 ∈ 𝑇 is time, with 𝑇 being a set of possible times, usually [0, ∞), the set of reals
R = (−∞, ∞), the naturals N = {0, 1, 2, . . .}, or Z = {. . . , −3, −2, −1, 0, 1, 2, . . .};
𝑤 ∈ Ω, an outcome of an experiment, in sample space Ω.
Values, states or realizations 𝑠 = 𝑋(𝑡, 𝑤) called states make the state space
X:TxΩ S
that evolves in time and generates a sequence of
Figure 4.4: Visualization of a stochastic process 𝑋 functions denoted by 𝑋𝑡 or 𝑋(𝑡) of only tempo-
ral parameter 𝑡 ∈ 𝑇 .
𝑛(𝑡) = 𝑋(𝑡) = the number of jobs waiting for CPU of a computer system at time 𝑡.
Stochastic processes can be generally subdivided into four distinct categories depending on
whether 𝑡 ∈ 𝑇 or 𝑋𝑡 ∈ 𝒮 are discrete or continuous.
Discrete Continuous
QUIZ 3.
1. Discrete processes: both 𝒮 and 𝑇 are discrete, as Discrete Time Markov chains.
Examples: random walk model consisting of positions 𝑋𝑡 of an object (drunkand) at hourly time point 𝑡 during 24 hours, whose directional distance
3. Continuous process: both state space 𝒮 and time index set 𝑇 are continuous,
such as Markov process and diffusion process (Brownian motion). Example: 𝑋𝑡 is population density at time 𝑡 ∈ 𝑇 = R+ , the state space of 𝑋𝑡 is R+ .
4. Discrete time continuous state process: the time index 𝑇 is discrete, and the state space 𝒮 is
continuous– the so-called TIME SERIES such as
monthly fluctuations of the inflation rate of Vietnam, Thailand or India
daily fluctuations of a stock market.
A Markov process - a process in which future states are independent of the past and depend
only on the present, so easier to analyze, not have to remember past trajectory.
.
A Markov chain = A discrete-state Markov process {𝑋(𝑡) = 𝑋𝑛}
Not necessary to know how long the process has been in the current state.
=⇒ State time (as service time) has a memoryless distribution.
E.g., Only exponential distribution 𝑋 ∼ Exp(𝜆) gives 𝑃 𝑟{𝑋 > 𝑠 + 𝑡|𝑋 > 𝑡} =
𝑃 𝑟{𝑋 > 𝑠 + 𝑡 and 𝑋 > 𝑡} 𝑃 𝑟{𝑋 > 𝑠 + 𝑡} 𝑒−𝜆(𝑠+𝑡)
= = = −𝜆𝑡 = 𝑒−𝜆𝑠 (4.17)
𝑃 𝑟{𝑋 > 𝑡} 𝑃 𝑟{𝑋 > 𝑠} 𝑒
Stochastic process 𝑋(𝑡) is Markov process if for any sequence real numbers 𝑡1 < 𝑡2 < . . . <
𝑡𝑛 < 𝑡, and any sets 𝐴; 𝐴1, 𝐴2, . . . , 𝐴𝑛 (𝐴𝑖 ⊂ R)
The CTMC , for all 𝑖, 𝑗 ∈ 𝒮 and 𝑠, 𝑡 > 0 has the Markov property:
P[𝑋(𝑠 + 𝑡) = 𝑗|𝑋(𝑠) = 𝑖 and 𝑋(𝑢) for 𝑢 < 𝑠] = P[X(s + t) = j|X(s) = i], (4.18)
𝑡𝑖𝑚𝑒 : − − − − − − 𝑢 − − − − − s − − − − − s + t − − − − − − >
That means given the evolution of the process up to any current time 𝑠, the future value and its
probabilistic description depend only on the current state at time 𝑠.
(1) The transition probability 𝑝𝑖,𝑗 (𝑠, 𝑡) for a fix pair of states (𝑖, 𝑗) are said to be stationary, or
depends only on the length 𝑡 of the time interval [𝑠, 𝑠 + 𝑡], whatever the time point 𝑠 is.
(2) A Markov “jump” process 𝑀 = {𝑋(𝑡)}𝑡≥0 = (𝒮, 𝑝, 𝑃 (𝑡)) is called time homogeneous or
For such homogeneous Markovian “jump” process we have known two distinct concepts:
Transition probabilities 𝑝𝑖,𝑗 (𝑡) = P[𝑋(𝑠 + 𝑡) = 𝑗 |𝑋(𝑠) = 𝑖], and
(4.20)
Marginal probabilities 𝑝(𝑢) = [𝑝𝑗 (𝑢)]𝑗∈𝒮 where 𝑝𝑗 (𝑢) = P[𝑋(𝑢) = 𝑗].
Here
𝑝𝑖,𝑗 (𝑡) is transition probability from state 𝑖 to state 𝑗 after a time gap 𝑡,
𝑝𝑗 (𝑢) is the ‘state’ probability that the process is in state 𝑗 at time point 𝑢.
NOTE: This “jump” process (DTMC) is used to characterize system workloads in Chapter 8.
Both Markov process and Poisson Process with Its Variation play useful roles in WEEEK 5
about Birth and Death processes.
4.6
Poisson Process- Variation with Application
Suppose that {𝑁1(𝑡)} and {𝑁2(𝑡)} are two independent Poisson processes with rates 𝜆1 and
𝜆2 respectively. Precisely, 𝑁1(𝑡) ∼ Pois(𝜆1 𝑡), 𝑁2(𝑡) ∼ Pois(𝜆2 𝑡). [They are the respective
cumulative numbers of distinct arrival types in the time interval [0, 𝑡).]
Let 𝑁 (𝑡) = 𝑁1(𝑡) + 𝑁2(𝑡), the combined process of a cumulative number of arrivals until
time 𝑡. Then {𝑁 (𝑡)} is a Poisson process with arrival-rate parameter 𝜆1 + 𝜆2 ( the sum of
(︀ )︀
the individual arrival rates). 𝑁 (𝑡) ∼ Pois (𝜆1 + 𝜆2)𝑡 .
This result is extended to the Superposition Process of many independent Poisson processes.
Theorem 4.4 (Superposition Process)
♡
If the probability of a job going to 𝑖th substream is 𝑝𝑖, each substream is also Poisson with a
mean rate of 𝑝𝑖𝜆.
(3) If the arrivals to a single server with exponential service time are Poisson with mean rate 𝜆,
then the departures are also Poisson with the same rate 𝜆 provided 𝜆 < 𝜇.
(4) If the arrivals to a service with 𝑚 service centers are Poisson with a mean rate 𝜆,
then the departures also constitute a Poisson stream with the same rate 𝜆,
∑︀
provided that 𝜆 < 𝑖 𝜇𝑖 . Here, the servers are assumed to have exponentially distributed
service times.
We next present key powerful principles of birth and death processes for analyzing properly
finite fapacity queuing systems...
Briefly a Birth-death process is a discrete-state Markov process in which the transitions are
restricted to neighboring states. Birth and death (BD) processes mathematically are obtained
when we generalize the Poisson process in two ways, by:
1. Letting the value of the arrival rate 𝜆 depend on the current state 𝑛;
2. Including departures, which allows the process to instantaneously decrease its value by one
unit (at a rate that will also be a function of 𝑛). Hence, process in state 𝑛 can change only to
state 𝑛 + 1 or 𝑛 − 1.
These generalizations can be used to describe not only customers entering and leaving a store,
but also populations that increase or decrease in size due to the birth of a new member or the
death of an old one. Birth and death processes formally are a special type of continuous-time
Markov chains (CTMC or Markov jump model).
If 𝑝𝑖𝑗 = 0 whenever 𝑗 ̸= 𝑖 − 1 or 𝑗 ̸= 𝑖 + 1, then the Markov chain is called a birth and death
process. Thus, a birth and death process is a CTMC in which transitions from state 𝑖 can only
go to either state 𝑖 − 1 or 𝑖 + 1.
That is, a transition either causes an increase in state by one or a decrease in state by one.
Reminder:
For all 𝑖 ̸= 𝑗 ∈ 𝒮, the transition rate of the process when the process makes a transition
from state 𝑖 to state 𝑗, denoted by 𝑞𝑖,𝑗 , is defined by
𝑝𝑖,𝑗 (ℎ)
𝑞𝑖,𝑗 = 𝑝′𝑖,𝑗 (0) = lim for 𝑖 ̸= 𝑗. (4.21)
ℎ→0 ℎ
The transition rates 𝑞𝑖,𝑗 are also known as instantaneous transition rates, transition inten-
sities, or forces of transition.
Definition 4.6 ♣
If employ the (instantaneous) transition rate 𝑞𝑖,𝑗 given in Equation 4.21 of the continuoustime
Markov chain, then the process is said to be a birth and death process when
𝑞𝑖,𝑗 = 0 𝑖𝑓 |𝑗 − 𝑖| > 1.
To describe the process we define the birth and death rates from each state 𝑖 ∈ 𝒮:
𝜆𝑖 = 𝑞𝑖,𝑖+1 = 𝑣𝑖 𝑝𝑖,𝑖+1
(4.22)
𝜇𝑖 = 𝑞𝑖,𝑖−1 = 𝑣𝑖 𝑝𝑖,𝑖−1
Thus, 𝜆𝑖 is the rate at which a birth occurs, and 𝜇𝑖 is the rate at which a death occurs, both when
the process is in state 𝑖.
The rate of transition out of state 𝑖 is the sum of these two rates 𝜆𝑖 + 𝜇𝑖 = 𝑣𝑖.
The state-transition-rate diagram of a B & D process is shown in Figure 4.6.
Figure 4.6 shows a state-transition-rate diagram as opposed to a state-transition diagram;
because it shows the rate at which the process moves from state to state,
and not the probability of moving from one state to another.
Note that 𝜇0 = 0, because there can be no death when the process is in empty state.
was
⎡ ⎤
⎢ 𝑞1 𝑞1,2 𝑞1,3 . . . 𝑞1,𝑠 ⎥
⎢ ⎥
⎢ 𝑞2,1 𝑞2 𝑞2,3 . . . 𝑞2,𝑠 ⎥
⎢ ⎥
⎢ ⎥
Q = ⎢ 𝑞3,1 𝑞3,2 𝑞3 . . . 𝑞3,𝑠 ⎥ . (4.23)
⎢ ⎥
⎢ ⎥
⎢ . ... ... . . . ... ⎥
⎢ .. ⎥
⎢ ⎥
⎣ ⎦
𝑞𝑠,1 𝑞𝑠,2 𝑞𝑠,3 . . . 𝑞𝑠
For a BD process with parameters given by diagram 4.6, Q takes a special form
⎡ ⎤
⎢ −𝜆0 𝜆0 0 ... 0... 0 ⎥
⎢ ⎥
⎢ 𝜇1 −(𝜆1 + 𝜇1) 𝜆1 0... 0... 0 ⎥
Q=⎢ ⎥. (4.24)
⎢ ⎥
⎢ 0
⎢ 𝜇2 −(𝜆2 + 𝜇2) 𝜆2 0 . . . 0 ⎥ ⎥
⎣ ⎦
... ... ... ... .
.. ...
𝑑
𝑝(𝑡) = 𝑝(𝑡) Q, (4.25)
𝑑𝑡
where 𝑝(𝑡) = [𝑝0(𝑡), 𝑝1(𝑡), 𝑝2(𝑡), · · · , 𝑝𝑖(𝑡), 𝑝𝑖+1(𝑡), · · · ] is the vector of state distribution.
Transient analysis of this birth and death (B & D) process is done by studying the following
system of linear differential equations (LDS):
𝑑
𝑝0(𝑡) = −𝜆0 𝑝0(𝑡) + 𝜇1 𝑝1(𝑡)
𝑑𝑡
𝑑
𝑝1(𝑡) = 𝜆0 𝑝0(𝑡) − (𝜆1 + 𝜇1)𝑝1(𝑡) + 𝜇2 𝑝2(𝑡)
𝑑𝑡 (4.26)
......
𝑑
𝑝𝑖(𝑡) = 𝜆𝑖−1 𝑝𝑖−1(𝑡) − (𝜆𝑖 + 𝜇𝑖)𝑝𝑖(𝑡) + 𝜇𝑖+1 𝑝𝑖+1(𝑡)
𝑑𝑡
Thus, a B & D process is described by a system, called Local Balance Equations
𝑑𝑝0 (𝑡)
= −𝜆0 𝑝0 (𝑡) + 𝜇1 𝑝1 (𝑡)
𝑑𝑡 (4.27)
𝑑𝑝𝑖 (𝑡)
= −(𝜆𝑖 + 𝜇𝑖 )𝑝𝑖 (𝑡) + 𝜇𝑖+1 𝑝𝑖+1 (𝑡) + 𝜆𝑖−1 𝑝𝑖−1 (𝑡), for 𝑖 > 0
𝑑𝑡
𝑑𝑝𝑖(𝑡)
where the left hand side is the total rate of transition changing of state 𝑖, the + indicates
𝑑𝑡
the moving in rate and the − indicates the moving out rate.
𝑑𝑝𝑖(𝑡)
Now in the steady state, we have lim𝑡→∞ = 0, and lim𝑡→∞ 𝑝𝑖(𝑡) = 𝑝𝑖 exists, ∀ 𝑖 =
𝑑𝑡
0, 1, 2, . . . then the system (4.27) becomes the ‘local balance conditions’
⎧
⎪ 𝜆0
⎪
⎪ 𝜆 𝑝
0 0 = 𝜇 𝑝
1 1 =⇒ 𝑝 1 = 𝑝0
⎪
⎪
⎪
⎨ 𝜇 1
𝜆𝑖𝑝𝑖 = 𝜇𝑖+1𝑝𝑖+1 ∀𝑖 = 0, 1, . . .
This result states that when the process is in the steady state, the rate at which it makes a transition
from state 𝑖 to state 𝑖 + 1, which we refer to the rate of flow from state 𝑖 to state 𝑖 + 1, is equal to
the rate of flow from state 𝑖 + 1 to state 𝑖.
This property (4.28) is referred to as the local balance equation or condition because it balances
(or equates) the rate at which the process enters state 𝑖 with the rate at which it leaves state 𝑖.
Direct application of the property allows us to solve for the steady-state probabilities of the birth
and death process recursively as follows:
∏︀𝑖
𝜆𝑖 𝑗=0 𝜆𝑗
𝑝𝑖+1 = 𝑝𝑖 = . . . = ∏︀𝑖+1 𝑝0 (4.29)
𝜇𝑖+1 𝜇
𝑗=1 𝑗
𝜆
The sum converges if and only if < 1, equivalent to 𝜆 < 𝜇. Under this condition, rewriting
𝜇
𝑛 := 𝑖 we obtain the solutions
⎧
⎪ 𝜆
⎨𝑝 0 =1−
⎪
⎪
(︂ 𝜇 )︂(︁ )︁ (4.31)
⎪ 𝜆 𝜆 𝑛
⎩𝑝 𝑛
⎪
⎪ = 1− , for 𝑛 = 1, 2, . . .
𝜇 𝜇
CONCLUSION
𝜆
Clearly, this probability exists only if 𝜆 < 𝜇 or < 1.
𝜇
𝜆
The value 𝑙 = is said to be the load of the system. 4 If the customers arrive at a rate 𝜆 > 𝜇,
𝜇
the service rate, then the system will overload and the queue will become infinite.
4 This is easily understood if we think about the system’s evolution.
∑︀∞
We indeed have known 𝑖=0 𝑝𝑖 = 1 ⇒ 𝑝0(1 + 𝜌1 + 𝜌2 + ...) = 1
1 𝑛
⇒ 𝑝0 = = 1 − 𝜌 ⇒ 𝑝 𝑛 = 𝜌 (1 − 𝜌)
1 + 𝜌1 + 𝜌2 + ...
■ EXAMPLE 4.5.
A machine is operational for an exponentially distributed time with mean 1/𝜆 before breaking
down. When it breaks down, it takes a time that is exponentially distributed with mean 1/𝜇 to
repair it.
What is the fraction of time that the machine is operational (or available)?
SYSTEM PERFORMANCE EVALUATION Methods and Algorithms
4.7. The Birth and Death processes 75
Solution:
This is a two-state birth and death process. Let 𝑈 denote the up state and 𝐷 the down state.
Let 𝑝𝑈 denote the steady-state probability that the process is in the operational state, and
let 𝑝𝐷 denote the steady-state probability that the process is in the down state.
SUMMARY See application of this section in part II) on MODELING problems- in Section 4.8
Structural properties:
Interarrival times follow exponentially distributed with parameter 𝜆, and service times also are
One server, No limitation on buffer and population, and FCFS service discipline.
1. Probabilistic properties
M/M/1 is a birth-death process with
𝜆𝑛 = 𝜆, 𝑛 = 0, 1, 2, . . . , ∞
𝜇𝑛 = 𝜇, 𝑛 = 1, 2, . . . , ∞
Probability of 𝑛 jobs in the system
(︂ )︂𝑛
𝜆
𝑝𝑛 = P[𝑋 = 𝑛] = 𝑝0, 𝑛 = 1, 2, . . . , ∞
𝜇
2. System workload is measured by utilization ratio meaning Traffic intensity (thoughtput)
𝜌 = 𝜆/𝜇
=⇒ 𝑝𝑛 = 𝜌𝑛 𝑝0
E[𝑆] 1
1. The mean response time E[𝑅] = E[𝑊 ] + E[𝑆] = =
1 − 𝜌 𝜇 (1 − 𝜌)
2. The mean queue length (waiting list)
𝜌2
E[𝑋𝑤 ] = 𝐿𝑤 = E[𝑋] − E[𝑋𝑠] = 𝐿 − E[𝑋𝑠] =
1−𝜌
𝑛
(︀ )︀
3. The probability of having 𝑛 customers in the system 𝑝𝑛 = P[𝑋 = 𝑛] = 𝜌 1−𝜌
give probabilities of idle state and busy state
𝜆
P[ server is idle ] = 1 − 𝜌 =⇒ P[ server is busy ] = 𝜌 =
𝜇
4.8.2 HOMEWORK
Given the queue 𝑀/𝑀/3/20/1500/𝐹 𝐶𝐹 𝑆, check the following facts, and explain in your own
words if possible
PROBLEM 4.2.
Consider an insurance company that has two types of policy: Policy A and Policy B . Total
claims from the company arrive according to a Poison process at the rate of 9 per day. A randomly
1
selected claim has a chance that it is of policy A. Calculate, on a given day
3
a/ the probability that claims from policy A will be fewer than 2,
GUIDANCE for solving. Apply the Thinning technique in Proposition 4.2. Brief inputs:
𝑁𝐴(𝑡)= number of claims of policy A∼Poisson process at rate 𝜆 𝑝 = 9.1/3 = 3 per day
𝑁𝐵 (𝑡)= number of claims of policy B∼Poisson process at rate 𝜆(1 − 𝑝) = 9.2/3 = 6 per day
N(t) = total number of claims ∼ Poisson process at rate 𝜆 = 9 per day.
0 1
−3 3 −3 3
a) P[𝑁𝐴(1) < 2] = 𝑝(𝑁𝐴(1) = 0) + 𝑝(𝑁𝐴(1) = 1) = 𝑒 .𝑒 = 4.𝑒−3 =?
0! 1!
0 1
−6 6 −6 6
b) P[𝑁𝐵 (1) < 2] = 𝑝(𝑁𝐵 (1) = 0) + 𝑝(𝑁𝐵 (1) = 1) = 𝑒 .𝑒 = 7.𝑒−6 =?
0! 1!
0 1
9 9
c) P[𝑁 (1) < 2] = 𝑝(𝑁 (1) = 0) + 𝑝(𝑁 (1) = 1) = 𝑒−9 .𝑒−9 = 10.𝑒−9 = 0.0123.■
0! 1!
PROBLEM 4.3. (Printer).
Jobs are sent to a printer at random times, according to a Poisson process of arrivals, with a
rate of 12 jobs per hour. The time it takes to print a job is an Exponential random variable,
SYSTEM PERFORMANCE EVALUATION Methods and Algorithms
4.8. CHAPTER CONCLUSION- HOMEWORK 82
independent of the arrival time, with the average of 2 minutes per job.
1. What is the service (processing) rate?
2. What is the system’s utilization 𝜌? Is the printer stable? What is departure rate?
3. At an arbitrary time point, you count a total of 5 jobs in the printer, and assume that this is
the typical, average number of jobs in steady state. Compute the mean E[𝑊 ] of waiting time
𝑊 , the mean E[𝑅] of response time 𝑅.
4. What is the expected number of jobs in the queue only?
1 1
1. The service (processing) rate 𝜆𝑆 = 𝜇 = = =?
E[𝑆] mean service time
The service time 𝑆 is the time taken to print a job, here 𝑆 ∼ Exp(𝜆𝑆 ) is an exponential
random variable, with service rate 𝜆𝑆 , and the mean E[𝑆] = 2 = 1/𝜇 minutes per job. So
1 1
𝜇 = 𝜆𝑆 = = jobs per minute.
E[𝑆] 2
3. The mean E[𝑊 ] of waiting time 𝑊 , the mean response time E[𝑅].
Call 𝑋 the number of jobs in the printer in steady state. We have 𝐿 = E[𝑋] = 5 jobs, and
𝜆𝐴 E[𝑅] = E[𝑋] =⇒ E[𝑅] = 𝐿/𝜆𝐴 = 5/(1/5) = 25 𝑚𝑖𝑛𝑢𝑡𝑒𝑠
(4.35)
𝜆𝐴 E[𝑊 ] = E[𝑋𝑤 ] =⇒ E[𝑊 ] = E[𝑋𝑤 ]/𝜆𝐴 =?
1
𝑊 = 𝑅 − 𝑆 =⇒ E[𝑊 ] = E[𝑅] − E[𝑆] = E[𝑅] − = 25 − 2 = 23 𝑚𝑖𝑛𝑢𝑡𝑒𝑠.
𝜇
4. What is the expected number of jobs in the queue only? It is
𝑄 = E[𝑋𝑤 ] = 𝜆𝐴 E[𝑊 ] = (1/5) 23 = 23/5 = 4.6 jobs. ■
II) MODELING
For 𝑛 = 2, an interesting problem regarding the competition between two exponential random
variables 𝑋, 𝑌 is computing the probability that one of the two variables, such as 𝑋, is less than
𝑌 . This kind of model might appear in service providing, where a provider completing his service
earlier than that of the other providers will be considered as the winner. See an application of
SYSTEM PERFORMANCE EVALUATION Methods and Algorithms
4.8. CHAPTER CONCLUSION- HOMEWORK 85
DATA and ASSUMPTION: Consider two independently operating Poisson processes with rate
parameters 𝜆1 and 𝜆2 respectively.
QUESTION: What is the probability that an arrival from process 1 (a ”type 1” arrival as blue
buses) occurs before an arrival from process 2 (a ”type 2” arrival as red buses)?
Let the two independent inter-arrival times of interest be denoted by 𝐴 and 𝐵 for processes 1
and 2, respectively. We want to compute P[𝐴 < 𝐵]?
Suppose that by any time 𝑡 the number of people that have arrived at a train depot is a Poisson
random variable with mean 𝜆 𝑡.
ASSUMPTION: Suppose the initial train arrives at the depot at a time (independent of when
the passengers arrive) that is uniformly distributed over (0, 𝑇 ).
1/ What are the mean and variance of the number of passengers to the train?
2/ Is the load of trains (of that train depot) high?
How can we quantify this performance index (in fact a random variable)?
∙ ∙ ∙∙
∑︀
Then the min variable 𝑇 = min{𝑇1, 𝑇2, · · · , 𝑇𝑛} ∼ Exp( 𝑖 𝛽𝑖 ) is exponentially distributed
𝑛
∑︁
with parameter 𝛽𝑖.
𝑖=1
Ch. 4 and 5: Stochatic process- Poisson Process- Birth & Death process
Week 4: Math model of 𝑀/𝑀/1 queue- Poisson arrival process- Inter-arrival times
Week 5: Birth & Death process- 𝑀/𝑀/1/𝐶 Finite Capacity System
Ch.6: Basic Queueing systems- Models and Analysis
Week 6: Exponential queues with many servers - 𝑀/𝑀/𝑘
Ch.7: Advanced Queueing systems
Week 7: Open Queueing systems
Week 8: Complex queue systems: A) Jackson networks or B) Non-Markovian Queues - WEEK 9: Midterm
Ch.8: SPE with Statistical Factorial Designs
Week 10: Background: Factorial Designs, full 2𝑘 design combined with regression model
Week 11: Multivariate ANOVA - Experimental error analysis ...
Ch.9: Statistical Simulation Modeling
Week 12: Discrete-event simulation and Monte Carlo simulation - Terminating simulation
Week 13: Comparison of Alternative System Configurations with means, proportions & variances
Ch.10: Analysis of Simulation Results And SPE Analytics
Week 14: Verification and Validation, Variance estimation
Week 15: Variance Reduction Technique (VRT) - Discussion on Project
Week 16: Team Presentation and FINAL REVIEW
List of Figures
response time, 34
stable system, 11
statistical equilibrium, 11
system design, 4
transient behavior, 11
transient removal, 11
SYSTEM PERFORMANCE EVALUATION Methods and Algorithms
INDEX 91
THE END