Lecture 8
Lecture 8
8.1 Definitions
A queuing process consists in customers arriving at a service facility, then waiting in a line
(queue) if all servers are busy, eventually receiving service, and finally departing from the
facility. A queuing system is a set of customers, a set of servers, and an order whereby
customers arrive and are processed.
(Bose) “the basic phenomenon of queuing arises whenever a shared facility needs to be
accessed for service by a large number of jobs or customers.”
(Wolff) “The primary tool for studying these problems [of congestions] is known as queueing
theory.”
(Kleinrock) “We study the phenomena of standing, waiting, and serving, and we call this study
Queueing Theory." "Any system in which arrivals place demands upon a finite capacity
resource may be termed a queuing system.”
(Mathworld) “The study of the waiting times, lengths, and other properties of queues.”
Applications of Queuing Theory:
Telecommunications
Traffic control
Determining the sequence of computer operations
Predicting computer performance
Health services (eg. control of hospital bed assignments)
Airport traffic, airline ticket sales
Layout of manufacturing systems.
In many retail stores and banks
o multiple line/multiple checkout system → a queuing system where customers
wait for the next available cashier
o We can prove using queuing theory that: throughput improves increases when
queues are used instead of separate lines
AHA – Lecture 8 1
8.2 Basic Elements
Arrival distribution
Single or bulk arrival
Queue size
Finite or infinite
Calling source
Finite or infinite
Human behaviour
Balking: occurs when an arriving customer refuses to enter the service facility because
the queue is too long.
Reneging: occurs when a customer already in a queue leaves the queue and the facility
because the wait is too long.
Jockeying: occurs when a customer moves to another waiting line to reduce his waiting
time.
System
Arrivals Departures
Time in 3
J = Shaded area = 9
System 2
AHA – Lecture 8 2Same in all cases!
1
1 2 3
Packet #
Example
Observe 120 cars in front of the Nyali bridge
Observe 32 cars/minute depart over a period where no cars in the bridge at the start or end
What is average waiting time before and in the bridge?
W L 120
32 3.75min
v \ w \ x \ y
\z
Examples
• M/M/1: Exponential arrivals and service, 1 server, infinite capacity and population, FCFS
(FIFO)
• M/M/m: Same, but M servers
• G/G/3/20/1500/SPF: General arrival and service distributions, 3 servers, 17 queue slots
(20-3), 1500 total jobs, Shortest Packet First
AHA – Lecture 8 3
L
Lq
1
Wq
Goal: A closed form expression of the probability of the number of jobs in the queue (P i) given
only and
• Given:
• : Arrival rate of jobs (packets on input link)
• : Service rate of the server (output link)
• Solve:
• L: average number in queuing system
• Lq average number in the queue
• W: average waiting time in whole system
• Wq average waiting time in the queue
• 4 unknown’s: need 4 equations
• 4 unknowns: L, Lq W, Wq
• Relationships using Little’s law:
– L=W
– Lq=Wq (steady-state argument)
– W = Wq + (1/)
• If we know any 1, can find the others
• Finding L is hard or easy depending on the type of system. In general:
Equilibrium Condition
Inflow = outflow
1. (-)Pn = Pn-1 + Pn+1
2. Pn = Pn+1 2
P1 P0 , P2 P0 ,
Stability:
1: Pn P0
n
L nPn n n (1 ) (1 ) n n 1
n 0 n 0 n 1
1 n
(1 ) d
d (1 ) dd
1
1
n0
(1 ) (1 )
1
(1 ) 2
W L 1 1
Wq W 1
1
( )
Lq Wq ( ) ( )
2
Re-expression
L = / (1-)
Lq = 2 / (1-)
W = 1 / (-)
Wq = / (-)
AHA – Lecture 8 5
1. Consider the queuing situation with one server in which arrivals occur at the rate = 3 per
hour and service is performed at the rate = 8 per hour. The probabilities Pn of n customers
in the system are computed for the situation as given below:
n 0 1 2 3 4 5 6 7 8
Pn 0.625 0.234 0.088 0.033 0.012 0.005 0.002 0.001 0
Compute L, W, Wq and Lq
Solution
L = nPn = (0 * 0.625) + (1 * 0.234) + ………….+ (8 * 0) = 0.6 customers.
2. The men’s department of a large store employs one tailor for customer fittings. The number of
customers requiring fittings appears to follow a Poisson distribution with mean arrival rate 24
per hour. Customers are fitted on a first-come, first-served basis, and they are always willing
to wait for the tailor’s service, because alterations are free. The time it takes to fit a customer
appears to be exponentially distributed, with a mean of 2 min. (a) What is the average
number of customers in the fitting room? (b) How much time should a customer expect to
spend in the fitting room? (c) What percentage of the time is the tailor idle? (d) What is the
probability that a customer will wait more than 10 min for the tailor’s service?
Solution
c. The tailor is idle if and only if there is no customer in the fitting room. The probability of this
event is given by
p0 = 0 (1-) = 1(1-0.8) = 0.2
d. With t = 1/6 hr = W
Wq (1/6) = 0.8e-1 = 0.2943
3. A gourmet delicatessen is operated by one person, the owner. The arrival pattern of
customers on Saturdays appears to follow a Poisson distribution, with a mean arrival rate of
10 people per hour. Customers are served on a FIFO basis, and because of the reputation of
the store they are willing to wait for service once they arrive. The time it takes to serve a
customer is estimated to be exponentially distributed, with an average service time of 4
minute. Determine (a) the probability that there is a queue, (b) the average size of the queue,
(c) the expected time that a customer must wait in the queue, and (d) the probability that a
customer will spend less than 12 minutes in the store.
Solution
AHA – Lecture 8 6
a. The probability of having a queue is the probability of having two or more customers in the
system.
d. W = 8 + 4 = 12 minute
4. A certain petrol pump, customers arrive in a Poisson process with an average time of 5
minutes between arrivals. The time-intervals between services at the petrol pump follow
exponentially distribution and as such the mean time taken to service a unit is 2 minutes. On
the basis of this information you are required to answer the following questions:
i. What would be the expected average queue length?
ii. What would be the average number of customers in the queuing system?
iii. How long on an average a customer does spend in this system?
iv. How much should the flow of customers be increased to justify the opening of a
second service point if the management is willing to open the same provided the
customer has to wait for 5 minutes for the service?
Solution
A discrete random variable N has a Poisson distribution with parameters if, for n = 0, 1, 2,…..
If N is a Poisson random variable, it can be shown that E(N) = var N = . If we define Nt to be the
number of arrivals to occur during any time interval of length t, Theorem 1 states that
AHA – Lecture 8 7
Since Nt is Poisson with parameter t, E(Nt) = var Nt = t. An average of t arrivals occur during a
time interval of length t, so may be thought of as the average number of arrivals per unit time, or
the arrival rate.
Example
The number of glasses of drink ordered at the restaurant follows a Poisson distribution, with an
average of 30 drinks per hour being ordered.
i. Find the probability that exactly 60 drinks are ordered between 10 pm and 12
midnight.
ii. Find the mean and standard deviation of the number of drinks ordered between 9 pm
and 1 am.
iii. Find the probability that the time between two consecutive orders is between 1 and 3
minutes.
Solution
i. The number of drinks ordered between 10 pm and 12 midnight will follow a Poisson
distribution with parameter 2(30) = 60.
= e-606060 / (60!)
ii. We have = 30 drinks per hour; t=4 hours. Thus, the mean number of beers ordered
between 9pm and 1pm is 4(30) = 120 drinks. The standard deviation of the number
of drinks ordered between 10pm and 1am is (120)0.5 = 10.95
iii. Let X be the time (in minutes) between successive drink orders. The mean number of
orders per minute is exponential with parameters or rate (30/60) = 0.5 drinks per
minute. Thus, the probability density function of the time between drink orders is
(0.5)-0.5t. Then
P(1 X 3) = ((0.5)-0.5t) dt = e-0.5 - e-1.5 = 0.38
AHA – Lecture 8 8