OR II Lecture Notes
OR II Lecture Notes
1 Queuing System
1.1 Introduction
A flow of customers from finite or infinite population towards the service facility forms a queue
(waiting line) an account of lack of capability to serve them all at a time. In the absence of a
perfect balance between the service facilities and the customers, waiting time is required either for
the service facilities or for the customers arrival. Queuing system consists of one or more queues
and one or more servers and operates under a set of procedures. Depending upon the server
status, the incoming customer either waits at the queue or gets the turn to be served. If the server
is free at the time of arrival of a customer, the customer can directly enter into the counter for
getting service and then leave the system. In this process, over a period of time, the system may
Definition 1.1. Queuing system: Queuing theory is a branch of mathematics that studies and
models the act of waiting in lines. It involves dealing with items or people in sequence. Thus, a
queuing problem consists either of determining what facilities to provide or scheduling the use of
them. The cost of providing service and the waiting time of users are minimized. Examples of
such problems include determining the number of checkout counters to provide at a supermarket,
runways at an airport, parking spaces at a shopping centre, or tellers in a bank. Many maintenance
problems can be treated as queuing problems; items requiring repair are like users of a service.
• Step 1: Preliminary study:- This stage involves an analysis of the process created through a
flow diagram. An attempt is made to identify the points, which restrict service or the character-
istics, which indicate scope for improvement.
1
be given to the arrivals involving high cost of waiting time. In multi-channel queues, separate
channels of service are provided for different types of customers.
• Step 3: Collection of data and analysis:- Direct observation of the system in terms of
customer’s arrival time, service rate, length of queue and waiting time is done during the collection
stage. The data is analyzed in detail to determine the statistical pattern of the variables. The
measures of efficiency of the system are computed on the basis of queuing theory. These are
counter-checked with the results obtained through direct observation to confirm the validity of
the formulae applied. It may be necessary to collect additional data regarding the process.
• Step 4: Evaluation of alternatives:- Effect of modifying the constituents of the system on the
basis of the selected alternatives is evaluated through application of queuing theory. Simulation
technique is another alternative. Based on the results obtained, the best combination of the
changes to be made in the existing system is selected.
• Step 5: Implementation: Formulated proposals are implemented and tested on a small scale.
If the need arises, further changes are made and rechecked before implementing them on full
scale. It is advisable to observe the functioning of the system periodically to ensure that the
desired results are maintained.
and
Z ∞ Z ∞ ∞
−λt −λt −λt
= e−λt .
P (T > t) = λe dt = λ e dt = − e
t t 0
Example 1.1. The time spent waiting between events is often modeled using the exponential
distribution. Suppose that an average of 30 customers per hour arrive at a store and the time
between arrivals is exponentially distributed.
(a) On average, how many minutes elapse between two successive arrivals?
Since we expect 30 customers to arrive per hour (60 minutes), we expect on average one
customer to arrive every two minutes on average.
(b) When the store first opens, how long on average does it take for three customers to arrive?
Since one customer arrives every two minutes on average, it will take six minutes on average
for three customers to arrive.
2
(c) After a customer arrives, find the probability that it takes less than one minute for the next
customer to arrive.
Let X = the time between arrivals, in minutes. By part (a), µ = 2, so m = 12 = 0.5. There-
fore, X ∼ exp(0.5).The cumulative distribution function is P (X < x) = 1–e(–0.5x) .Therefore
P (X < 1) = 1–e(–0.5)(1) ≈ 0.3935
(d) After a customer arrives, find the probability that it takes more than five minutes for the
next customer to arrive.
(e) Seventy percent of the customers arrive within how many minutes of the previous customer?
• This distribution lends itself well to modeling customer inter-arrival times or service times for
2. Poisson probability distribution:- The Poisson distribution is used to determine the proba-
bility of a certain number of arrivals occurring in a given time period. The Poisson distribution
with parameter λ is given by
(λt)n e−λt
,
n!
where n is the number of arrivals. We find that if we set n = 0, the Poisson distribution gives us
e−λt which is equal to P (T > t) from the exponential distribution. The inter-arrival time here,
of course, is the time between customer arrivals, and thus is a period of time with zero arrivals.
(i) At a police station in a large city, calls come in at an average rate of four calls per minute.
Assume that the time that elapses from one call to the next has the exponential distribution.
Take note that we are concerned only with the rate at which calls come in, and we are
ignoring the time spent on the phone. We must also assume that the times spent between
calls are independent. This means that a particularly long delay between two calls does not
mean that there will be a shorter waiting period for the next call. We may then deduce that
the total number of calls received during a time period has the Poisson distribution.
3
(a) Find the average time between two successive calls.
(b) Find the probability that after a call is received, the next call occurs in less than ten
seconds.
(c) Find the probability that exactly five calls occur within a minute.
(d) Find the probability that less than five calls occur within a minute.
(e) Find the probability that more than 40 calls occur in an eight-minute period.
(ii) If jobs arrive every 15 seconds on average,λ = 4 per minute,what is the probability of
waiting less than or equal to 30 seconds, i.e 0.5 min?
(iii) Accidents occur with a Poisson distribution at an average of 4 per week. i.e. λ = 4.
(a) Calculate the probability of more than 5 accidents in any one week
(b) What is the probability that at least two weeks will elapse between accident?
(iv) Suppose that the time between emergency calls to a small suburban fire station follows an
exponential distribution with an average rate of 1.8 calls per day.
(a) Phil the fireman has just clocked on. What is the chance of a call in the next 15
minutes?
(b) Phil has nearly finished his shift: 15 minutes to go. There has been no call during his
With these distributions in mind, we can begin defining the input and output processes of a basic
queuing system, from which we can start developing the model further.
4
1.3.1 The Input Process (arrival pattern)
The input described the way in which the customers arrive and join the system. Generally, cus-
tomers arrive in a more or less random manner which is not possible for prediction. Thus the
arrival pattern can be described in terms of probabilities and consequently the probability distri-
bution for inter-arrival times (the time between two successive arrivals) must be defined. We deal
with those Queuing system in which the customers arrive in poisson process. The mean arrival
rate is denoted by λ.
There are queues according to priority to certain types of customers. This type of queuing can
have two approaches:
• Non pre-emptive: In case of non pre-emptive priority, the customer getting service is allowed
to continue with service till completion, even if a “priority customer” arrives midway during his
service. This is a common form of priority.
• Pre-emptive: Pre-emptive priority involves stopping the service of the non priority customers
as soon as the priority customer arrives. For example, priority given to repairs of a production
holding machine over an auxiliary unit for allocation of maintenance labour force is a typical
example. Preference is given to larger ships over the smaller ones irrespective of the order in
which they arrive for allocation of berths.
5
• If there is more than one queue, the customers from one queue may be tempted to join another
queue because of its smaller size. This behaviour of customers is known as jockeying.
• If the queue length appears very large to a customer, he/she may not join the queue. This
property is known as Balking of customers. Arriving customers are said to “balk” if they do
not join a queue because of their reluctance to wait.
• Sometimes, a customer who is already in a queue will leave the queue in anticipation of longer
waiting line. This kind of departure is known as reneging.
• Collusion: Customers may be in collusion meaning that only one person would join the queue,
but demand service on behalf of several customers.
1. Arrivals
e−λt0 (λt0 )x
Prob[number of arrivals = x] = , x = 0, 1, 2, · · · .
x!
2. Service
3. Pattern discipline
Note: When the number of arrivals follows Poisson distribution (discrete), the inter-arrival
time; that is the time between arrivals follows exponential distribution (continuous).
6
1.4.2 Measuring the Queue’s Performance
Queuing models help managers make decisions that balance service costs with waiting-line costs.
Queuing analysis can obtain many measures of a waiting-line system’s performance, including the
following:
• Average time that each customer or object spends in the queue.
• Average time that each customer spends in the system (waiting time plus service time).
1.4.3 Notations
Notation Description
λ Average number of arrivals per unit time
µ Average number of customers served per unit time
ρ Traffic intensity
c The number of service channels
m The number of customers in the queue or the length of the queue
n The number of customers in the system
The number of customers in the queue + number of customers being served
Pn Steady state probability of finding n people in the system
E(m) Average length of queue
E(m/m > 0) Average length of a nonempty queue
E(n) or Ls Average number of customers in the system
W Steady state waiting time of a customer
E(w) or Wq Average waiting time of a customer
P (w = 0) Probability of not having to wait in the queue
E(w/w > 0) or Ws Average waiting time of a customer given that there is a queue
V Time spent by a customer in the system in steady state
Waiting time in the queue + service time
F (v) Probability density function of the time spent by a customer in the system
E(v) Average time spent by a customer in the system
7
1.5 Single Channel Models, (also called M/M/1)
The most common case of queuing problems involves the single-channel, or single-server, waiting
line. In this situation, arrivals form a single line to be serviced by a single station. We assume that
the following conditions exist in this type of system:
• Arrivals are served on a first-in, first-out (FIFO) basis, and every arrival waits to be served,
regardless of the length of the line or queue.
• Arrivals are independent of preceding arrivals, but the average number of arrivals (arrival rate)
does not change over time.
• Arrivals are described by a Poisson probability distribution and come from an infinite (or very,
very large) population.
• Service times vary from one customer to the next and are independent of one another, but their
average rate is known.
When these conditions are met, the following series of equations can be developed.
λ2
• Lq = average number of units waiting in the queue = µ(µ−λ)
λ
• Wq = average time a unit spends waiting in the queue = µ(µ−λ)
λ
• ρ = utilization factor for the system = µ
λ
• P0 = probability of 0 units in the system (that is, the service unit is idle) = 1 − µ
• Pn>k = probability of more than k units in the system, where n is the number of units in the
k+1
system = µλ
Example 1.2. The Tool Company’s quality control department is manned by a single clerk, who
takes an average of 5 minutes in checking parts of each of the machines coming for inspection. The
machines arrive once in every 8 minutes on the average. One hour of machine is valued at $15 and
a clerk’s time is valued at $4 per hour. What is the average hourly queuing system costs associated
with the quality control department?
8
1 1
Solution: Mean arrival rate λ = 8 per minute =7.5 per hour. Mean service rate µ = 5 per minute
=12 per hour.
1 1 1 40
Average time spent by a machine in the system E(v) = µ−λ = 1
− 81
= 3 = 3 minutes= 29 hours.
5 40
15×2
Average queuing cost per month is 9 = $ 10
3 .
60 10 60
An average arrival of 8 machines per hour cost 3 × 8 = $25 per hour.
Example 1.3. Tom Jones, the mechanic at Golden Muffler Shop, is able to install new mufflers
at an average rate of 3 per hour (or about 1 every 20 minutes), according to a negative exponential
λ2 22 4
• Lq = µ(µ−λ) = 3(3−2) = 3 cars waiting in line on average.
λ 2 2
• Wq = µ(µ−λ) = 3(3−2) = 3 hour = 40-minute average waiting time per car.
λ 2
• ρ= µ = 3 = 66.67% of time mechanic is busy
λ 2 1
• P0 = 1 − µ =1− 3 = 3 = 0.33% probability there are 0 cars in the system .
Example 1.4. The owner of the Golden Muffler Shop estimates that the cost of customer waiting
time, in terms of customer dissatisfaction and lost goodwill, is $10 per hour of time spent waiting
in line. Because the average car has a 23 -hour wait (Wq) and because there are approximately 16
cars serviced per day (2 arrivals per hour times 8 working hours per day), the total number of hours
that customers spend waiting each day for mufflers to be installed is
2 32 2
(16) = = 10 hour
3 3 3
9
Hence, in this case,
2
Customer waiting-time cost = $10 10 = $106.67 per day.
3
The only other major cost that Golden’s owner can identify in the queuing situation is the salary
of Jones, the mechanic, who earns $7 per hour, or $56 per day. Thus:
• The probability that there are zero people or units in the system is
1
P0 = "M −1 # , for M µ > λ.
X 1 λ n M
1 λ Mµ
+ M! µ M µ−λ
n! µ
n=0
• The average time a unit spends in the waiting line and being serviced (namely, in the system) is
M
λ
λµ µ 1 Ls
Ws = P0 + = .
(M − 1)!(M µ − λ)2 µ λ
10
• The average number of people or units in line waiting for service is
λ
Lq = Ls − .
µ
• The average time a person or unit spends in the queue waiting for service is
1 Lq
Wq = Ws − = .
µ λ
Example 1.5. The Golden Muffler Shop has decided to open a second garage bay and hire a second
mechanic to handle installations. Customers, who arrive at the rate of about λ = 2 per hour, will
wait in a single line until 1 of the 2 mechanics is free. Each mechanic installs mufflers at the rate
of about µ = 3 per hour. To find out how this system compares with the old single-channel waiting-
line system, we will compute several operating characteristics for the M = 2 channel system and
compare the results with those found in Example 1.3.
1 1 1 1
P0 = " 1 n # = = 2 1 =
1 2 1+ 2
+ 1 4 6 1+ 3 + 3
2
2 2 2(3)
X
1
3 2 9 6−2
+
Table 2: We can summarize the characteristics of the 2-channel model in Example 1.5 and compare
them to those of the single-channel model in Example 1.3 as follows
The increased service has a dramatic effect on almost all characteristics. For instance, note that
the time spent waiting in line drops from 40 minutes to only 2.5 minutes.
11
1.7 Constant-Service-Time Model (M/D/1)
Some service systems have constant, instead of exponentially distributed, service times. When
customers or equipment are processed according to a fixed cycle, as in the case of an automatic
car wash or an amusement park ride, constant service times are appropriate. Because constant
rates are certain, the values for Lq , Wq , Ls and Ws are always less than they would be in model 1.5
(Single Channel Models), which has variable service rates. As a matter of fact, both the average
queue length and the average waiting time in the queue are halved with Multiple Service Channel.
Constant-service-model formulas are given below.
λ2
Average length of queue: Lq =
2µ(µ − λ)
λ
Average waiting time in queue: Wq =
2µ(µ − λ)
λ
Average number of customers in system: Ls = Lq +
µ
1
Average waiting time in system: Ws = Wq +
µ
12
Exercise 1.2. Practice questions.
(a) Sid Das Brick Distributors currently employs 1 worker whose job is to load bricks on outgoing
company trucks. An average of 24 trucks per day, or 3 per hour, arrive at the loading platform,
according to a Poisson distribution. The worker loads them at a rate of 4 trucks per hour,
following approximately the exponential distribution in his service times. Das believes that
adding a second brick loader will substantially improve the firm’s productivity. He estimates
that a two-person crew at the loading gate will double the loading rate from 4 trucks per hour
to 8 trucks per hour. Analyze the effect on the queue of such a change and compare the results
to those achieved with one worker. What is the probability that there will be more than 3 trucks
either being loaded or waiting?
(b) Truck drivers working for Sid Das (see (a)) earn an average of $10 per hour. Brick loaders
receive about $6 per hour. Truck drivers waiting in the queue or at the loading platform are
drawing a salary but are productively idle and unable to generate revenue during that time.
What would be the hourly cost savings to the firm if it employed 2 loaders instead of 1?
(c) Sid Das is considering building a second platform or gate to speed the process of loading trucks.
This system, he thinks, will be even more efficient than simply hiring another loader to help
(e) When designing a waiting line system, what “qualitative” concerns need to be considered?
(f ) Name the three factors that govern the structure of “arrivals” in a queuing system.
(h) State the assumptions of the “basic” single-channel queuing model (M/M/1).
(i) Is it good or bad to operate a supermarket bakery system on a strict first-come, first-served
basis? Why?
(j) Describe what is meant by the waiting-line terms balk and renege. Provide an example of each.
(k) Customers arrive at Paul Harrold’s Styling Shop at a rate of 3 per hour, distributed in a Poisson
fashion. Paul can perform haircuts at a rate of 5 per hour, distributed exponentially.
13
(l) There is only one copying machine in the student lounge of the business school. Students arrive
at the rate of λ = 40 per hour (according to a Poisson distribution). Copying takes an average
of 40 seconds, or µ = 90 per hour (according to an exponential distribution). Compute the
following:
(m) The arrival rate of customers at a banking counter follows a poisson distibution with a mean of
30 per hours. The service rate of the counter clerk also follows poisson distribution with mean
of 45 per hour.
(n) At one-man barbar shop, customers arrive according to poisson dist with mean arrival rate
of 5 per hour and the hair cutting time was exponentially distributed with an average hair cut
taking 10 minutes. It is assumed that because of his excellent reputation, customers were always
willing to wait. Calculate the following:
(i) Average number of customers in the shop and the average numbers waiting for a haircut.
(ii) The percentage of time arrival can walk in straight without having to wait.
(iii) The percentage of customers who have to wait before getting into the barber’s chair.
(o) Vehicles are passing through a toll gate at the rate of 70 per hour. The average time to pass
through the gate is 45 seconds. The arrival rate and service rate follow poisson distibution.
There is a complaint that the vehicles wait for a long duration. The authorities are willing to
install one more gate to reduce the average time to pass through the toll gate to 35 seconds if
the idle time of the toll gate is less than 9% and the average queue length at the gate is more
than 8 vehicle, check whether the installation of the second gate is justified?
(p) A supermarket has two girls ringing up sales at the counters. If the service time for each
customer is exponential with mean 4 minutes and if the people arrive in poisson fashion at the
rate of 10 per hour
14
(q) A petrol station has two pumps. The service time follows the exponential distribution with
mean 4 minutes and cars arrive for service in a poisson process at the rate of 10 cars per hour.
Find the probability that a customer has to wait for service. What proportion of time the pump
remains idle?
(r) . 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 dis-
tributed. 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?
(s) At a bank’s 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.
(t) The last two things that are done before a car is completed are engine marriage (station 1) and
(u) 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 10c per minute. The machine
shop is open 8 hours per day. How many grinders should the machine shop lease?
(v) (i) 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?
(ii) Actual measurements show that inter-arrival time standard deviation is 24 minutes and
service time standard deviation is 3 minutes. What is the waiting time in queue?
15