OR 122 -CH11
OR 122 -CH11
OR 122
Biostatistics
Chapter 11:
Queuing Theory
Queues are common in everyday table.
Queuing System:
Can be completely described by:
1) The input process (Arrival pattern)
2) The service mechanism (service pattern)
3) Queue Discipline
4) Output of the queue (customer behavior)
◦ Generally, this factor is not important.
Arrival → Customer waiting → Unit is being → Unit leaving the
in line served queue after serving
Constant Random
Finite Infinite
population population
Input process:
Describes the way in which the customers arrive and join the system.
The size of arrivals depends on whether the size of the population is finite or
infinite
For example:
In a restaurant ⇒ arrival times of customer are distributed randomly.
In a clinic appointments ⇒ arrival times of patients are constant (specified
intervals of time).
Mean arrival rate:
➢ The average number of customers per unit of time
1
MAR =
𝜆
Reneging: Customer join the queue and often waiting for certain time loses his
patience and leaves the queue.
Collusion: Several customers collaborate and only one of them may stand in a
queue. One customer represents a group.
Jockeying: A customer leaves the long queue and join the shorter one hoping of
getting the service.
Service Mechanism:
(1) Single channel facility: One queue – one service station.
(2) One queue – several service stations: The customers wait in a single
queue until one of the service stations is ready to take them.
(2) Last in first out (LIFO) or last come first served (LCFS)
(4) Service in propriety: A patient with stomach pain has less priority than a
patient with heart pain.
Note:
Ways of the queueing models assume that the interarrival time are independent
and identically distributed and that all service times are independent and
identically distributed.
M/M/S ⇒ M/M/S/FCFS/∞/ ∞
Assumes that both interarrival times and services time have an exponential
distribution and the number of services is s (any positive integer).
M/G/1 ⇒ M/G/1/FCFS/∞/ ∞
Assumes that both interarrival times have an exponential distribution and the
services time have an arbitrary distribution.
Terminology and notation:
𝑁 𝑡 = number of customers in queuing system at time 𝑡 ≥ 0 including customers in service (State of
system at 𝑡).
𝑃𝑛 𝑡 = Probability that exactly 𝑛 customers are in the queuing system at 𝑡.
𝑆 = number of servers in the queuing system.
𝐿 𝑜𝑟 𝐿𝑠 = Expected number of customers in the queuing system.
𝐿𝑞 = Expected number of customers in the queue (excluding customers being served).
𝑤 = Waiting time in the queueing system (including service time) for each individual customer.
𝑊 𝑜𝑟 𝑊𝑠 = 𝐸 𝑤 = Expected of waiting time in the system.
𝑤𝑞 = Waiting time in the queuing (exclude service time)
𝑊𝑞 = 𝐸 𝑤𝑞 = Expecting of waiting time in the queuing system (exclude service time)
𝜆 = Mean arrival time.
𝜇 =The mean service rate.
Relationship between 𝐿 𝑜𝑟 𝐿𝑠 , 𝑤 𝑜𝑟 𝑤𝑠 , 𝐿𝑞 𝑎𝑛𝑑 𝑊𝑞 :
𝐿 = 𝜆𝑊
𝐿𝑞 = 𝜆𝑊𝑞
1
The mean service time is constant and is denoted by ∀ 𝑛≥1
𝜇
1
⇒ 𝑊𝑠 = 𝑊𝑞 +
𝜇
Note:
𝜌 = Traffic intensity or utilization factor which represents the proportion of time
𝜆
the severs are busy =
𝜇
Steady-State balance equation:
𝑅𝑎𝑡𝑒 𝑖𝑛 = 𝑅𝑎𝑡𝑒 𝑜𝑢𝑡
Calculate 𝑃𝑛 𝑡 for 𝑛 = 0,1,2, …
State:
𝜆 𝜆 𝜆 𝜆 𝜆 𝜆
𝜇 𝜇 𝜇 𝜇 𝜇 𝜇
𝜆
State 0 ⇒ 𝜇𝑃1 = 𝜆𝑃0 ⇒ 𝑃1 = 𝜇 𝑃0 (1)
State 1⇒ 𝜆𝑃0 + 𝜇𝑃2 = 𝜇𝑃1 + 𝜆𝑃1
= (𝜇 + 𝜆)𝑃1
⇒ 𝜇𝑃2 = (𝜇 + 𝜆)𝑃1 − 𝜆𝑃0
𝜆
= (𝜇 + 𝜆) 𝑃 − 𝜆𝑃0
𝜇 0
𝜆(𝜇+𝜆)
= − 𝜆 𝑃0
𝜇
𝜇𝜆+𝜆2 −𝜇𝜆 𝜆2
𝜇𝑃2 = 𝑃0 = 𝑃0
𝜇 𝜇
𝜆2 𝜆 2
⇒ 𝑃2 = 𝑃0 ⇒ 𝑃2 = 𝑃0
𝜇2 𝜇
State n:
𝜆 𝑛
𝑃𝑛 = 𝜇
𝑃0
𝜆
Since, the utilization factor 𝜌 = 𝜇
⇒ 𝑃𝑛 = 𝜌 𝑛 𝑃0
𝜆
𝑃0 = 1 − 𝜇
For the model M/M/1/FCFS/∞/ ∞ the following equations are obtained:
𝜆
𝐿𝑠 =
𝜇−𝜆
𝜆 𝜆 𝜆2
Non − empty queue length
𝐿𝑞 = 𝜌𝐿𝑠 = =
𝜇 𝜇−𝜆 𝜇(𝜇−𝜆)
1 𝐿𝑠 𝑞𝑢𝑒𝑢𝑒 𝑠𝑦𝑠𝑡𝑒𝑚
𝑊𝑠 = = 𝜇
𝜇−𝜆 𝜆 1 𝜆
𝜆 1 𝜆 𝜇−𝜆 +
𝑊𝑞 = 𝜌𝑊𝑠 = = 𝜇−𝜆 𝜇
𝜇 𝜇−𝜆 𝜇(𝜇−𝜆)
𝑃 𝑤 > 𝑡 = 𝑒 −𝜇 1−𝜌 𝑡
𝑃 𝑤𝑞 > 𝑡 = 𝜌 × 𝑒 −𝜇 1−𝜌 𝑡
⇒ 𝑃 𝑤𝑞 > 𝑡 = 𝜌 × 𝑃 𝑤 > 𝑡
Example 1
A supermarket has a single cashier. During the peak hours, customers arrive at a
rate of 20 customers per hour. The average number of customers that can be
processed by the cashier is 24 per hour.
Calculate :
(i) Find the probability that the cashier is idle (not busy)?
(ii) The average number of customers in the queuing system is?
(iii) The average time a customer spend in the system is?
(iv) The average number of customers in the queue is?
(v) The average time a customer spends in the queue waiting for service is?
Solution
𝜇 = 24, 𝜆 = 20
𝜆 20
(i) 𝑃0 = 1 − 𝜌 = 1 − = 1 − = 0.167
𝜇 24
𝜆 20 20
(ii) 𝐿𝑠 = = = = 5 customers
𝜇−𝜆 24−20 4
1 1 1
(iii) 𝑊𝑠 = = = hours or 15 minutes
𝜇−𝜆 24−20 4
𝜆 20 100
(iv) 𝐿𝑞 = 𝐿𝑠 = 5= = 4.167
𝜇 24 24
20 1 5
(v) 𝑊𝑞 = 𝜌𝑊𝑠 = = or 12.5 minutes
24 4 24
Note that when 𝜆 < 𝜇 this means that 𝜌 < 1 and hence the system reaches the
steady state.
Example 2:
Emergency cases arrive independently at random. Assume arrivals follow
Poisson input process (exponential interarrival time) and the time spent with the
ER doctor is exponentially distributed. Arrival rate is 1 patient every 0.5 hour and
the average service time is 20 minutes to treat a patient.
(i) Find the probability that the doctor is idle (not busy)?
(ii) Find the probability that there are 3 patients?
(iii) Find the probability that there are at least 4 patients waiting to see the
doctor (waiting to be served =waiting in the system)?
(iv) Expected number of patients in the ER?
(v) Expected number of patients in the queue?
(vi) Expected waiting time in the ER?
(vii) Expected waiting time in the queue?
(viii) Find the probability that the patient waits more than 30 minutes in the queue?
(x) Find the probability that the patient waits more than 30 minutes in the ER?
Solution
Patient Arrive in hour
1
Arrival rate ⇒ 1 ⇒ 𝜆 = 2 persons/hour.
2
𝜆 1
𝜆 2
Utilization factor ⇒ ρ = = < 1 ⇒ the system reaches the steady state.
𝜇 3
𝜇 = 3, 𝜆 = 2
2 1
(i) 𝑃0 = 1 − 𝜌 = 1 − =
3 3
𝜆 𝑛 𝜆 3 2 31
(ii) 𝑃𝑛 = 𝑃0 ⇒ 𝑃3 = 𝑃0 = = 0.09876
𝜇 𝜇 3 3