Queuing Theory - With Probability Distributions
Queuing Theory - With Probability Distributions
Queuing Theory
Examples of Lines in Operations Management
• Assembly lines
• Production lines
• Trucks waiting to unload or load
• Workers waiting for parts
• Customers waiting for products
• Broken equipment waiting to be fixed
• Customers waiting for service
2
Why We Analyze Waiting Lines
3
Costs
◼ The costs of waiting in line
Paying idle employees while they are in line waiting for something they need. (waiting
for parts, supplies, deliveries, etc.)
4
Cost of Providing Service
• Paying repairmen to fix broken machines
• Paying dock workers to load and unload trucks
• Paying customer-service people
• Using extra production people to speed up a line
• Leasing service equipment and facilities
• Paying checkout cashiers
5
Queuing System Costs
Costs
Costs of Waiting
Fewer servers goes down as service
often means increases.
longer waiting
for customers.
Optimal # of servers
Many servers
Number of Servers means little or no
waiting, but higher
service costs.
Note that the lowest cost system requires some customer waiting. 6
What Queuing Models Tell Us?
• Average number of customers in line.
• Average time in line for a customer.
• Average number of customers in the system at any time. (In line and being served.)
• Average time in the system for a customer.
• Probability of n number of customers in the system at any given time.
• NOTE: “In The System” includes customers who are waiting plus and the customers being served.
7
The Waiting Line System
ARRIVAL SYSTEM
(How customers arrive)
QUEUE
(The nature of the
waiting line or lines
of customers)
SERVICE FACILITY
(How customers progress through a
service facility)
8
Waiting Line Models
Customer
population
Service System
Arrival Waiting line Served
System (Queue) customers
Service
facilities
Priority
rule
9
Arrival System
• Arrival Populations are either…
• Limited (e.g. Only people age 21 or over.)
• Unlimited (e.g. cars arriving at a toll booth)
• Arrival Patterns are either…
• Random (Each arrival is independent)
• Scheduled (e.g. Doctor’s office visits)
• Behavior of the Arrivals
• Balking (Seeing a long line and avoiding it.)
• Reneging (Get tired of waiting and leave the line)
• Jockeying (Switching lines)
10
The Queue (line)
• Queue Length (line length) is either..
• Unlimited (eg: cars in line at a toll booth)
• Limited (Finite) eg: # of e-mail messages allowed.
• Queue Discipline (order of service)
• FIFO (First-In, First-Out)
• LIFO (Last-In, First-Out)
• SIRO (Service In Random Order)
• Priority
11
The Service Facility
• Channels are the paths (ways to get through the system) after getting in line?
• eg: McDonalds drive-thru is one channel.
• Phases are the number of stops a customer must make, after getting in line?
(Single-phase means only one stop for service.)
12
Single-channel, Single-phase
One way through the system
and one stop for service
Service
Facility
13
Multi-channel, Single-phase
Once in line, you have at least two choices of how to get through the system, but only one stop.
Service
Facility
Service
Facility
14
Multi-channel, Multi-phase
Once in line, you have at least two choices (channels) of how to get through the system and at least two stops
(phases).
Service Service
Facility Facility
Service Service
Facility Facility
15
Four Single-channel, Single-phase Systems
(Once in line, you only have one channel and one stop.)
Service
Facility
Service
Facility
Service
Facility
Service
Facility
16
One, Multi-channel, Single-Phase System
(Once in line you have four possible paths through the system, but only one stop.)
Service
Facility
Service
Facility
Service
Facility
Service
Facility
17
Assumptions We Will Use
• The Rate of Service must be faster than the Rate of Arrivals. (It is unsolvable if
customers arrive faster than they can be served.)
• FIFO (First In, First Out) (Customers are served in the order they arrive.)
• Arrivals are unlimited (infinite)
• Arrivals are random rather than scheduled.
• Customers arrive independently of each other.
• Service times can vary from one customer to another, and are independent
of each other. (Customers may have different service needs and times.)
18
Structure of a Waiting Line System
19
Structure of a Waiting Line System
◼ Distribution of Arrivals
Generally,the arrival of customers into the system is a random event.
Frequently the arrival pattern is modeled as a Poisson process.
20
Structure of a Waiting Line System
◼ Queue Discipline
Most common queue discipline is first come, first served (FCFS).
An elevator is an example of last come, first served (LCFS) queue discipline.
Other disciplines assign priorities to the waiting units and then serve the unit with the
highest priority first.
21
Structure of a Waiting Line System
◼ Single Service Channel System
S1
Customer Waiting line Customer
arrives S2 leaves
S3
22
Queuing Systems
◼ A three part code of the form A/B/k is used to describe various queuing systems.
◼ A identifies the arrival distribution, B the service (departure) distribution and k the
number of channels for the system.
23
Queuing Systems
◼ Symbols used for the arrival and service processes are:
M - Markov distributions (Poisson/exponential)
D - Deterministic (constant)
G - General distribution (with a known mean and variance).
◼ For example, M/M/k refers to a system in which arrivals occur according to a Poisson
distribution, service times follow an exponential distribution and there are k servers
working at identical service rates.
24
Queuing System Input Characteristics
25
Queuing System Operating Characteristics
P0 = probability the service facility is idle
Pn = probability of n units in the system
Pw = probability an arriving unit must wait for service
Lq = average number of units in the queue awaiting service
L = average number of units in the system
Wq = average time a unit spends in the queue awaiting service
W = average time a unit spends in the system
26
Analytical Formulas
◼ For nearly all queuing systems, there is a relationship between the average
time a unit spends in the system or queue and the average number of units
in the system or queue.
◼ These relationships, known as Little's flow equations are:
L = W and Lq = Wq
27
Analytical Formulas
◼ When the queue discipline is FCFS, analytical formulas have been derived for several
different queuing models including the following:
M/M/1
M/M/k
M/G/1
M/M/1 with a finite calling population
◼ Analytical formulas are not available for all possible queuing systems. In this event,
insights may be gained through a simulation of the system.
28
M/M/1 Queuing System
◼ Single channel
◼ Poisson arrival-rate distribution
◼ Exponential service-time distribution
◼ Unlimited maximum queue length
◼ Infinite calling population
◼ Examples:
Single-window theatre ticket sales booth
Single-scanner airport security station
29
Poisson Probability Distribution
◼ A Poisson distributed random variable is often useful in estimating the number of
occurrences over a specified interval of time or space.
◼ It is a discrete random variable that may assume an infinite sequence of values (x = 0,
1, 2, . . . ).
◼ Examples of Poisson distributed random variables:
the number of vehicles arriving at a toll booth in one hour
Bell Labs used the Poisson distribution to model the arrival of phone calls.
30
Poisson Probability Distribution
Two Properties of a Poisson Experiment
◼ The probability of an occurrence is the same for any two intervals of equal length.
◼ The occurrence or nonoccurrence in any interval is independent of the occurrence or
nonoccurrence in any other interval.
31
Poisson Probability Distribution
◼ Poisson Probability Function
𝑒 −𝜆 𝜆𝑥
𝑓 𝑥 =
𝑥!
where:
x = the number of occurrences in an interval
f(x) = the probability of x occurrences in an interval
= mean number of occurrences in an interval
x! = x(x – 1)(x – 2) . . . (2)(1)
32
Poisson Probability Distribution
Poisson Probability Function
◼ Since there is no stated upper limit for the number of occurrences, the probability function f(x) is
applicable for values x = 0, 1, 2, … without limit.
◼ In practical applications, x will eventually become large enough so that f(x) is approximately zero
and the probability of any larger values of x becomes negligible.
33
Poisson Probability Distribution
Example: Mercy Hospital
◼ Patients arrive at the emergency room of Mercy Hospital at the average rate of 6 per hour on weekend
evenings. What is the probability of 4 arrivals in 30 minutes on a weekend evening?
34
Poisson Probability Distribution
Example: Mercy Hospital
◼ Patients arrive at the emergency room of Mercy Hospital at the average rate of 6 per hour on weekend
evenings. What is the probability of 4 arrivals in 30 minutes on a weekend evening?
Using the
probability
function
= 6/hour = 3/half-hour, x = 4
3 4 (2.71828)−3
f (4) = = .1680
4!
35
Poisson Probability Distribution
Example: Mercy Hospital
Poisson Probabilities
0.25
0.20
Probability
0.15
Actually,
the sequence
0.10 continues:
11, 12, 13 …
0.05
0.00
0 1 2 3 4 5 6 7 8 9 10
Number of Arrivals in 30 Minutes
36
Poisson Probability Distribution
Example: National Safety Council
The National Safety Council (NSC) estimates that off-the-job accidents cost U.S. businesses almost $200
billion annually in lost productivity (National Safety Council, March 2006). Based on NSC estimates,
companies with 50 employees are expected to average three employee off-the-job accidents per year.
Answer the following questions for companies with 50 employees.
a) What is the probability of no off-the-job accidents during a one-year period?
b) What is the probability of at least two off-the-job accidents during a one-year period?
c) What is the expected number of off-the-job accidents during six months?
d) What is the probability of no off-the-job accidents during the next six months?
37
Poisson Probability Distribution
Example: National Safety Council
38
Poisson Probability Distribution
◼ A property of the Poisson distribution is that the mean and variance are equal.
=2
Example: Mercy Hospital
◼ Variance for Number of Arrivals during 30-Minute Periods
=2=3
◼ In waiting line applications, the exponential distribution is often used for service times.
40
Exponential Probability Distribution
◼ Density Function
𝑓 𝑥 = 𝜇𝑒 −𝜇𝑥 for x ≥ 0
where: = mean service rate = 1/ (mean service time).
◼ Cumulative Probabilities
𝑝 𝑥 ≤ 𝑥0 = 1 − 𝑒 −𝜇𝑥0
41
Exponential Probability Distribution
◼ Example: Al’s Full-Service Pump
◼ The time between arrivals of cars at Al’s full-service gas pump follows an exponential probability
distribution with a mean time between arrivals of 3 minutes. Al would like to know the probability that the
time between two successive arrivals will be 2 minutes or less.
42
Exponential Probability Distribution
◼ Example: Al’s Full-Service Pump
f(x)
43
Exponential Probability Distribution
Example: Airport Security
◼ The time required to pass through security screening at the airport can be annoying to travelers. The mean
wait time during peak periods at Cincinnati/Northern Kentucky International Airport is 12.1 minutes (The
Cincinnati Enquirer, February 2, 2006). Assume the time to pass through security screening follows an
exponential distribution.
a) What is the probability it will take less than 10 minutes to pass through security screening during a peak
period?
b) What is the probability it will take more than 20 minutes to pass through security screening during a peak
period?
c) What is the probability it will take between 10 and 20 minutes to pass through security screening during a
peak period?
d) It is 8:00 A.M. (a peak period) and you just entered the security line. To catch your plane you must be at
the gate within 30 minutes. If it takes 12 minutes from the time you clear security until you reach your
gate, what is the probability you will miss your flight?
44
Exponential Probability Distribution
Example: Airport Security
45
Relationship between the Poisson and Exponential Distributions
46
Example: SJJT, Inc. (A)
◼ M/M/1 Queuing System
Joe Ferris is a stock trader on the floor of the New York Stock Exchange for the firm of
Smith, Jones, Johnson, and Thomas, Inc. Stock transactions arrive at a mean rate of 20
per hour. Each order received by Joe requires an average of two minutes to process.
47
Example: SJJT, Inc. (A)
◼ M/M/1 Queuing System
Orders arrive at a mean rate of 20 per hour or one order every 3 minutes. Therefore, in
a 15 minute interval the average number of orders arriving will be = 15/3 = 5.
48
Example: SJJT, Inc. (A)
◼ Arrival Rate Distribution
Question
What is the probability that no orders are received within a 15-minute period?
Answer
P (x = 0) = (50e -5)/0! = e -5 = 0.0067
49
Example: SJJT, Inc. (A)
◼ Arrival Rate Distribution
Question
What is the probability that exactly 3 orders are received within a 15-minute period?
Answer
P (x = 3) = (53e -5)/3! = 125(.0067)/6 = 0.1396
50
Example: SJJT, Inc. (A)
◼ Arrival Rate Distribution
Question
What is the probability that more than 6 orders arrive within a 15-minute period?
Answer
P (x > 6) = 1 - P (x = 0) - P (x = 1) - P (x = 2) - P (x = 3) - P (x = 4) - P (x = 5) - P (x = 6)
= 1 - 0.762 = 0.238
51
Example: SJJT, Inc. (A)
◼ Service Rate Distribution
Question
What is the mean service rate per hour?
Answer
Since Joe Ferris can process an order in an average time of 2 minutes (= 2/60 hr.), then
the mean service rate, µ, is µ = 1/(mean service time), or 60/2.
= 30/hr.
52
Example: SJJT, Inc. (A)
◼ Service Rate Distribution
Question
What percentage of the orders will take less than one minute to process?
Answer
Since the units are expressed in hours,
P (T < 1 minute) = P (T < 1/60 hour).
Using the exponential distribution, P (T < t ) = 1 - e-µt.
Hence, P (T < 1/60) = 1 - e-30(1/60)
= 1 - 0.6065 = 0.3935 = 39.35%
53
Example: SJJT, Inc. (A)
◼ Service Rate Distribution
Question
What percentage of the orders will be processed in exactly 3 minutes?
Answer
Since the exponential distribution is a continuous distribution, the probability a service
time exactly equals any specific value is 0.
54
Example: SJJT, Inc. (A)
◼ Service Rate Distribution
Question
What percentage of the orders will require more than 3 minutes to process?
Answer
The percentage of orders requiring more than 3 minutes to process is:
P (T > 3/60) = e-30(3/60) = e -1.5 = 0.2231 = 22.31%
55
Example: SJJT, Inc. (A)
◼ Average Time in the System
Question
What is the average time an order must wait from the time Joe receives the order until it
is finished being processed (i.e. its turnaround time)?
Answer
This is an M/M/1 queue with = 20 per hour and = 30 per hour. The average time an
order waits in the system is: W = 1/(µ - )
= 1/(30 - 20)
= 1/10 hour or 6 minutes
56
Example: SJJT, Inc. (A)
◼ Average Length of Queue
Question
What is the average number of orders Joe has waiting to be processed?
Answer
Average number of orders waiting in the queue is:
Lq = 2/[µ(µ - )]
= (20)2/[(30)(30-20)]
= 400/300
= 4/3
57
Example: SJJT, Inc. (A)
◼ Utilization Factor
Question
What percentage of the time is Joe processing orders?
Answer
The percentage of time Joe is processing orders is equivalent to the utilization factor,
/. Thus, the percentage of time he is processing orders is:
/ = 20/30
= 2/3 or 66.67%
58
Example: SJJT, Inc. (A)
Poission Arrival Rate 𝜆 20
Exponential Service Rate 𝜇 30
𝜆
0 =1−
Probability that no units are in the system 𝜇 0.333
𝜆
Average number of units in the waiting line = 1.333
𝜇 𝜇 −𝜆
𝜆
Average number of units in the system = 2
𝜇
60
Example: SJJT, Inc. (B)
◼ M/M/2 Queuing System
Smith, Jones, Johnson, and Thomas, Inc. has begun a major advertising campaign which it believes will
increase its business 50%. To handle the increased volume, the company has hired an additional floor
trader, Fred Hanson, who works at the same speed as Joe Ferris. Note that the new arrival rate of orders,
, is 50% higher than that of problem (A). Thus, = 1.5(20) = 30 per hour.
61
Example: SJJT, Inc. (B)
◼ Sufficient Service Rate
Question
Why will Joe Ferris alone not be able to handle the increase in orders?
Answer
Since Joe Ferris processes orders at a mean rate of µ = 30 per hour, then = µ = 30
and the utilization factor is 1.
This implies the queue of orders will grow infinitely large. Hence, Joe alone cannot
handle this increase in demand.
62
Example: SJJT, Inc. (B)
◼ Probability of n Units in System
Question: What is the probability that neither Joe nor Fred will be working on an order
at any point in time?
Answer: Given that = 30, µ = 30, k = 2 and ( /µ) = 1, the probability that neither Joe
nor Fred will be working is:
1
0 =
𝑘−1 𝜆/𝜇 𝜆/𝜇 𝑘 𝑘𝜇
σ =0
𝑛! 𝑘! 𝑘𝜇 − 𝜆
63
Example: SJJT, Inc. (B)
◼ Average Time in System
Question: What is the average turnaround time for an order with both Joe and Fred
working?
Answer: The average turnaround time is the average waiting time in the system, W.
𝜆𝜇 𝜆/𝜇 𝑘
= 0 = 1/3 [Average number of units in the waiting line]
𝑘 − 1 ! 𝑘𝜇 − 𝜆
W = L/ = (4/3)/30 = 4/90 hr. = 2.67 min. [Average time a unit spends in the system]
64
Example: SJJT, Inc. (B)
◼ Average Length of Queue
Question: What is the average number of orders waiting to be filled with both Joe and
Fred working?
Answer: The average number of orders waiting to be filled is Lq.
𝜆𝜇 𝜆/𝜇 𝑘
= 0 = 1/3 [Average number of units in the waiting line]
𝑘 − 1 ! 𝑘𝜇 − 𝜆
65
Number of channels k 2
Poission Arrival Rate 𝜆 30
Exponential Service Rate 𝜇 30
1
0 =
Probability that no units are in the system 𝜆/𝜇 𝜆/𝜇 𝑘 𝑘𝜇 0.333
σ𝑘−1
=0 𝑛! 𝑘! 𝑘𝜇 − 𝜆
𝜆𝜇 𝜆/𝜇 𝑘
Average number of units in the waiting line = 0 0.333
𝑘 − 1 ! 𝑘𝜇 − 𝜆
𝜆
Average number of units in the system = 1.333
𝜇
66
Example: SJJT, Inc. (C)
◼ Economic Analysis of Queuing Systems
The advertising campaign of Smith, Jones, Johnson and Thomas, Inc. (see problems
(A) and (B)) was so successful that business actually doubled. The mean rate of stock
orders arriving at the exchange is now 40 per hour and the company must decide how
many floor traders to employ. Each floor trader hired can process an order in an average
time of 2 minutes.
Based on a number of factors the brokerage firm has determined the average waiting cost
per minute for an order to be $.50. Floor traders hired will earn $20 per hour in wages
and benefits. Using this information compare the total hourly cost of hiring 2 traders
with that of hiring 3 traders.
67
Example: SJJT, Inc. (C)
◼ Economic Analysis of Queuing Systems
Total Hourly Cost
= (Total salary cost per hour) + (Total hourly cost for orders in the system)
= ($20 per trader per hour) x (Number of traders)
+ ($30 waiting cost per hour) x (Average number of orders in the system)
= 20k + 30L.
Thus, L must be determined for k = 2 traders and for k = 3 traders with = 40/hr. and = 30/hr.
(since the average service time is 2 minutes (1/30 hr.).
68
Example: SJJT, Inc. (C)
◼ Cost of Two Servers
1
0 = 𝑘 = 0.2
𝜆/𝜇 𝜆/𝜇 𝑘𝜇
σ𝑘−1
=0 𝑛! 𝑘! 𝑘𝜇 − 𝜆
𝜆𝜇 𝜆/𝜇 𝑘
= 0 = 1.067
𝑘 − 1 ! 𝑘𝜇 − 𝜆
69
Example: SJJT, Inc. (C)
◼ Cost of Three Servers
1
0 = 𝑘 = 0.224
𝜆/𝜇 𝜆/𝜇 𝑘𝜇
σ𝑘−1
=0 𝑛! 𝑘! 𝑘𝜇 − 𝜆
𝜆𝜇 𝜆/𝜇 𝑘
= 0 = 0.096
𝑘 − 1 ! 𝑘𝜇 − 𝜆
70
Thank You !!!