Queueing Model: A Brief Introduction: Inputs
Queueing Model: A Brief Introduction: Inputs
Let us think about a queue (waiting line) most of us have seen, the line at Orins place
caf in Paccar hall. Let us consider the simplest case, one line in front of a single cashier.
For now, ignore the role of second cashier (occasionally open) and the barista. We will
discuss in class the wide applicability (not just cafes) of the insights we draw from this
model.
Inputs
Customers arrive at the caf and join the line. The time between any two customer
arrivals is variable and uncertain but we can say, for example, on average two customers
join the line every minute. The rate at which customers join the line is what we call
arrival rate (symbol lambda
case, arrival rate lambda is 2 per minute. This also means that the average time
between two arrivals is minute; we call this interarrival time.
The time cashier takes to serve one customer is called service time. This too changes
from customer to customer and is, therefore, variable and uncertain. Let us say, on
average, service time for a customer is 15 seconds = minute. This also means that the
one cashier can serve customers at the rate of 1/(1/4) = 4 customers per minute; this is
rho for the utilization. This is equal to the ratio of the rate at which work arrives and
the capacity of the station. The idea is exactly the same as utilization computation in
chapter 1.We know that the rate at which work arrives is arrival rate lambda
. One
cashier can service the work at the rate of service rate . If there are more than one
servers (that is, if number of servers m is more than 1) then total rate at which work can
2
0.5
1* 4
Second output is number of customers waiting. We use the symbol Lq for this. Note that
this excludes the person who is actually getting serviced by the cashier. We have a simple
table to find this value. The table is attached. To look at the table we need two things:
/
first, (arrival rate/service rate, that is lambda/mu
) and second, number of servers m.
/
In Orin cafs case
is 2/4=0.5 and m is 1. You will find one row in the table that
corresponds to these two values. In this row, read the number in column titled Lq. You
will see that the number is 0.5. This means that, on an average, the number of people
waiting in line Lq is 0.5.
Only in the special case when there is only one server, m=1, we can also use a simple
formula to compute the number of customers waiting Lq. (The table works for all values
2
2
0.5
Lq
Lq
1
1 0.5
of m, including m=1). For m=1:
. For example, in this case
=0.5,
same as that we got from table.
Third output is the time an average customer waits in line to receive service. We use the
symbol Wq for this. We have a simple formula to convert number-of-customers-waiting
Lq into time-a-customer-waits Wq. To get Wq, divide Lq by arrival rate lambda
Wq
Lq
0.5
0.25
2
(Littles
min = 15 seconds.
Sometimes we want to think about the whole system, that is, not just waiting but both
waiting and getting service. We would like to know the time-a-customer-spends-in-thesystem (we use symbol Ws for this) including both time for waiting and time for service.
Clearly, this is equal to time-a-customer-waits Wq plus service time. In Orin cafs case,
Ws is just equal to the sum of waiting time (15 sec.) and service time (15 sec.). Ws=30sec
= 0.5 min.
There is also the question of the number-of-customers-in-system (symbol Ls), including
both, customers who are waiting and who are getting service. Another application of
Littles law shows that to get number-of-customers-in-system symbol Ls, multiply timein-system Ws by arrival rate lambda
Ls Ws 2 * 0.5 1
Finally, to compute the chance that system is idle, that is, there is no customer in the
system, we can read the column titled P0 from the table, just the way we read Lq. For Orin
caf, P0=0.5, that is 50% chance that cashier is free.
Other Performance Measures
For single-server case, some other performance measures can be computed as following:
Pn (1 ) n
For example, if Orin caf pays $15 per hour to a cashier then adding one more cashier
increases the cost of providing capacity by $15 per hour. But it also reduces the number
Ls 1
Ls 0.533 Lq 0.033
of customer in system from
(see above) to
(
from table for
Ls
m=2 and then repeat the above steps to get ). If we assume that a customers time is
worth $20 per hour then system saves (1-0.533)*$20 per hour = $9.34. Therefore, in this
example, from total system cost perspective, we should not add another server.
Other Extensions
Without making much fuss about it, we have made two significant assumptions about the
pattern of variability in arrivals and service: Poisson distribution for number of arrivals
and Exponential distribution for service times. These assumptions mean the following:
Ca 1
coefficient of variation =(standard deviation / mean) for interarrival times
and
Cs 1
coefficient of variation =(standard deviation / mean) for service times
. But what if
based on measurement of real data, they are not 1? We call this the case of general
arrivals and service.
It is easy to compute Lq in this more general case as follows:
Lq in case Ca 1 and / or Cs 1
Ca2 Cs2
( Lq as computed from table )
Lq
Starting from
earlier.
Summary
Arrival rate lambda = 1 / (interarrival time, that is time between two arrivals)
Service rate mu
= 1 / service time
Number of servers m
/ ( m )
Utilization rho
Assume arrivals Poisson distribution and service time are exponentially distributed.
/
Average number in waiting line Lq can be obtained from table (given
and m)
Lq 2 /(1 )
In case number of servers m=1, we can also use
Wq Lq /
Average waiting time
from Littles Law
Ws Wq (1 / )
Average time-in-system (waiting time +service time)
Ls Ws
Average number-in-system (waiting+getting served)
Probability that there is nobody in the system P0 is available in table.
For single-server case, m=1, we have following three formulas:
Pn (1 ) n
Queueing
Model: Practice Problems
1. A small town with one hospital has two ambulances to supply ambulance service. Requests for
ambulances during non-holiday weekend averages 0.8 per hour and tend to be Poisson
distributed. Travel and assistance time averages one hour per call and follows an exponential
distribution. What is the utilization of ambulances? On an average, how many requests are
waiting for ambulances? How long will a request have to wait for ambulances? What is the
probability that both ambulances are sitting idle at a given point in time?
2. At a banks ATM location with a single machine, customers arrive at the rate of one every
other minute. This can be modeled using a Poisson distribution. Each customer spends an
average of 90 seconds completing his/her transactions. Transaction time is exponentially
distributed. Determine (1) the average time customers spend from arriving to leaving, (2) the
chance that the customer will not have to wait, (3) the average number waiting to use the
machine.
3. The last two things that are done before a car is completed are engine marriage (station 1) and
tire installation (station 2). On average 54 cars per hour arrive at the beginning of these two
stations. Three servers are available for engine marriage. Engine marriage requires 3 minutes.
The next stage is a single server tire installation. Tire installation requires 1 minute. Arrivals are
Poisson and service times are exponentially distributed.
(1) What is the queue length at each station?
(2) How long does a car spend waiting at the final two stations?
4. A machine shop leases grinders for sharpening their machine cutting tools. A decision must be
made as to how many grinders to lease. The cost to lease a grinder is $50 per day. The grinding
time required by a machine operator to sharpen his cutting tool has an exponential distribution,
with an average of one minute. The machine operators arrive to sharpen their tools according to a
Poisson process at a mean rate of one every 20 seconds. The estimated cost of an operator being
away from his machine to the grinder is 10 per minute. The machine shop is open 8 hours per
day. How many grinders should the machine shop lease?
5. (a) Consider a queue with a single server, arrival rate of 5 per hour and service rate of 10 per
hour. Assuming Poisson arrivals and exponential service time, what is the waiting time in queue?
(b) Actual measurements show that interarrival time standard deviation is 24 minutes and service
time standard deviation is 3 minutes. What is the waiting time in queue?
0.8
0.4
m 2 *1
Utilization
/
Lq 0.152 P0 0.429
From table:
Lq 0.152
Lq
0.152
0.19 hr
0.8
P0 0.429
What is the probability that both ambulances are sitting idle at a given point in time..
Ws , Ls
Ls Ws 0.8*1.19 0.952
Solution:
0.5 / min
One every other minute means arrival rate
1/ 90sec 0.667 / min m 1
Service rate
0.5
0.75
m 1*0.667
Lq
2
0.752
2.25
(1 ) 1 0.75
(we an use the formula because m=1; table should give the same
result)
Wq
Lq
2.25
4.5min
0.5
Ws
(1) the average time customers spend from arriving to leaving
= waiting + service time = Wq+
90 sec = 4.5min+1.5min= 6 minutes
(2) the chance that the customer will not have to wait that is the chance that there are 0
P0 1
customers in system =
=0.25 (the formula is for m=1 case) (3) the average number
Lq
waiting to use the machine =2.25
3. The last two things that are done before a car is completed are engine marriage (station 1) and
tire installation (station 2). On average 54 cars per hour arrive at the beginning of these two
stations. Three servers are available for engine marriage. Engine marriage requires 3 minutes.
The next stage is a single server tire installation. Tire installation requires 1 minute. Arrivals are
Poisson and service times are exponentially distributed.
(a) What is the queue length at each station?
(b) How long does a car spend waiting at the final two stations?
(a) We can analyze these two stations as independent queues. One queue at station 1 followed by
another queue at station 2.
Station 1: Engine Marriage
m=3
= 54 per hour
= 20 per hour
/
=54/20=2.7,
(1) From the table we know that Lq=7.354
Lq
Note that 4 grinders result in a cost of providing service equal to $6.25*4 per hour. Since, on
average, there are 4.528 operators away from their machines, the cost of customer waiting (being
away from machine) is $6*4.528 per hour. The operator being services is also away from his
machine
M=5:
Lq 0.354 (from Table , / =3 , M=5),
5 grinders should be leased, since this yields the lowest total cost per hour ($51.37).
5. (a) Consider a queue with a single server, arrival rate of 5 per hour and service rate of 10 per
hour. Assuming Poisson arrivals and exponential service time, what is the waiting time in queue?
(b) Actual measurements show that interarrival time standard deviation is 24 minutes and service
time standard deviation is 3 minutes. What is the waiting time in queue?
(a) Arrivals follow Poisson distribution. This means that interarrival time standard deviation is
equal to interarrival time mean and that coefficient of variation (=standard deviation/mean) of
interarrival time Ca=1. Service time follows exponential distribution. This means that service
time standard deviation is equal to service time mean and that coefficient of variation (=standard
deviation/mean) of service time Cs=1. This means that for part (a) we can use standard table or
formulas to compute performance.
5 / hr; 10 / hr; / 0.5
; m=1
/ m 0.5
Lq 2 / (1 ) 0.25 / (1 0.5) 0.5 Wq Lq / 0.5 / 5 0.1hr 6 min
;
(b) Now that standard deviations are not equal to mean, we have neither Ca=1, nor Cs=1. We need
to modify above results to incorporate new values of Ca and Cs.
Since arrival rate is 5 per hour, average interarrival time is (1/5) hr = 12 minutes.
Standard deviation of interarrival time is 24 minutes.
Coefficient of variation of interarrival time Ca= standard deviation/mean=24/12=2.
Since service rate is 10 per hour, average service time is (1/10) hr = 6 minutes.
Lq 0.5*(
22 0.52
) 1.0625
2