W12 - Queuing Theory 1
W12 - Queuing Theory 1
RESEARCH
Requires very little data and results in relatively simple formulae for
predicting various performance measures.
Terminology (1/4)
Input or Arrival Process
• Is the input of the model. Arrivals represent the customers.
• There can be multiple arrivals at a time.
• Models in which arrivals are drawn from a small population are called
finite source models.
• If a customer arrives but fails to enter the system, we say that the
customer has balked.
Terminology (2/4)
Output or Service Process
• A service time is described by the service time distribution which
governs a customer’s service time.
• Servers are entities that provided service to the customer.
• e.g. a cashier in a fast-food restaurant, a machine on the production line, etc.
• Servers can be arranged in series or parallel to each other.
• Series service usually provide a different service while Parallel service provide
the same service.
• Example of series service: assembly line.
• Example of parallel service: teller in a bank.
Terminology (3/4)
Queue Discipline
• The method used to determine the order in which customers are
served.
• First come, first serve (FCFS)
• Customers are served in the order of their arrival
• e.g. queuing in a fast food counter
• Last come, first serve (LCFS)
• Most recent arrivals are the first to enter service
• e.g. exiting the elevator, unloading a container
Terminology (4/4)
Queue Discipline (Cont’d)
• Service in Random Order (SIRO)
• Customers arrive has not effect on the order in which they are served
• e.g. entering buses
• Priority queuing
• Classifies each arrival into one of several categories which are given a priority
level. Within each level, customer enter a service on an FCFS basis.
• e.g. emergency rooms, multi-processing computers
Queuing Models
• Single Queue, Single Server
• Single Queue, Multiple Servers
• Multiple Queues, Multiple Servers
A Generic Queuing System
Source of Input
Arrival Output
.
.
Queue
Queuing Queuing
System 2 System 3
Point where
In Point where Out
Queuing customer
customer
Queuing
System 1 makes a System 5
merge
decision
Queuing
System 4
PROBABILITY DISTRIBUTIONS IN
QUEUING
Probability Distributions
The time between customers arrivals and the time required for a
process are rarely uniform; It is a random value defined by a certain
probability distribution.
Common probability distribution in queuing theory:
• Uniform Distribution
• Gamma Distribution
• Exponential Distribution
• Poisson Distribution
• Erlang Distribution
Uniform Distribution
The density function of the continuous
uniform random variable 𝑿 on the interval
[A, B] is
1
𝑓 𝑥; 𝐴, 𝐵 = ቐ𝐵 − 𝐴 , 𝐴<𝑥<0
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Gamma Distributions
The continuous random variable 𝑋 has a gamma
distribution, with parameters 𝛼 and 𝛽, if its
density function is given by
1 𝛼−1
−𝑥ൗ
𝛼 𝑥 𝑒 𝛽, 𝑥>0
𝑓 𝑥; 𝛼, 𝛽 = ൞𝛽 Γ(𝛼)
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Where
∞
Γ 𝛼 = න 𝑥 𝛼−1 𝑒 −𝑥 𝑑𝑥, 𝑓𝑜𝑟 𝛼 > 0
0
Not memoryless i.e. the probability at different
stages depends on its current state
Exponential Distribution
Is a special form of gamma distribution with
𝛼 = 1.
The density function of the continuous
exponential random variable 𝑿 with parameter
𝛽 is
1 −𝑥ൗ𝛽
𝑒 , 𝑥>0
𝑓 𝑥; 𝛽 = ൞𝛽
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Where 𝛽 > 0
The exponential distribution has the
memoryless property
Poisson Distributions
Used to compute the probability of specific
numbers of “events” during a particular time
period or span of space.
Developed as a single-parameter distribution
with parameter 𝜆, where 𝜆 may be
interpreted as the mean number of events per
unit “time”.
The density function of a Poisson Distribution
is the exponential distribution with 𝛽 = 1Τ𝜆
𝑓 𝑥 = 𝜆𝑒 −𝜆𝑥
Also has the memoryless property
Erlang Distributions
A special form of Gamma Distribution with 𝛼 =
𝑘, where 𝑘 is a positive integer and 𝛽 = 𝜇. 𝑘 is
referred as the “shape” parameter.
𝑛−1 −𝑥ൗ𝜇
𝑥 𝑒
𝑓 𝑥 = ൞𝜇 𝑛 𝑛 − 1 ! , 𝑥>0
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
With 𝜇 = 1Τ𝜆, then the equation can be re-
written as
𝜆𝑛 𝑥 𝑛−1 𝑒 −𝜆𝑥
𝑓 𝑥 = , 𝑥>0
𝑛−1 !
MODELLING THE PROCESSES
Arrival Process Modelling
• The time of an 𝑖𝑡ℎ arrival is written as 𝑡𝑖 .
• The time gap between 𝑖𝑡ℎ arrival and the next
arrival is called Interarrival, written as 𝑇𝑖 .
• Break the time of day into segments to model
realistic interarrival times (e.g. rush-hour in
the morning or normal elsewhere).
• 𝑇𝑖 are independent, continuous random
variables described by the random variable 𝑨.
• 𝑇1 has no effect on 𝑇2, 𝑇3, … , 𝑇𝑛.
• The distribution of arrivals is independent of
the time of day or the day of the week.
• 𝑨 is a random variable with probability
distribution that has a density function 𝑎(𝑡)
Service Process Modelling
• Assuming that the service times of different customers are
independent random variables and that each customer’s service time
is governed by a random variable 𝑺 having a density function 𝑠(𝑡).
• Actual service times may not be memoryless i.e. it does depend on
the previous service time.
• For this reason, it is often assumed that 𝑠(𝑡) is an Erlang distribution
with shape parameters 𝑘 and rate parameter 𝑘µ
Kendall-Lee Notation
Standard notation used to describe many queuing systems. Each
queuing system is described by six characters:
Life can be seen as a queuing system. Our birth is our arrival at the system
and our death is a service completion. Population is the number of customer
waiting to receive service i.e. waiting to die.
The Birth-Death Process (2/2)
• A special case of continuous-time Markov process where the state
transitions are of only two types: "births", which increase the state
variable by one and "deaths", which decrease the state by one
• The number of people present in any queuing system at time 𝑡
defined to be the state of the queuing system at time 𝑡. At 𝑡 = 0, the
state of the system will equal the number of people initially present
in the system
Laws of Motion for Birth–Death Processes
Law 1 A birth increases the system state by 1, to 𝑗 + 1. The variable 𝜆𝑗 is
called the birth rate in state 𝑗. A birth is simply an arrival.
Law 2 A death decreases the system state by 1, to 𝑗 − 1. The variable 𝜇𝑗
is the death rate in state 𝑗. A death is a service completion
Law 3 Births and deaths are independent of each other
When 𝑗 = 0, 𝜋0 𝜆0 = 𝜋1 𝜇1 and
𝜋0 𝜆0
𝜋1 =
𝜇1
Flow Balance Equations (2/3)
When 𝑗 = 1, 𝜋1 𝜆1 + 𝜇1 = 𝜋2 𝜇2 + 𝜋0 𝜆0 or
𝜋0 𝜆0 𝜆1 + 𝜇1
− 𝜋0 𝜆0 = 𝜋2 𝜇2
𝜇1 Type equation here.
and
𝜆0 𝜆1
𝜋2 = 𝜋0
𝜇1 𝜇2
𝜆0 𝜆1 𝜆2 …𝜆𝑗−1
If we define 𝑐𝑗 = , then it can be shown that
𝜇1 𝜇2 …𝜇𝑗−1
𝜋𝑗 = 𝜋0𝑐𝑗 (1)
Flow Balance Equations (3/3)
At any given time, we must be in some state, the steady-state probabilities
must sum to 1
𝑗=∞
𝜋𝑗 = 1
𝑗=1
𝐿 = 𝑗𝜋𝑗 = (1 − 𝜌) 𝑗𝜌𝑗
𝑗=0 𝑗=0
𝑗=∞ 𝜌
Defining 𝑆 ′ = σ𝑗=0 𝑗𝜌𝑗 = 𝜌 + 2𝜌2 + 3𝜌3 + ⋯ then we have 𝑆 ′ − 𝜌𝑆 ′ =
1−𝜌
′ 𝜌
and 𝑆 = ,thus
(1−𝜌)2
𝜌 𝜌 𝜆
𝐿 = 1−𝜌 2
= =
1−𝜌 1−𝜌 𝜇−𝜆
The expected number of people in queue
If there are more than 1 people, then there will be a certain number of people
in queue. If there are j people in the system, then there will be 𝑗 − 1
customers in queue (1 customer is being served). Thus if we are at steady-
state, the expected number of people in queue is
𝑗=∞ 𝑗=∞ 𝑗=∞
𝜌
𝐿𝑞 = (𝑗 − 1)𝜋𝑗 = 𝑗𝜋𝑗 − 𝜋𝑗 = 𝐿 − 1 − 𝜋0 =𝐿−𝜌= −𝜌
1−𝜌
𝑗=0 𝑗=0 𝑗=0
𝜌2
𝐿𝑞 =
(1 − 𝜌)
The expected number of people in service
• Since every customer who is present is either in line or in
service, it follows that for any queuing system the
expected number of customers in service
𝜌 𝜌2
𝐿𝑠 = 𝐿 − 𝐿𝑞 = −
1 − 𝜌 (1 − 𝜌)
𝐿𝑠 = 𝜌
Little’s Queuing Formula
𝑊 is defined as the expected time a customer spends in the
queuing system, including time in queue plus time in service. 𝑊𝑞
is the expected time a customer spends waiting in queue.
The total customer is the system is equals to the rate of arrival
times the time a customer spends in the queuing system or
𝐿 = 𝜆𝑊
Consequently
𝐿𝑞 = 𝜆𝑊𝑞
𝐿𝑠 = 𝜆𝑊𝑠
As long as a steady state exists we may apply these equations to
any queuing system
Example
An average of 10 cars per hour arrive at a single-server drive-in teller.
Assume that the average service time for each customer is 4 minutes,
and both interarrival times and service times are exponential.
1. What is the probability that the teller is idle?
2. What is the average number of cars waiting in line for the teller?
3. What is the average amount of time a drive-in customer spends in
the bank parking lot?
4. On the average, how many customers per hour will be served by the
teller?
Example
𝜆 = 10, 𝜇 = 60ൗ4 = 15, 𝜌 = 2ൗ3
When 𝜆 = 𝜇
𝑐
𝐿=
2
The expected number of people in service and
queue
As with 𝑀/𝑀/1/𝐺𝐷/∞/∞ system,
𝐿𝑠 = 1 − 𝜋0
And
𝐿𝑞 = 𝐿 − 𝐿𝑠
The Expected Waiting Time
An average of 𝜆 arrivals per unit time arrive, but 𝜆𝜋𝑐 of these arrivals
find the system is full and leave. Thus on average 𝜆(1 − 𝜋𝑐 ) arrivals per
unit time will enter the system. Hence the average waiting time in the
system is
𝐿
𝑊=
𝜆(1 − 𝜋𝑐 )
And the average waiting time in the queue is
𝐿𝑞
𝑊𝑞 =
𝜆(1 − 𝜋𝑐 )