Lecture 3: Queuing Theory and Poisson Processes
END 322E System Simulation Mehmet Ali Ergün, Ph.D.
1
What is Queueing Theory
❖ Mathematical analysis of queues and waiting times in stochastic systems.
❖ Used extensively to analyze production and service processes exhibiting
random variability in market demand (arrival times) and service times.
❖ Queues arise when the short term demand for service exceeds the capacity
❖ Most often caused by random variation in service times and the times
between customer arrivals.
❖ If long term demand for service > capacity the queue will explode!
2
Why is Queuing Analysis Important?
❖ Capacity problems are very common in industry and one of the main drivers of
process redesign
❖ Need to balance the cost of increased capacity against the gains of increased
productivity and service
❖ Queuing and waiting time analysis is particularly important in service systems
❖ Large costs of waiting and of lost sales due to waiting
Prototype Example – ER at a Hospital
Patients arrive by ambulance or by their own accord
One doctor is always on duty
More and more patients seeks help longer waiting times
Question: Should another MD position be instated?
3
Cost/Capacity Trade-off
Total
cost
Cost Cost of
service
Cost of waiting
Process capacity
4
Examples of Queueing Systems
❖ Commercial Queueing Systems
❖ Commercial organizations serving external customers
❖ Ex. Dentist, bank, ATM, gas stations, plumber, garage …
❖ Transportation service systems
❖ Vehicles are customers or servers
❖ Ex. Vehicles waiting at toll stations and traffic lights, trucks or ships waiting to be loaded, taxi
cabs, fire engines, elevators, buses …
❖ Business-internal service systems
❖ Customers receiving service are internal to the organization providing the service
❖ Ex. Inspection stations, conveyor belts, computer support …
❖ Social service systems
❖ Ex. Judicial process, the ER at a hospital, waiting lists for organ transplants or student dorm
rooms …
5
Components of a Basic Queueing System
Input Source The Queuing System
Calling Jobs Served Jobs
Service
Population Queue
Mechanism
leave the
system
Arrival
Process Queue
Queue
Discipline Service
Configuration
Process
6
Components of a Basic Queueing System
❖ The calling population
❖ The population from which customers/jobs originate
❖ The size can be finite or infinite (the latter is most common)
❖ Can be homogeneous (only one type of customers/ jobs) or heterogeneous (several different kinds of
customers/jobs)
❖ The Arrival Process
❖ Determines how, when and where customer/jobs arrive to the system
❖ Important characteristic is the customers’/jobs’ inter-arrival times
❖ To correctly specify the arrival process requires data collection of interarrival times and statistical
analysis.
7
Components of a Basic Queueing System
❖ The queue configuration
❖ Specifies the number of queues
❖ Single or multiple lines to a number of service stations
❖ Their location
❖ Their effect on customer behavior
❖ Balking and reneging
❖ Their maximum size (# of jobs the queue can hold)
❖ Distinction between infinite and finite capacity
8
Two different Queue Configurations
Single Queue
Multiple Queues
Servers
Servers
The queue you have joined is
always the slowest
9
Multiple v.s. Single Customer Queue
Configuration
Multiple Line Advantages Single Line Advantages
❖ The service provided can be ❖ Guarantees fairness
differentiated
FIFO applied to all arrivals
❖
Ex. Supermarket express lanes
❖
❖ No customer anxiety regarding
❖ Labor specialization possible
choice of queue
❖ Customer has more flexibility ❖ Avoids “cutting in” problems
❖ Balking behavior may be ❖ The most efficient set up for
deterred
minimizing time in the queue
Several medium-length lines are
❖
❖ Jockeying (line switching) is
less intimidating than one very
avoided
long line
10
Components of a Basic Queueing System
❖ The Service Mechanism
❖ Can involve one or several service facilities with one or several parallel service channels
(servers) - Specification is required
❖ The service provided by a server is characterized by its service time
❖ Specification is required and typically involves data gathering and statistical analysis.
❖ Most analytical queuing models are based on the assumption of exponentially distributed
service times, with some generalizations.
❖ The queue discipline
❖ Specifies the order by which jobs in the queue are being served.
❖ Most commonly used principle is FIFO.
❖ Other rules are, for example, LIFO, SPT, EDD…
❖ Can entail prioritization based on customer type.
1
1
A Commonly Seen Queueing Model
❖ Service times as well as interarrival times are assumed independent and identically distributed
❖ If not otherwise specified
❖ Commonly used notation principle: A/B/C/Capacity/[Link]
❖ A = The interarrival time distribution
❖ B = The service time distribution
❖ C = The number of parallel servers
❖ Commonly used distributions
❖ M = Markovian (exponential) - Memoryless
❖ D = Deterministic distribution
❖ G = General distribution
❖ Example: M/M/c
❖ Queuing system with exponentially distributed service and inter-arrival times and c servers
12
Steady State Analysis of Queues
❖ Steady State condition
❖ Enough time has passed for the system state to be independent of the initial state as well as
the elapsed time
❖ The probability distribution of the state of the system remains the same over time (is
stationary).
❖ Transient condition
❖ Prevalent when a queuing system has recently begun operations
❖ The state of the system is greatly affected by the initial state and by the time elapsed since
operations started
❖ The probability distribution
With few exceptions
of the stateQueuing
of the system
Theory
changes
has focused
with time
on
analyzing steady state behavior
13
Transient and Steady State Conditions
• Illustration of transient and steady-state conditions
– N(t) = number of customers in the system at time t,
– E[N(t)] = represents the expected number of customers in the system.
30
Transient condition Steady State condition
N(t)
Number of jobs in the system, 25
20
15
N(t) E[N(t)]
10
0
0 5 10 15 20 25 30 35 40 45 50
time, t
14
Notation for Steady State Analysis
Pn = The probability that there are exactly n customers/jobs in the system (in steady
state, i.e., when t)
L = Expected number of customers in the system (in steady state)
Lq = Expected number of customers in the queue (in steady state)
W= Expected time a job spends in the system
Wq = Expected time a job spends in the queue
ρ = The utilization factor for the service facility. (= The expected fraction of the time that
the service facility is being used)
15
Little’s Formula
Assume that n = and n = for all n
L W Lq Wq
Holds for all queueing systems regardless of the number of servers, queue discipline, or
arrival and service time distributions
16
The M/M/1 - Model
Assumptions - the Basic Queuing Process
Infinite Calling Populations
❖ Independence between arrivals
The arrival process is Poisson with an expected arrival rate
❖ Independent of the number of customers currently in the system
The queue configuration is a single queue with possibly infinite length
❖ No reneging or balking
The queue discipline is FIFO
The service mechanism consists of a single server with exponentially distributed service times
❖ = expected service rate when the server is busy
17
The M/M/1 - Model
Needs to be satisfied, otherwise the
❖ Steady State condition: = (/) < 1
queue length goes to infinity
P0 = 1- Pn = n(1- ) P(nk) = k
L=/(1- ) Lq= 2/(1- ) = L-
W=L/=1/(- ) Wq=Lq/= /( (- ))
18
Queuing Example 1
❖ Customers arrive at a sales counter manned by a single person
according to a Poisson process with a mean rate of 20 per hour. The
time required to serve a customer has an exponential distribution with
a mean of 100 seconds. Find the average waiting time of a customer.
19
M/M/1 Example 1 - Solution
20
Queueing Example 2
❖ A university is about to lease a super computer
❖ There are two alternatives available
❖ The M computer which is more expensive to lease but also faster
❖ The C computer which is cheaper but slower
❖ Processing times and times between job arrivals
are exponential M/M/1 model
❖ = 20 jobs per day
❖ M = 30 jobs per day
❖ C = 25 jobs per day
❖ The leasing and waiting costs:
❖ Leasing price: CM = $500 per day, CC = $350 per day
❖ The waiting cost per job and time unit job is estimated to $50 per job and day
❖ Question:
❖ Which computer should the university choose in order to minimize the expected costs?
21
Example – Computer Procurement
❖ Compute expected time in system for each computer type
W days in Machine M
W days in Machine C
❖ Expected Cost is
❖ For Machine M, 1/10*20*50+500= $600 per day
❖ For Machine C, 1/5*20*50+ 350=$550 per day (Slow machine is better)
❖ What if Machine M has the capability to process 50 jobs per day?
❖ 1/30*20*50+500= $533 per day (choose machine M)
22
Counting Processes
❖ A stochastic process is said to be a counting process if represents the total number of “events”
that occur by time . Some examples of counting processes are the following:
❖ If we let equal the number of persons who enter a particular store at or prior to time , then
is a counting process in which an event corresponds to a person entering the store. Note
that if we had let equal the number of persons in the store at time , then would not be a
counting process (why not?).
❖ If we say that an event occurs whenever a child is born, then is a counting process when
equals the total number of people who were born by time . (Does include persons who
have died by time ? Explain why it must.)
❖ If equals the number of goals that a given soccer player scores by time , then is a counting
process. An event of this process will occur whenever the soccer player scores a goal.
23
Poisson Processes
24
Poisson Process Example
❖ We model the arrivals of email messages at a server as a Poisson process. Suppose that on
average 330 messages arrive per minute. What would you choose for the intensity λ in messages
per second? What is the expectation of the interarrival time?
❖ Because there are 60 seconds in a minute, we have
❖ λ = (number of events) / (time unit) = 330 / 60 = 5.5
❖ Since the interarrival times have an Exp(λ) distribution, the
❖ expected time between messages is 1/λ = 0.18 second, i.e.,
❖ E(T) =1/λ = t / µ = (time unite) / (number of events) = 60/330=0.18
25
Properties of the Poisson Process
• Poisson processes can be aggregated or disaggregated and the resulting processes
are also Poisson processes
a)Aggregation of m Poisson processes with intensities
{1, 2, …, m} renders a new Poisson process with intensity = 1+ 2+…+ m.
b) Disaggregating a Poisson process N(t)~Poisson(t) into m sub-processes
{N1(t), N2(t), , …, Nm(t)} (for example m customer types) where Ni(t)
~Poisson(it) can be done if
• For every arrival we know the probability of belonging to sub-process i is pi
• p1+ p2+…+ pN = 1, and i = pi
26
Disaggregating a Poisson Process
𝑁 1 ( 𝑡 ) 𝑃𝑜𝑖𝑠𝑠𝑜𝑛(𝑝 1 𝜆𝑡)
p1
𝑁 2 ( 𝑡 ) 𝑃𝑜𝑖𝑠𝑠𝑜𝑛(𝑝 2 𝜆𝑡)
N(t)~Poisson(t) p2
pm
𝑁 𝑚 ( 𝑡 ) 𝑃𝑜𝑖𝑠𝑠𝑜𝑛(𝑝𝑚 𝜆𝑡)
27