QUEUING THEORY
By
Ms. Erandika Gamage
University of Kelaniya
o What is a Queue?
o Queue is a linear arrangement of items waiting to be served
o Queuing Theory is the Mathematical Study of Waiting Lines/Queues
Ex: • Waiting in line at a bank for a teller
• Waiting for a customer service representative to answer a call
• Waiting for a train/bus to come
• Waiting for a computer to perform a task or respond
• Waiting for an automated car wash to clean a line of cars
By Ms. Erandika Gamage
• People - Bus queue, Cinema queue
• Items - Vehicle queue, Queue of applications
• Events - Queue of telephone calls, Queue of births
o Queues/Waiting Lines are formed when people or items come faster than
they can be served (due to limited resources for providing a service and
resources and demand mismatched)
By Ms. Erandika Gamage
By Ms. Erandika Gamage
o At its core, a queuing situation involves two parts.
o Someone or something that receive the service—People, Items, Events
o Someone or something that provides the service—Server
Ex: • At a bank - the customers are people seeking to deposit or withdraw money,
and the servers are the bank tellers.
• When looking at the queuing situation of a printer, the customers are the
requests that have been sent to the printer, and the server is the printer.
By Ms. Erandika Gamage
o Those that receive service would like to know
§ How long the queue will be ?
§ How long will I have to wait in the queue ?
o Those who provides service would like to know
§ How many hours the server idle ?
§ Should we have two servers ?
By Ms. Erandika Gamage
§ To find the best level of service that a firm should provide
Ex: • Supermarket
Should decide how many cash register checkout position should be opened
• Petrol station
How many pumps should be opened and how many attendants should be on
duty
• Bank
Should decide how many teller windows to keep open to serve customers
during various hours of the day
By Ms. Erandika Gamage
Population Arrival Units in Queue/Waiting Line
Unit currently
being served
Server
Departure
Units in Queuing System
By Ms. Erandika Gamage
System Customers Servers
Reception Desk People Receptionist
Hospital Patients Nurses
Airport Airplanes Runway
Road network Cars Traffic light
Grocery Shoppers Checkout
Station Computer Jobs CPU, disk, CD
By Ms. Erandika Gamage
o Telecommunications
o Traffic Control
o Determining the sequence of computer operations
o Predicting computer performance
o Healthcare (hospital bed assignments)
o Airport traffic, airline ticket sales
o Layout of manufacturing system
By Ms. Erandika Gamage
1) Pattern of arrivals
2) Pattern of service provision
3) Number of servers
4) Queue discipline
5) Size of waiting room
6) Size of population
By Ms. Erandika Gamage
Population Arrival Units in Queue/Waiting Line
Unit currently
being served
Departure
Units in Queuing System
Server
o Arrival Characteristics
• Pattern of arrival
• Size of population
o Waiting Line Characteristics
• Size of waiting room
• Queue discipline
o Service Characteristics
• Pattern of service provision
• Number of servers
By Ms. Erandika Gamage
There are different pattern of arrivals
I. Poisson Distribution
II. Uniform Distribution
III. Earlang Distribution
By Ms. Erandika Gamage
I. Poisson Distribution
Arrivals are considered random when they are independent of one another and
their occurrence can’t be predicted exactly
Probability of “x” occurrences/arrivals within a given unit of time or space “t” is
given by
e!"# λt $
x!
𝜆 – Average rate of arrivals
Ex: 20 customers per hour
10 lorries per day
5 items per minute
By Ms. Erandika Gamage
Ex:
The average number of telephone calls received per hour is 2.What is the
probability of receiving 3 telephone calls within the next hour?
𝜆 = 2 per hour x = 3 t = 1 hour
=
!!"# "# $
$!
=
!!% & &
'!
By Ms. Erandika Gamage
There are different pattern of service provision
I. Poisson Distribution
II. Uniform Distribution
III. Earlang Distribution
By Ms. Erandika Gamage
I. Poisson Distribution
In many cases it can be assumed that random service times are described by the
negative exponential distribution ( µe!%#)
Probability of “x” service completions within a given unit of time or space “t” is
given by
e!%# µt $
x!
µ – Average rate of service provision
Ex: 12 customers served per hour
10 vehicles serviced per day
5 items assembled per minute
By Ms. Erandika Gamage
o In a queuing system, the pattern of service completion can be expressed in 2 ways
I. Service rate (average rate of service provision)
Ex: 2 vehicles serviced per hour
II. Service time ( time taken to serve one unit)
Ex: average time taken to service a vehicle is 30 min.
The unit of measurement for pattern of arrival and pattern of service completion
should be equal.
Ex: A TV repairman finds that the average time spent on his jobs is 30 min per TV set and
is negative exponential.TV sets arrive in a Poisson fashion at the rate of 10 per eight hour
day.
Average rate of arrival = 10 per eight hour day
Average rate of service completion = 30 min per TV set
= ½ hours per TV set * 2 *8
= 16 per eight hour day
By Ms. Erandika Gamage
o Single Server Queue
• Single Server Sigle Queue
• Single Server Multiple Queues
o Multi Server Queue
• Multi Server Single Queue
• Multi Server Multiple Queues
Server Server 2
Server 3
Server 1
Server 2
Server 3
Server 1
Server
By Ms. Erandika Gamage
o Single Server Queue
• Single Server Sigle Queue
Ex:
§ Single Server Multiple Queues
Ex:
o Multi Server Queue
• Multi Server Single Queue
Ex:
§ Multi Server Multiple Queues
Ex:
• Students arriving at a library counter
• Family doctor’s office
• Different cash counters in an electricity
office
• Different boarding pass encounters at an
airport
• Booking at a service station
By Ms. Erandika Gamage
o Single Server Queue
§ Single Server Sigle Queue
o Multi Server Queue
§ Multi Server Single Queue
Server Server 2
Server 3
Server 1
By Ms. Erandika Gamage
o This is the rule in which units in the queue are being selected for service
I. First Come First Served (FCFS) / First in First Out (FIFO)
Ex: Payment counter at shops
II. Last Come First Served (LCFS)/ Last in First Out (LIFO)
Ex: Elevator
III. Service in Random Order (SIRO)
Ex: Drawing tickets out of a pool of tickets for service
IV. Priority Service
Ex: Hospital Emergency Room (patients who are critically injured will move ahead in
treatment)
By Ms. Erandika Gamage
o This is the rule in which units in the queue are being selected for service
I. First Come First Served (FCFS) / First in First Out (FIFO)
Ex: Payment counter at shops
II. Last Come First Served (LCFS)/ Last in First Out (LIFO)
Ex: Elevator
III. Service in Random Order (SIRO)
Ex: Drawing tickets out of a pool of a pool of tickets for service
IV. Priority Service
Ex: Hospital Emergency Room (patients who are critically injured will move ahead in
treatment)
By Ms. Erandika Gamage
o Maximum allowable size/number of units in the queue
I. Size of waiting room is infinity
Ex:Tollbooth serving arriving vehicles
II. Limited size of waiting room
Ex: A small restaurant has 10 tables and can serve no more than 50 customers
Server
Waiting Room
Server
Waiting Room
By Ms. Erandika Gamage
o This is the size of population eligible to receive the service. (Total number of
eligible units outside the queuing system)
I. Infinite Population
Ex: all people of a city or state (and others) could be the potential customers at a
milk parlor.
II. Finite Population
Ex: Customers at University Base Canteen
• In this event the rate of arrival is considered to be proportional to the size of
population
By Ms. Erandika Gamage
§ Standard system of notation used to describe and classify the queueing
model that a queueing system corresponds to.
§ The notation was first suggested by D. G. Kendall in 1953
Pattern
of
Arrivals
Pattern of
Service
Provision
Number
of
Servers
Queue
Discipline
Size of
Waiting
Room
Size of
Population
By Ms. Erandika Gamage
§ Ex:Think of an ATM
It can serve: one customer at a time; in a first-in-first-out order; with a randomly-
distributed arrival process and service distribution time; unlimited queue capacity;
and unlimited number of possible customers.
(M / M / 1) : ( FIFO / ∞ / ∞ )
M –Markovian, Poisson process (Poisson distribution for arrival and Negative
Exponential distribution for service provision
By Ms. Erandika Gamage
1. (M / M / 1) : ( FIFO / ∞ / ∞ )
2. (M / M / 1) : ( FIFO / L / ∞ )
3. (M / M / S) : ( FIFO / ∞ / ∞ )
4. (M / M / S) : ( FIFO / L / ∞ )
5. (M / M / 1) : ( FIFO / ∞ / N )
6. (M / M / S) : ( FIFO / ∞ / N )
7. Queuing Networks
By Ms. Erandika Gamage
The system starts with empty and idle condition in the beginning (a supermarket just
open early in morning and no customers yet)
Then it gradually go in to one or more peak time where the number of customers in
the system reach the highest level and gradually reduces.
At the end of the service hour (in night before closing the supermarket) either the
arrival of the customers are cutoff or there is really no more customers.
The assumption of steady state in the queuing theory doesn’t represent the reality
But in queuing theory we assume that a queue will acquire steady state
condition(system doesn’t change anymore) after few time, which means queue has
reached equilibrium.
Queue has reached equilibrium means the probability that the system is in a given
state is not time dependent
By Ms. Erandika Gamage
By Ms. Erandika Gamage
Server
Waiting Room
Rate of arrival ( 𝜆 )
Rate of service
provision (µ)
Average time spent by unit in queuing system ( Ws )
Avg number of units in queuing system ( Ls )
Avg number of units in queue ( Lq )
Average time spent by unit in queue ( Wq )
By Ms. Erandika Gamage
Probability of “n” units in queuing system
P(n) = 𝜃 P(n - 1)
P(n) = 𝜃)P(0)
P(n) = 𝜃!
1 − 𝜃
By Ms. Erandika Gamage
P(n) = θn (1 – θ)
P (n) is a measure of probability and cannot be negative
P (n) = θn (1 – θ) cannot be negative
(1- θ) > 0 (since if θ >1 then θn (1 – θ) will be negative)
θ < 1
λ / μ < 1
λ < μ
Condition for equilibrium is that, λ < μ
(1)
(*)
By Ms. Erandika Gamage
Probability that the queuing system is empty
P(n) = θn (1 – θ)
If queuing system is empty then n = 0
Hence,
P(0) = θ0 (1 – θ)
P(0) = (1 – θ)
Probability that the queuing system is empty = (1 – θ)
(1)
(4)
By Ms. Erandika Gamage
Probability that the server is idle
Server will idle only if the queuing system is empty.
Hence,
Probability that the server is idle = (1 – θ)
Number of hours server idle per day
Suppose a working day has H hours,
Number of hours server idle per day = H (1 – θ)
(5)
(6)
By Ms. Erandika Gamage
Average number of units in queuing system ( Ls )
Ls = θ / (1 – θ)
Average number of units in queue ( Lq )
Lq = θ2 / (1 – θ)
By Ms. Erandika Gamage
§ First proven by mathematician John Little in 1961
§ Long-term average number of units (L) in a queuing system is equal to the long-term
average rate of arrival (λ) multiplied by the average time that a unit spends in the
system (W)
L = λW
Note:
§ Little’s law assumes that the system is in “equilibrium”
§ Valid for any queuing model
By Ms. Erandika Gamage
Average time spent by unit in queuing system (Ws )
According to Little’s Law,
L = λW
Hence,
Ls = λ Ws
Average time spent by unit in queue (Wq )
According to Little’s Law,
L = λW
Hence,
Lq = λ Wq
(9)
(10)
By Ms. Erandika Gamage
§ Average time spent by unit in queuing system ( Ws )
Ls = λ Ws
§ Average time spent by unit in queue ( Wq )
Lq = λ Wq
Variables :
λ = Rate of arrival of units
μ = Rate of service provision
θ = λ / μ
H = Number of working hours per day
By Ms. Erandika Gamage
Ex:
A TV repairman finds that the average time spent on his jobs is 30 min per TV set and
is negative exponential.TV sets arrive in a Poisson fashion at the rate of 10 per eight
hour day.
a) What is the repairman idle time each day?
b) How many jobs are ahead of the set just taken for repairs?
c) How long on the average must a TV set be kept with the repairman?
By Ms. Erandika Gamage
Ex: Answers
a) Rate of arrival of TV sets = 10 (per eight hour day)
Average time take to repair one set = 30 min = 1 / 2 hours
Number of sets repaired per day = 8 / (1/2) = 16 (per eight hour day)
Rate of service provision = 16 (per eight hour day)
λ= 10 μ= 16 θ= λ / μ = 10/16 = 5/8
Number of working hours per day = H = 8
Repairman idle time per day = H (1-θ)
= 8 (1-5 / 8)
= 3 hrs
b) Number of sets ahead of the set just taken for repair (LQ)
LQ = θ2/ (1-θ) = (5/8)2/ (1-5/8) = 1 ½4
By Ms. Erandika Gamage
Ex: Answers
c) How long must a TV set be kept with the repairman relates to WS,
LS = λ WS
WS = LS /λ
But LS = θ / (1-θ) = (5/8) / [1- (5/8)] = 5 /3
WS = ( 5 /3 ) * ( 1 /10 ) = 1 /6 (eight hour day)
= 1/6 * 8 = 1 1/3 hrs
By Ms. Erandika Gamage
Server
Waiting Room
Rate of arrival ( 𝜆 )
Rate of service
provision (µ)
Average time spent by unit in queuing system ( Ws )
Avg number of units in queuing system ( Ls )
Avg number of units in queue ( Lq )
Average time spent by unit in queue ( Wq )
By Ms. Erandika Gamage
Probability of “n” units in queuing system
If n <= L ,
P(n) = 𝜃 P(n - 1)
P(n) = 𝜃&P(0)
Probability that queuing system is empty
P (0) = (1-θ)/ (1- θL+1)
If n > L ,
P(n) = 0
By Ms. Erandika Gamage
Probability that the server is idle
Server will idle only if the queuing system is empty.
Hence,
Probability that the server is idle = (1-θ)/ (1- θL+1)
Number of hours server idle per day
Suppose a working day has H hours,
Number of hours server idle per day = H (1-θ)/ (1- θL+1)
By Ms. Erandika Gamage
Average number of units in queuing system ( Ls )
LS =
θ
(1− θL+1) {
'
'!(
- [LθL +
θL
'!(
] }
Average number of units in queue ( Lq )
Lq = LS - [1- P(0)]
By Ms. Erandika Gamage
Average time spent by unit in queuing system (Ws )
Ls = λ Ws
Average time spent by unit in queue (Wq )
Lq = λ Wq
Variables :
λ = Rate of arrival of units
μ = Rate of service provision
θ = λ / μ
L = Size of waiting room
H = Number of working hours per day
By Ms. Erandika Gamage
Ex:
At a barber shop customers arrive in a Poisson fashion at the rate of 14 per hour. There is
only one barber who takes 4mins per hair cut. There are five chairs for waiting customers.
When a customer arrives if he finds that all the waiting chairs are occupied he proceeds
to another barber shop.
a) What is the probability that the barber is idle?
b) What is the probability that there are three customers at the barber shop?
c) What is the probability that a customer that arrives turns back and proceeds to
another barber shop?
d) How many customers on the average will he lose on a eight hour working day on
account of having only five chairs.
e) If the cost of a hair cut is Rs.50 then on the average how much more would he earn
per day if he has five more chairs.
By Ms. Erandika Gamage
Ex: Answers
Rate of arrival of customers (λ) = 14 per hour
Time taken for one hair cut = 4 mins
Number of haircuts completed in one hour = 60 / 4 = 15
Rate of service provision (μ) =15 per hour
Size of waiting room (L)= (5+1) = 6
θ = λ / μ =14 /15
(a) Probability that barber is idle = (1-θ) / (1- θL+1)
= (1-14/15) / [1- (14/15)7]
= (0.06669)/ (0.38304)
=0.174
By Ms. Erandika Gamage
Ex: Answers
(b) P (n) = θn (1-θ) / (1- θL+1)
If there are three customers then n=3
P (3) = θ3 (1-θ) / (1-θ7)
= (14/15)3 * (1-(14/15) / [1-(14/15)7]
= (14/15)3 * 0.174
=0.14146
By Ms. Erandika Gamage
Ex: Answers
(c) A customer arrive will leave and proceed to another barber shop only if the barber shop
is full.That is only if there are six customers in the shop.
So probability that a customer who arrives will leave for another barber shop is P (6)
P (6) = θ6 (1- θ) / (1- θL+1)
= (14/15)6 * [1-(14/15)] / [1-(14/15)7]
= (14/15)6 * 0.174
= 0.115
(d) Rate of arrival of customers = λ = 14 per hour
Number of customers that arrive on an 8 hour working day = 8*14 = 112
Probability of losing a customer = 0.115
Therefore number of customers lost per day = 112*0.115 = 12.88
By Ms. Erandika Gamage
Ex: Answers
(e) If there are five more chairs then all together there will be 10 waiting chairs and it will be a
limited waiting room size queue with size of waiting room as 11.
A customer will leave for another barber shop if the number of customers at the shop is 11.
Prob. that a customer arriving will leave for another shop = θ11 (1- θ) / (1- θL+1)
= θ11 (1- θ) / (1- θ12)
= (14/15)11 * [1-(14/15)] / [1-(14/15)12]
= 0.4681705 * (0.0666666) / (0.5630409)
= 0.0554334
Number of customers lost per day when (L =11) = 0.0554334 * 112
= 6.21
Number of customers lost per day when (L =6) = 112*0.115
= 12.88
Number of customers saved per day = 12.88 – 6.21 = 6.67
The increasing profit = Rs.6.67*50 = Rs. 333.00
By Ms. Erandika Gamage
µ Server 2
Waiting Room
Rate of arrival ( 𝜆 )
Average time spent by unit in queuing system ( Ws )
Avg number of units in queuing system ( Ls )
Avg number of units in queue ( Lq )
Average time spent by unit in queue ( Wq )
µ
µ
Rate of service
provision (3µ)
Server 1
Server 3
By Ms. Erandika Gamage
Case I : n <= S
§ Rate of arrival = λ
§ Rate of service completion = n μ
Case II : n > S
§ Rate of arrival = λ
§ Rate of service completion = S μ
Condition for Equlibrium
Condition for equilibrium, λ ≤ Sμ
Variables :
n = Number of units in the queuing system
S = Number of servers
By Ms. Erandika Gamage
§ Probability of “n” units in queuing system
Case I : n <= S
P (n) = (θn / n!) P (0)
P (S) = (θS / S!) P (0)
§ Evaluate P(0)
1 / P (0) = [ ∑&)*
+!'
(θn/n!) + (θS /S!) { 1 / (1-( θ /S)) } ]
§ Probability that queuing system is empty
P (0) = 1/ [ ∑&)*
+!'
(θn /n!) + (θS /S!) { 1 / (1-( θ /S)) } ]
Case II : n > S
P (n) = (SS / S!) * (θ / S)n * P(0)
By Ms. Erandika Gamage
§ Probability that all the servers are idle
P(0) = 1/ [ ∑&)*
+!'
(θn /n!) + (θS /S!) { 1 / (1-( θ /S)) } ]
§ Probability that “r” servers are idle
P (S-r)
§ Number of hours that servers idle per day
.∑,)*
+
Hr P (S−r)
By Ms. Erandika Gamage
§ Average number of units in queuing system ( Ls )
Ls = P(0) ∑&)'
+!' θn
&!' !
+
SS
S!
θ
S
.
S
' !
θ
S
+
θ
S
1
' !
θ
S
!
§ Average number of units in queue ( Lq )
Lq =
SS
S!
θ
S
/0'
1
' !
θ
S
1
P(0)
By Ms. Erandika Gamage
§ Average time spent by unit in queuing system ( Ws )
Ls = λ Ws
§ Average time spent by unit in queue ( Wq )
Lq = λ Wq
Variables :
λ = Rate of arrival of units
nμ = Rate of service provision (if n <= S)
Sμ = Rate of service provision (if n > S)
n = Number of units in the queuing system
S = Number of servers
r = Number of servers idle
H = Number of working hours per day
By Ms. Erandika Gamage
Ex:
At a photocopy shop there is only one photocopy machine and customers arrive in a
Poisson fashion at the rate of 14 per hour. The average service time (which is negative
exponential) is 4 minutes.The shop works eight hours a day.
a) How long on the average will a customer have to wait at the photocopying shop?
b) By how much will this waiting time be reduced if they had two photocopying
machines?
Suppose the rate of arrival of customers has suddenly increased to 50 per hour due to the
opening of new university close by,
c) How long on the average will a customer have to wait at the photocopying shop.
d) Number of hours server idle per day.
By Ms. Erandika Gamage
Ex: Answers
(a) Rate of arrival of customers (λ) = 14 per hour
Time taken to serve one customer = 4 min
Number of customers served in one hour = 60 / 4 = 15
Rate of service completion (μ) = 15 per hour
θ = λ / μ = 14 /15
LS = θ / (1- θ) = (14 / 15) / ( 1 – (14 /15)) = 14
LS = WS λ
WS = 14 /14
Waiting time (WS) =1 hour
By Ms. Erandika Gamage
Ex: Answers
(b) Number of servers (S)=2
Evaluate P (0)
1 / P (0) = [ ∑&)*
+!'
(θn/n!) + (θS /S!) { 1 / (1-( θ /S)) } ]
1 / P (0) = [∑&)*
&)'
(14 / 15) n /n!)+ (14 / 15)2 /2!) {1 / (1-(14 /30))}]
1 / P (0) = (14 / 15) 0 /0!) + (14 / 15) 1 /1!) + (14 / 15)2 / 2! * 30 / 16
1 / P (0) = 1 + (14 / 15) + (14 / 15)2 *(½) * (15 * 2) / 16
1 / P (0) = 1 + (14 / 15) + 142 / (15 * 16) = 2.75
1 / P (0) = 2.75
P (0) = 0.363636
Continued...
By Ms. Erandika Gamage
Ex: Answers
(b) Ls = P(0) ∑&)'
+!' θn
&!' !
+
SS
S!
θ
S
.
S
' !
θ
S
+
θ
S
1
' !
θ
S
!
We have S = 2 , θ = 14 / 15 , (θ / S) = 14 / 30 , P (0) = 0.363636
Ls = 0.363636 ∑&)'
&)' (14 /15) n
&!' !
+
22
2!
14/15
2
1
2
' !
14/15
2
+
14/15
2
1
' !
14/15
2
!
LS = 0.363636 [(14 /15) 1 / 0! + 4 / 2 (14 / 30)2 {(60 / 16) + (14 / 30)(30 / 16)2}]
LS = = 1.1931805
Continued...
By Ms. Erandika Gamage
Ex: Answers
(b) WS = LS / λ
WS = 1.1931805 / 14
WS = 0.0852271 hour
WS = 5.1136 min
Waiting time when there is 1 server (WS) =1 hour
Waiting time when there are 2 servers (WS) = 5.1136 min
Waiting time is reduced by (60-5.11) = 54.89 min
By Ms. Erandika Gamage
Ex: Answers
(c) Rate of arrival of customers (λ) = 50 per hour
Service time per customer = 4 min
Number of service completions per hour = 60 / 4 = 15
Rate of service completion (μ) = 15
λ > μ
Condition for equilibrium for single server queue is λ ≤ μ
System has not met the equilibrium
Condition for equilibrium for multi server queue is λ ≤ Sμ
S ≥ λ / μ
S ≥ 50 / 15
S ≥ 3.33 (number of servers required for equilibrium)
At least 4 photocopying machines required to provide service
Continued...
By Ms. Erandika Gamage
Ex: Answers
(c) Rate of arrival of customers (λ) = 50 per hour
Service time per customer = 4 min
Number of service completions per hour = 60 / 4 = 15
Rate of service completion (μ) = 15
λ > μ
Condition for equilibrium for single server queue is λ ≤ μ
System has not met the equilibrium
Condition for equilibrium for multi server queue is λ ≤ Sμ
S ≥ λ / μ
S ≥ 50 / 15
S ≥ 3.33 (number of servers required for equilibrium)
At least 4 photocopying machines required to provide service
Continued...
By Ms. Erandika Gamage
µ Server 2
Waiting Room
Rate of arrival ( 𝜆 )
Average time spent by unit in queuing system ( Ws )
Avg number of units in queuing system ( Ls )
Avg number of units in queue ( Lq )
Average time spent by unit in queue ( Wq )
µ
µ
Rate of service
provision (3µ)
Server 1
Server 3
By Ms. Erandika Gamage
Case I : n <= S
§ Rate of arrival = λ
§ Rate of service completion = n μ
Case II : n > S
§ Rate of arrival = λ
§ Rate of service completion = S μ
Variables :
n = Number of units in the queuing system
S = Number of servers
By Ms. Erandika Gamage
§ Probability of “n” units in queuing system
Case I : n <= S
P (n) = (θn / n!) P (0)
P (S) = (θS / S!) P (0)
Case III : n > L
P(n) = 0
§ Evaluate P(0)
1 / P (0) = ∑2)*
/!'
(θn/n!) + (θS /S!)
(θ / S)S − (θ / S)L+1
1 − θ / S
Case II : S < n <= L
P (n) = (SS / S!) * (θ / S)n * P(0)
By Ms. Erandika Gamage
§ Probability that queuing system is empty
P (0) = 1/ ∑2)*
/!'
(θn/n!) + (θS /S!)
(θ / S)S − (θ / S)L+1
1 − θ / S
§ Probability that all the servers are idle
P (0) = 1/ ∑2)*
/!'
(θn/n!) + (θS /S!)
(θ / S)S − (θ / S)L+1
1 − θ / S
§ Probability that “r” servers are idle
P (S-r) =
§ Number of hours that servers idle per day
.∑,)*
+
Hr P (S−r)
By Ms. Erandika Gamage
§ Average number of units in queuing system ( Ls )
Ls = P(0) ∑&)'
+!' θn
&!' !
+
SS
S!
θ
S
.
S
' !
θ
S
+
θ
S
1
' !
θ
S
!
§ Average number of units in queue ( Lq )
Lq =
By Ms. Erandika Gamage
§ Average time spent by unit in queuing system ( Ws )
Ls = λ Ws
§ Average time spent by unit in queue ( Wq )
Lq = λ Wq
Variables :
λ = Rate of arrival of units
nμ = Rate of service provision (if n <= S)
Sμ = Rate of service provision (if n > S)
n = Number of units in the queuing system
L = Size of waiting room
S = Number of servers
r = Number of servers idle
H = Number of working hours per day
By Ms. Erandika Gamage
Server
Waiting Room
Rate of
arrival
(N-n)𝜆
Rate of service
provision (µ)
Average time spent by unit in queuing system ( Ws )
Avg number of units in queuing system ( Ls )
Avg number of units in queue ( Lq )
Average time spent by unit in queue ( Wq )
Population Size (N)
By Ms. Erandika Gamage
Initial State State n
By Ms. Erandika Gamage
§ Probability of “n” units in queuing system
P(n) =
N!
(N−n)!
θn P(0)
§ Evaluate P(0)
1 / P (0) =∑&)*
3 N!
(N−n)!
θn
**Computer software is used to evaluate ∑!"#
$ $!
$ &! !
θn
§ Probability that queuing system is empty
P (0) = 1/∑&)*
3 3!
3 !& !
θn
By Ms. Erandika Gamage
§ Probability that the server is idle
P (0) = 1/∑&)*
3 N!
(N−n)!
θn
§ Number of hours that servers idle per day
H P(0)
H * 1/ ∑&)*
3 N!
(N−n)!
θn
By Ms. Erandika Gamage
§ Average number of units in queuing system ( Ls )
Ls = ∑&)*
3 nN!
(N−n)!
θn P(0)
§ Average number of units in queue ( Lq )
Lq =∑&)'
3 (n−1)N!
(N−n)!
θn P(0)
By Ms. Erandika Gamage
§ Average time spent by unit in queuing system ( Ws )
Ls = λ Ws
§ Average time spent by unit in queue ( Wq )
Lq = λ Wq
Variables :
λ = Rate of arrival of units
μ = Rate of service provision
θ = λ / μ
N = Size of the population
n = Number of units in the queuing system
H = Number of working hours per day
By Ms. Erandika Gamage
µ Server 2
Waiting Room
Average time spent by unit in queuing system ( Ws )
Avg number of units in queuing system ( Ls )
Avg number of units in queue ( Lq )
Average time spent by unit in queue ( Wq )
µ
µ
Rate of service
provision (3µ)
Server 1
Server 3
Rate of
arrival
(N-n)𝜆
Population Size (N)
By Ms. Erandika Gamage
Initial State State n
By Ms. Erandika Gamage
Case I : n <= S
§ Rate of arrival = (N-n)λ
§ Rate of service completion = n μ
Case II : n > S
§ Rate of arrival = (N-n)λ
§ Rate of service completion = S μ
Variables :
N = Size of the population
n = Number of units in the queuing system
S = Number of servers
By Ms. Erandika Gamage
§ Probability of “n” units in queuing system
Case I : n <= S
P (n) =
N!
(N−n)!n!
θn P(0)
P (S) =
N!
(N−S)!S!
θS P(0)
§ Evaluate P(0)
1 = ∑&)*
+!' N!
(N−n)!n!
θn P(0) + ∑&)+
3 N!
(N−n)!
(SS / S!) (θ / S)n P(0)
§ Probability that queuing system is empty
P (0) = 1/ [∑&)*
+!' N!
(N−n)!n!
θn P(0) + ∑&)+
3 N!
(N−n)!
(SS/ S!) (θ / S)n P(0) ]
Case II : n > S
P (n) =
N!
(N−n)!
(SS / S!)(θ / S)n P(0)
By Ms. Erandika Gamage
§ Probability that all the servers are idle
P (0) = 1/ [∑&)*
+!' N!
(N−n)!n!
θn P(0) + ∑&)+
3 N!
(N−n)!
(SS/ S!) (θ / S)n P(0) ]
§ Probability that “r” servers are idle
P (S-r) =
§ Number of hours that servers idle per day
.∑,)*
+
Hr P (S−r)
By Ms. Erandika Gamage
§ Average number of units in queuing system ( Ls )
Ls = ∑&)*
3
nP(0)
§ Average number of units in queue ( Lq )
Lq =∑&)'
3
(n−1)P(n)
By Ms. Erandika Gamage
§ Average time spent by unit in queuing system ( Ws )
Ls = λ Ws
§ Average time spent by unit in queue ( Wq )
Lq = λ Wq
Variables :
(N-n)λ = Rate of arrival of units
nμ = Rate of service provision (if n <= S)
Sμ = Rate of service provision (if n > S)
n = Number of units in the queuing system
N = Size of the population
S = Number of servers
r = Number of servers idle
H = Number of working hours per day
By Ms. Erandika Gamage
§ A queuing system where the output of one queue is the input to another is called a
queuing network.
There are 3 types of queuing networks
I. Queues in Series
II. Cyclic Queues
By Ms. Erandika Gamage
I. Queues in Series
II. Cyclic Queues
Arrival Departure
2 3
By Ms. Erandika Gamage
I. Queues in Series
§ Now consider as a M/M/S model
§ Condition for equilibrium, λ ≤ Sμ
2 3
𝜆
µ1 µ2 µ3
Departure
Arrival
µ1
𝜆
By Ms. Erandika Gamage
II. Cyclic Queues
A cyclic queue has a fixed number of units rotating in a cycle and in the process receiving
service from each station
In solving the problem,
1. Consider the entire network as one system and list down all possible states
2. Write down the balance equation for each state
3. Write down the equation that describes the sum of the probabilities of all the states is
one
4. Solve the equations
By Ms. Erandika Gamage
II. Cyclic Queues
Ex 1.
Possible Situations (Waiting to receive service) State Probability
Station 1 Station 2
0 3 S0 P0
1 2 S1 P1
2 1 S2 P2
3 0 S3 P3
By Ms. Erandika Gamage
II. Cyclic Queues
Ex 1.
State Balance Equation
S0 μ2P(0) = μ1P(1)
S1 (μ1+ μ2)P1 = μ2P0+ μ1P2
S2 (μ1+ μ2)P2 = μ1P3+ μ2P1
S3 μ1P3 = μ2P2
P0+ P1 + P2 + P3 = 1 [Sum of probabilities = 1]
We can solve the above equations and find P0,P1,P2 and P3 . once we find these measures
we can find expected number of units waiting to receive service from station 1 as,
(0 × P0+1× P1 +2 ×P2 +3× P3)
By Ms. Erandika Gamage
II. Cyclic Queues
Ex 2.
By Ms. Erandika Gamage
II. Cyclic Queues
Ex 2.
Possible Situations (Waiting to receive service) State Probability
Station 1 Station 2 Station 3
3 0 0 S0 P0
2 1 0 S1 P1
2 0 1 S2 P2
1 2 0 S3 P3
1 1 1 S4 P4
1 0 2 S5 P5
0 3 0 S6 P6
0 2 1 S7 P7
0 1 2 S8 P8
0 0 3 S9 P9
By Ms. Erandika Gamage
§ Determine an acceptable waiting time for customers
§ Try to divert customer’s attention when waiting
§ Inform customers of what to expect
§ Keep employees not serving the customers out of sight
§ Segment customers
§ Train the servers to be friendly
§ Encourage customers to come during the slack periods
By Ms. Erandika Gamage
In a life time, the average person will spend ,
§ SIX MONTHS Waiting at stoplights
§ EIGHT MONTHS Opening junk mail
§ ONE YEAR Looking for misplaced 0bjects
§ TWOYEARS Reading E-mail
§ FOUR YEARS Doing housework
§ FIVE YEARS Waiting in line
§ SIX YEARS Eating
By Ms. Erandika Gamage

Queuing Theory.pdf

  • 1.
    QUEUING THEORY By Ms. ErandikaGamage University of Kelaniya
  • 2.
    o What isa Queue? o Queue is a linear arrangement of items waiting to be served o Queuing Theory is the Mathematical Study of Waiting Lines/Queues Ex: • Waiting in line at a bank for a teller • Waiting for a customer service representative to answer a call • Waiting for a train/bus to come • Waiting for a computer to perform a task or respond • Waiting for an automated car wash to clean a line of cars By Ms. Erandika Gamage
  • 3.
    • People -Bus queue, Cinema queue • Items - Vehicle queue, Queue of applications • Events - Queue of telephone calls, Queue of births o Queues/Waiting Lines are formed when people or items come faster than they can be served (due to limited resources for providing a service and resources and demand mismatched) By Ms. Erandika Gamage
  • 4.
  • 5.
    o At itscore, a queuing situation involves two parts. o Someone or something that receive the service—People, Items, Events o Someone or something that provides the service—Server Ex: • At a bank - the customers are people seeking to deposit or withdraw money, and the servers are the bank tellers. • When looking at the queuing situation of a printer, the customers are the requests that have been sent to the printer, and the server is the printer. By Ms. Erandika Gamage
  • 6.
    o Those thatreceive service would like to know § How long the queue will be ? § How long will I have to wait in the queue ? o Those who provides service would like to know § How many hours the server idle ? § Should we have two servers ? By Ms. Erandika Gamage
  • 7.
    § To findthe best level of service that a firm should provide Ex: • Supermarket Should decide how many cash register checkout position should be opened • Petrol station How many pumps should be opened and how many attendants should be on duty • Bank Should decide how many teller windows to keep open to serve customers during various hours of the day By Ms. Erandika Gamage
  • 8.
    Population Arrival Unitsin Queue/Waiting Line Unit currently being served Server Departure Units in Queuing System By Ms. Erandika Gamage
  • 9.
    System Customers Servers ReceptionDesk People Receptionist Hospital Patients Nurses Airport Airplanes Runway Road network Cars Traffic light Grocery Shoppers Checkout Station Computer Jobs CPU, disk, CD By Ms. Erandika Gamage
  • 10.
    o Telecommunications o TrafficControl o Determining the sequence of computer operations o Predicting computer performance o Healthcare (hospital bed assignments) o Airport traffic, airline ticket sales o Layout of manufacturing system By Ms. Erandika Gamage
  • 11.
    1) Pattern ofarrivals 2) Pattern of service provision 3) Number of servers 4) Queue discipline 5) Size of waiting room 6) Size of population By Ms. Erandika Gamage
  • 12.
    Population Arrival Unitsin Queue/Waiting Line Unit currently being served Departure Units in Queuing System Server o Arrival Characteristics • Pattern of arrival • Size of population o Waiting Line Characteristics • Size of waiting room • Queue discipline o Service Characteristics • Pattern of service provision • Number of servers By Ms. Erandika Gamage
  • 13.
    There are differentpattern of arrivals I. Poisson Distribution II. Uniform Distribution III. Earlang Distribution By Ms. Erandika Gamage
  • 14.
    I. Poisson Distribution Arrivalsare considered random when they are independent of one another and their occurrence can’t be predicted exactly Probability of “x” occurrences/arrivals within a given unit of time or space “t” is given by e!"# λt $ x! 𝜆 – Average rate of arrivals Ex: 20 customers per hour 10 lorries per day 5 items per minute By Ms. Erandika Gamage
  • 15.
    Ex: The average numberof telephone calls received per hour is 2.What is the probability of receiving 3 telephone calls within the next hour? 𝜆 = 2 per hour x = 3 t = 1 hour = !!"# "# $ $! = !!% & & '! By Ms. Erandika Gamage
  • 16.
    There are differentpattern of service provision I. Poisson Distribution II. Uniform Distribution III. Earlang Distribution By Ms. Erandika Gamage
  • 17.
    I. Poisson Distribution Inmany cases it can be assumed that random service times are described by the negative exponential distribution ( µe!%#) Probability of “x” service completions within a given unit of time or space “t” is given by e!%# µt $ x! µ – Average rate of service provision Ex: 12 customers served per hour 10 vehicles serviced per day 5 items assembled per minute By Ms. Erandika Gamage
  • 18.
    o In aqueuing system, the pattern of service completion can be expressed in 2 ways I. Service rate (average rate of service provision) Ex: 2 vehicles serviced per hour II. Service time ( time taken to serve one unit) Ex: average time taken to service a vehicle is 30 min. The unit of measurement for pattern of arrival and pattern of service completion should be equal. Ex: A TV repairman finds that the average time spent on his jobs is 30 min per TV set and is negative exponential.TV sets arrive in a Poisson fashion at the rate of 10 per eight hour day. Average rate of arrival = 10 per eight hour day Average rate of service completion = 30 min per TV set = ½ hours per TV set * 2 *8 = 16 per eight hour day By Ms. Erandika Gamage
  • 19.
    o Single ServerQueue • Single Server Sigle Queue • Single Server Multiple Queues o Multi Server Queue • Multi Server Single Queue • Multi Server Multiple Queues Server Server 2 Server 3 Server 1 Server 2 Server 3 Server 1 Server By Ms. Erandika Gamage
  • 20.
    o Single ServerQueue • Single Server Sigle Queue Ex: § Single Server Multiple Queues Ex: o Multi Server Queue • Multi Server Single Queue Ex: § Multi Server Multiple Queues Ex: • Students arriving at a library counter • Family doctor’s office • Different cash counters in an electricity office • Different boarding pass encounters at an airport • Booking at a service station By Ms. Erandika Gamage
  • 21.
    o Single ServerQueue § Single Server Sigle Queue o Multi Server Queue § Multi Server Single Queue Server Server 2 Server 3 Server 1 By Ms. Erandika Gamage
  • 22.
    o This isthe rule in which units in the queue are being selected for service I. First Come First Served (FCFS) / First in First Out (FIFO) Ex: Payment counter at shops II. Last Come First Served (LCFS)/ Last in First Out (LIFO) Ex: Elevator III. Service in Random Order (SIRO) Ex: Drawing tickets out of a pool of tickets for service IV. Priority Service Ex: Hospital Emergency Room (patients who are critically injured will move ahead in treatment) By Ms. Erandika Gamage
  • 23.
    o This isthe rule in which units in the queue are being selected for service I. First Come First Served (FCFS) / First in First Out (FIFO) Ex: Payment counter at shops II. Last Come First Served (LCFS)/ Last in First Out (LIFO) Ex: Elevator III. Service in Random Order (SIRO) Ex: Drawing tickets out of a pool of a pool of tickets for service IV. Priority Service Ex: Hospital Emergency Room (patients who are critically injured will move ahead in treatment) By Ms. Erandika Gamage
  • 24.
    o Maximum allowablesize/number of units in the queue I. Size of waiting room is infinity Ex:Tollbooth serving arriving vehicles II. Limited size of waiting room Ex: A small restaurant has 10 tables and can serve no more than 50 customers Server Waiting Room Server Waiting Room By Ms. Erandika Gamage
  • 25.
    o This isthe size of population eligible to receive the service. (Total number of eligible units outside the queuing system) I. Infinite Population Ex: all people of a city or state (and others) could be the potential customers at a milk parlor. II. Finite Population Ex: Customers at University Base Canteen • In this event the rate of arrival is considered to be proportional to the size of population By Ms. Erandika Gamage
  • 26.
    § Standard systemof notation used to describe and classify the queueing model that a queueing system corresponds to. § The notation was first suggested by D. G. Kendall in 1953 Pattern of Arrivals Pattern of Service Provision Number of Servers Queue Discipline Size of Waiting Room Size of Population By Ms. Erandika Gamage
  • 27.
    § Ex:Think ofan ATM It can serve: one customer at a time; in a first-in-first-out order; with a randomly- distributed arrival process and service distribution time; unlimited queue capacity; and unlimited number of possible customers. (M / M / 1) : ( FIFO / ∞ / ∞ ) M –Markovian, Poisson process (Poisson distribution for arrival and Negative Exponential distribution for service provision By Ms. Erandika Gamage
  • 28.
    1. (M /M / 1) : ( FIFO / ∞ / ∞ ) 2. (M / M / 1) : ( FIFO / L / ∞ ) 3. (M / M / S) : ( FIFO / ∞ / ∞ ) 4. (M / M / S) : ( FIFO / L / ∞ ) 5. (M / M / 1) : ( FIFO / ∞ / N ) 6. (M / M / S) : ( FIFO / ∞ / N ) 7. Queuing Networks By Ms. Erandika Gamage
  • 29.
    The system startswith empty and idle condition in the beginning (a supermarket just open early in morning and no customers yet) Then it gradually go in to one or more peak time where the number of customers in the system reach the highest level and gradually reduces. At the end of the service hour (in night before closing the supermarket) either the arrival of the customers are cutoff or there is really no more customers. The assumption of steady state in the queuing theory doesn’t represent the reality But in queuing theory we assume that a queue will acquire steady state condition(system doesn’t change anymore) after few time, which means queue has reached equilibrium. Queue has reached equilibrium means the probability that the system is in a given state is not time dependent By Ms. Erandika Gamage
  • 30.
  • 31.
    Server Waiting Room Rate ofarrival ( 𝜆 ) Rate of service provision (µ) Average time spent by unit in queuing system ( Ws ) Avg number of units in queuing system ( Ls ) Avg number of units in queue ( Lq ) Average time spent by unit in queue ( Wq ) By Ms. Erandika Gamage
  • 32.
    Probability of “n”units in queuing system P(n) = 𝜃 P(n - 1) P(n) = 𝜃)P(0) P(n) = 𝜃! 1 − 𝜃 By Ms. Erandika Gamage
  • 33.
    P(n) = θn(1 – θ) P (n) is a measure of probability and cannot be negative P (n) = θn (1 – θ) cannot be negative (1- θ) > 0 (since if θ >1 then θn (1 – θ) will be negative) θ < 1 λ / μ < 1 λ < μ Condition for equilibrium is that, λ < μ (1) (*) By Ms. Erandika Gamage
  • 34.
    Probability that thequeuing system is empty P(n) = θn (1 – θ) If queuing system is empty then n = 0 Hence, P(0) = θ0 (1 – θ) P(0) = (1 – θ) Probability that the queuing system is empty = (1 – θ) (1) (4) By Ms. Erandika Gamage
  • 35.
    Probability that theserver is idle Server will idle only if the queuing system is empty. Hence, Probability that the server is idle = (1 – θ) Number of hours server idle per day Suppose a working day has H hours, Number of hours server idle per day = H (1 – θ) (5) (6) By Ms. Erandika Gamage
  • 36.
    Average number ofunits in queuing system ( Ls ) Ls = θ / (1 – θ) Average number of units in queue ( Lq ) Lq = θ2 / (1 – θ) By Ms. Erandika Gamage
  • 37.
    § First provenby mathematician John Little in 1961 § Long-term average number of units (L) in a queuing system is equal to the long-term average rate of arrival (λ) multiplied by the average time that a unit spends in the system (W) L = λW Note: § Little’s law assumes that the system is in “equilibrium” § Valid for any queuing model By Ms. Erandika Gamage
  • 38.
    Average time spentby unit in queuing system (Ws ) According to Little’s Law, L = λW Hence, Ls = λ Ws Average time spent by unit in queue (Wq ) According to Little’s Law, L = λW Hence, Lq = λ Wq (9) (10) By Ms. Erandika Gamage
  • 39.
    § Average timespent by unit in queuing system ( Ws ) Ls = λ Ws § Average time spent by unit in queue ( Wq ) Lq = λ Wq Variables : λ = Rate of arrival of units μ = Rate of service provision θ = λ / μ H = Number of working hours per day By Ms. Erandika Gamage
  • 40.
    Ex: A TV repairmanfinds that the average time spent on his jobs is 30 min per TV set and is negative exponential.TV sets arrive in a Poisson fashion at the rate of 10 per eight hour day. a) What is the repairman idle time each day? b) How many jobs are ahead of the set just taken for repairs? c) How long on the average must a TV set be kept with the repairman? By Ms. Erandika Gamage
  • 41.
    Ex: Answers a) Rateof arrival of TV sets = 10 (per eight hour day) Average time take to repair one set = 30 min = 1 / 2 hours Number of sets repaired per day = 8 / (1/2) = 16 (per eight hour day) Rate of service provision = 16 (per eight hour day) λ= 10 μ= 16 θ= λ / μ = 10/16 = 5/8 Number of working hours per day = H = 8 Repairman idle time per day = H (1-θ) = 8 (1-5 / 8) = 3 hrs b) Number of sets ahead of the set just taken for repair (LQ) LQ = θ2/ (1-θ) = (5/8)2/ (1-5/8) = 1 ½4 By Ms. Erandika Gamage
  • 42.
    Ex: Answers c) Howlong must a TV set be kept with the repairman relates to WS, LS = λ WS WS = LS /λ But LS = θ / (1-θ) = (5/8) / [1- (5/8)] = 5 /3 WS = ( 5 /3 ) * ( 1 /10 ) = 1 /6 (eight hour day) = 1/6 * 8 = 1 1/3 hrs By Ms. Erandika Gamage
  • 43.
    Server Waiting Room Rate ofarrival ( 𝜆 ) Rate of service provision (µ) Average time spent by unit in queuing system ( Ws ) Avg number of units in queuing system ( Ls ) Avg number of units in queue ( Lq ) Average time spent by unit in queue ( Wq ) By Ms. Erandika Gamage
  • 44.
    Probability of “n”units in queuing system If n <= L , P(n) = 𝜃 P(n - 1) P(n) = 𝜃&P(0) Probability that queuing system is empty P (0) = (1-θ)/ (1- θL+1) If n > L , P(n) = 0 By Ms. Erandika Gamage
  • 45.
    Probability that theserver is idle Server will idle only if the queuing system is empty. Hence, Probability that the server is idle = (1-θ)/ (1- θL+1) Number of hours server idle per day Suppose a working day has H hours, Number of hours server idle per day = H (1-θ)/ (1- θL+1) By Ms. Erandika Gamage
  • 46.
    Average number ofunits in queuing system ( Ls ) LS = θ (1− θL+1) { ' '!( - [LθL + θL '!( ] } Average number of units in queue ( Lq ) Lq = LS - [1- P(0)] By Ms. Erandika Gamage
  • 47.
    Average time spentby unit in queuing system (Ws ) Ls = λ Ws Average time spent by unit in queue (Wq ) Lq = λ Wq Variables : λ = Rate of arrival of units μ = Rate of service provision θ = λ / μ L = Size of waiting room H = Number of working hours per day By Ms. Erandika Gamage
  • 48.
    Ex: At a barbershop customers arrive in a Poisson fashion at the rate of 14 per hour. There is only one barber who takes 4mins per hair cut. There are five chairs for waiting customers. When a customer arrives if he finds that all the waiting chairs are occupied he proceeds to another barber shop. a) What is the probability that the barber is idle? b) What is the probability that there are three customers at the barber shop? c) What is the probability that a customer that arrives turns back and proceeds to another barber shop? d) How many customers on the average will he lose on a eight hour working day on account of having only five chairs. e) If the cost of a hair cut is Rs.50 then on the average how much more would he earn per day if he has five more chairs. By Ms. Erandika Gamage
  • 49.
    Ex: Answers Rate ofarrival of customers (λ) = 14 per hour Time taken for one hair cut = 4 mins Number of haircuts completed in one hour = 60 / 4 = 15 Rate of service provision (μ) =15 per hour Size of waiting room (L)= (5+1) = 6 θ = λ / μ =14 /15 (a) Probability that barber is idle = (1-θ) / (1- θL+1) = (1-14/15) / [1- (14/15)7] = (0.06669)/ (0.38304) =0.174 By Ms. Erandika Gamage
  • 50.
    Ex: Answers (b) P(n) = θn (1-θ) / (1- θL+1) If there are three customers then n=3 P (3) = θ3 (1-θ) / (1-θ7) = (14/15)3 * (1-(14/15) / [1-(14/15)7] = (14/15)3 * 0.174 =0.14146 By Ms. Erandika Gamage
  • 51.
    Ex: Answers (c) Acustomer arrive will leave and proceed to another barber shop only if the barber shop is full.That is only if there are six customers in the shop. So probability that a customer who arrives will leave for another barber shop is P (6) P (6) = θ6 (1- θ) / (1- θL+1) = (14/15)6 * [1-(14/15)] / [1-(14/15)7] = (14/15)6 * 0.174 = 0.115 (d) Rate of arrival of customers = λ = 14 per hour Number of customers that arrive on an 8 hour working day = 8*14 = 112 Probability of losing a customer = 0.115 Therefore number of customers lost per day = 112*0.115 = 12.88 By Ms. Erandika Gamage
  • 52.
    Ex: Answers (e) Ifthere are five more chairs then all together there will be 10 waiting chairs and it will be a limited waiting room size queue with size of waiting room as 11. A customer will leave for another barber shop if the number of customers at the shop is 11. Prob. that a customer arriving will leave for another shop = θ11 (1- θ) / (1- θL+1) = θ11 (1- θ) / (1- θ12) = (14/15)11 * [1-(14/15)] / [1-(14/15)12] = 0.4681705 * (0.0666666) / (0.5630409) = 0.0554334 Number of customers lost per day when (L =11) = 0.0554334 * 112 = 6.21 Number of customers lost per day when (L =6) = 112*0.115 = 12.88 Number of customers saved per day = 12.88 – 6.21 = 6.67 The increasing profit = Rs.6.67*50 = Rs. 333.00 By Ms. Erandika Gamage
  • 53.
    µ Server 2 WaitingRoom Rate of arrival ( 𝜆 ) Average time spent by unit in queuing system ( Ws ) Avg number of units in queuing system ( Ls ) Avg number of units in queue ( Lq ) Average time spent by unit in queue ( Wq ) µ µ Rate of service provision (3µ) Server 1 Server 3 By Ms. Erandika Gamage
  • 54.
    Case I :n <= S § Rate of arrival = λ § Rate of service completion = n μ Case II : n > S § Rate of arrival = λ § Rate of service completion = S μ Condition for Equlibrium Condition for equilibrium, λ ≤ Sμ Variables : n = Number of units in the queuing system S = Number of servers By Ms. Erandika Gamage
  • 55.
    § Probability of“n” units in queuing system Case I : n <= S P (n) = (θn / n!) P (0) P (S) = (θS / S!) P (0) § Evaluate P(0) 1 / P (0) = [ ∑&)* +!' (θn/n!) + (θS /S!) { 1 / (1-( θ /S)) } ] § Probability that queuing system is empty P (0) = 1/ [ ∑&)* +!' (θn /n!) + (θS /S!) { 1 / (1-( θ /S)) } ] Case II : n > S P (n) = (SS / S!) * (θ / S)n * P(0) By Ms. Erandika Gamage
  • 56.
    § Probability thatall the servers are idle P(0) = 1/ [ ∑&)* +!' (θn /n!) + (θS /S!) { 1 / (1-( θ /S)) } ] § Probability that “r” servers are idle P (S-r) § Number of hours that servers idle per day .∑,)* + Hr P (S−r) By Ms. Erandika Gamage
  • 57.
    § Average numberof units in queuing system ( Ls ) Ls = P(0) ∑&)' +!' θn &!' ! + SS S! θ S . S ' ! θ S + θ S 1 ' ! θ S ! § Average number of units in queue ( Lq ) Lq = SS S! θ S /0' 1 ' ! θ S 1 P(0) By Ms. Erandika Gamage
  • 58.
    § Average timespent by unit in queuing system ( Ws ) Ls = λ Ws § Average time spent by unit in queue ( Wq ) Lq = λ Wq Variables : λ = Rate of arrival of units nμ = Rate of service provision (if n <= S) Sμ = Rate of service provision (if n > S) n = Number of units in the queuing system S = Number of servers r = Number of servers idle H = Number of working hours per day By Ms. Erandika Gamage
  • 59.
    Ex: At a photocopyshop there is only one photocopy machine and customers arrive in a Poisson fashion at the rate of 14 per hour. The average service time (which is negative exponential) is 4 minutes.The shop works eight hours a day. a) How long on the average will a customer have to wait at the photocopying shop? b) By how much will this waiting time be reduced if they had two photocopying machines? Suppose the rate of arrival of customers has suddenly increased to 50 per hour due to the opening of new university close by, c) How long on the average will a customer have to wait at the photocopying shop. d) Number of hours server idle per day. By Ms. Erandika Gamage
  • 60.
    Ex: Answers (a) Rateof arrival of customers (λ) = 14 per hour Time taken to serve one customer = 4 min Number of customers served in one hour = 60 / 4 = 15 Rate of service completion (μ) = 15 per hour θ = λ / μ = 14 /15 LS = θ / (1- θ) = (14 / 15) / ( 1 – (14 /15)) = 14 LS = WS λ WS = 14 /14 Waiting time (WS) =1 hour By Ms. Erandika Gamage
  • 61.
    Ex: Answers (b) Numberof servers (S)=2 Evaluate P (0) 1 / P (0) = [ ∑&)* +!' (θn/n!) + (θS /S!) { 1 / (1-( θ /S)) } ] 1 / P (0) = [∑&)* &)' (14 / 15) n /n!)+ (14 / 15)2 /2!) {1 / (1-(14 /30))}] 1 / P (0) = (14 / 15) 0 /0!) + (14 / 15) 1 /1!) + (14 / 15)2 / 2! * 30 / 16 1 / P (0) = 1 + (14 / 15) + (14 / 15)2 *(½) * (15 * 2) / 16 1 / P (0) = 1 + (14 / 15) + 142 / (15 * 16) = 2.75 1 / P (0) = 2.75 P (0) = 0.363636 Continued... By Ms. Erandika Gamage
  • 62.
    Ex: Answers (b) Ls= P(0) ∑&)' +!' θn &!' ! + SS S! θ S . S ' ! θ S + θ S 1 ' ! θ S ! We have S = 2 , θ = 14 / 15 , (θ / S) = 14 / 30 , P (0) = 0.363636 Ls = 0.363636 ∑&)' &)' (14 /15) n &!' ! + 22 2! 14/15 2 1 2 ' ! 14/15 2 + 14/15 2 1 ' ! 14/15 2 ! LS = 0.363636 [(14 /15) 1 / 0! + 4 / 2 (14 / 30)2 {(60 / 16) + (14 / 30)(30 / 16)2}] LS = = 1.1931805 Continued... By Ms. Erandika Gamage
  • 63.
    Ex: Answers (b) WS= LS / λ WS = 1.1931805 / 14 WS = 0.0852271 hour WS = 5.1136 min Waiting time when there is 1 server (WS) =1 hour Waiting time when there are 2 servers (WS) = 5.1136 min Waiting time is reduced by (60-5.11) = 54.89 min By Ms. Erandika Gamage
  • 64.
    Ex: Answers (c) Rateof arrival of customers (λ) = 50 per hour Service time per customer = 4 min Number of service completions per hour = 60 / 4 = 15 Rate of service completion (μ) = 15 λ > μ Condition for equilibrium for single server queue is λ ≤ μ System has not met the equilibrium Condition for equilibrium for multi server queue is λ ≤ Sμ S ≥ λ / μ S ≥ 50 / 15 S ≥ 3.33 (number of servers required for equilibrium) At least 4 photocopying machines required to provide service Continued... By Ms. Erandika Gamage
  • 65.
    Ex: Answers (c) Rateof arrival of customers (λ) = 50 per hour Service time per customer = 4 min Number of service completions per hour = 60 / 4 = 15 Rate of service completion (μ) = 15 λ > μ Condition for equilibrium for single server queue is λ ≤ μ System has not met the equilibrium Condition for equilibrium for multi server queue is λ ≤ Sμ S ≥ λ / μ S ≥ 50 / 15 S ≥ 3.33 (number of servers required for equilibrium) At least 4 photocopying machines required to provide service Continued... By Ms. Erandika Gamage
  • 66.
    µ Server 2 WaitingRoom Rate of arrival ( 𝜆 ) Average time spent by unit in queuing system ( Ws ) Avg number of units in queuing system ( Ls ) Avg number of units in queue ( Lq ) Average time spent by unit in queue ( Wq ) µ µ Rate of service provision (3µ) Server 1 Server 3 By Ms. Erandika Gamage
  • 67.
    Case I :n <= S § Rate of arrival = λ § Rate of service completion = n μ Case II : n > S § Rate of arrival = λ § Rate of service completion = S μ Variables : n = Number of units in the queuing system S = Number of servers By Ms. Erandika Gamage
  • 68.
    § Probability of“n” units in queuing system Case I : n <= S P (n) = (θn / n!) P (0) P (S) = (θS / S!) P (0) Case III : n > L P(n) = 0 § Evaluate P(0) 1 / P (0) = ∑2)* /!' (θn/n!) + (θS /S!) (θ / S)S − (θ / S)L+1 1 − θ / S Case II : S < n <= L P (n) = (SS / S!) * (θ / S)n * P(0) By Ms. Erandika Gamage
  • 69.
    § Probability thatqueuing system is empty P (0) = 1/ ∑2)* /!' (θn/n!) + (θS /S!) (θ / S)S − (θ / S)L+1 1 − θ / S § Probability that all the servers are idle P (0) = 1/ ∑2)* /!' (θn/n!) + (θS /S!) (θ / S)S − (θ / S)L+1 1 − θ / S § Probability that “r” servers are idle P (S-r) = § Number of hours that servers idle per day .∑,)* + Hr P (S−r) By Ms. Erandika Gamage
  • 70.
    § Average numberof units in queuing system ( Ls ) Ls = P(0) ∑&)' +!' θn &!' ! + SS S! θ S . S ' ! θ S + θ S 1 ' ! θ S ! § Average number of units in queue ( Lq ) Lq = By Ms. Erandika Gamage
  • 71.
    § Average timespent by unit in queuing system ( Ws ) Ls = λ Ws § Average time spent by unit in queue ( Wq ) Lq = λ Wq Variables : λ = Rate of arrival of units nμ = Rate of service provision (if n <= S) Sμ = Rate of service provision (if n > S) n = Number of units in the queuing system L = Size of waiting room S = Number of servers r = Number of servers idle H = Number of working hours per day By Ms. Erandika Gamage
  • 72.
    Server Waiting Room Rate of arrival (N-n)𝜆 Rateof service provision (µ) Average time spent by unit in queuing system ( Ws ) Avg number of units in queuing system ( Ls ) Avg number of units in queue ( Lq ) Average time spent by unit in queue ( Wq ) Population Size (N) By Ms. Erandika Gamage
  • 73.
    Initial State Staten By Ms. Erandika Gamage
  • 74.
    § Probability of“n” units in queuing system P(n) = N! (N−n)! θn P(0) § Evaluate P(0) 1 / P (0) =∑&)* 3 N! (N−n)! θn **Computer software is used to evaluate ∑!"# $ $! $ &! ! θn § Probability that queuing system is empty P (0) = 1/∑&)* 3 3! 3 !& ! θn By Ms. Erandika Gamage
  • 75.
    § Probability thatthe server is idle P (0) = 1/∑&)* 3 N! (N−n)! θn § Number of hours that servers idle per day H P(0) H * 1/ ∑&)* 3 N! (N−n)! θn By Ms. Erandika Gamage
  • 76.
    § Average numberof units in queuing system ( Ls ) Ls = ∑&)* 3 nN! (N−n)! θn P(0) § Average number of units in queue ( Lq ) Lq =∑&)' 3 (n−1)N! (N−n)! θn P(0) By Ms. Erandika Gamage
  • 77.
    § Average timespent by unit in queuing system ( Ws ) Ls = λ Ws § Average time spent by unit in queue ( Wq ) Lq = λ Wq Variables : λ = Rate of arrival of units μ = Rate of service provision θ = λ / μ N = Size of the population n = Number of units in the queuing system H = Number of working hours per day By Ms. Erandika Gamage
  • 78.
    µ Server 2 WaitingRoom Average time spent by unit in queuing system ( Ws ) Avg number of units in queuing system ( Ls ) Avg number of units in queue ( Lq ) Average time spent by unit in queue ( Wq ) µ µ Rate of service provision (3µ) Server 1 Server 3 Rate of arrival (N-n)𝜆 Population Size (N) By Ms. Erandika Gamage
  • 79.
    Initial State Staten By Ms. Erandika Gamage
  • 80.
    Case I :n <= S § Rate of arrival = (N-n)λ § Rate of service completion = n μ Case II : n > S § Rate of arrival = (N-n)λ § Rate of service completion = S μ Variables : N = Size of the population n = Number of units in the queuing system S = Number of servers By Ms. Erandika Gamage
  • 81.
    § Probability of“n” units in queuing system Case I : n <= S P (n) = N! (N−n)!n! θn P(0) P (S) = N! (N−S)!S! θS P(0) § Evaluate P(0) 1 = ∑&)* +!' N! (N−n)!n! θn P(0) + ∑&)+ 3 N! (N−n)! (SS / S!) (θ / S)n P(0) § Probability that queuing system is empty P (0) = 1/ [∑&)* +!' N! (N−n)!n! θn P(0) + ∑&)+ 3 N! (N−n)! (SS/ S!) (θ / S)n P(0) ] Case II : n > S P (n) = N! (N−n)! (SS / S!)(θ / S)n P(0) By Ms. Erandika Gamage
  • 82.
    § Probability thatall the servers are idle P (0) = 1/ [∑&)* +!' N! (N−n)!n! θn P(0) + ∑&)+ 3 N! (N−n)! (SS/ S!) (θ / S)n P(0) ] § Probability that “r” servers are idle P (S-r) = § Number of hours that servers idle per day .∑,)* + Hr P (S−r) By Ms. Erandika Gamage
  • 83.
    § Average numberof units in queuing system ( Ls ) Ls = ∑&)* 3 nP(0) § Average number of units in queue ( Lq ) Lq =∑&)' 3 (n−1)P(n) By Ms. Erandika Gamage
  • 84.
    § Average timespent by unit in queuing system ( Ws ) Ls = λ Ws § Average time spent by unit in queue ( Wq ) Lq = λ Wq Variables : (N-n)λ = Rate of arrival of units nμ = Rate of service provision (if n <= S) Sμ = Rate of service provision (if n > S) n = Number of units in the queuing system N = Size of the population S = Number of servers r = Number of servers idle H = Number of working hours per day By Ms. Erandika Gamage
  • 85.
    § A queuingsystem where the output of one queue is the input to another is called a queuing network. There are 3 types of queuing networks I. Queues in Series II. Cyclic Queues By Ms. Erandika Gamage
  • 86.
    I. Queues inSeries II. Cyclic Queues Arrival Departure 2 3 By Ms. Erandika Gamage
  • 87.
    I. Queues inSeries § Now consider as a M/M/S model § Condition for equilibrium, λ ≤ Sμ 2 3 𝜆 µ1 µ2 µ3 Departure Arrival µ1 𝜆 By Ms. Erandika Gamage
  • 88.
    II. Cyclic Queues Acyclic queue has a fixed number of units rotating in a cycle and in the process receiving service from each station In solving the problem, 1. Consider the entire network as one system and list down all possible states 2. Write down the balance equation for each state 3. Write down the equation that describes the sum of the probabilities of all the states is one 4. Solve the equations By Ms. Erandika Gamage
  • 89.
    II. Cyclic Queues Ex1. Possible Situations (Waiting to receive service) State Probability Station 1 Station 2 0 3 S0 P0 1 2 S1 P1 2 1 S2 P2 3 0 S3 P3 By Ms. Erandika Gamage
  • 90.
    II. Cyclic Queues Ex1. State Balance Equation S0 μ2P(0) = μ1P(1) S1 (μ1+ μ2)P1 = μ2P0+ μ1P2 S2 (μ1+ μ2)P2 = μ1P3+ μ2P1 S3 μ1P3 = μ2P2 P0+ P1 + P2 + P3 = 1 [Sum of probabilities = 1] We can solve the above equations and find P0,P1,P2 and P3 . once we find these measures we can find expected number of units waiting to receive service from station 1 as, (0 × P0+1× P1 +2 ×P2 +3× P3) By Ms. Erandika Gamage
  • 91.
    II. Cyclic Queues Ex2. By Ms. Erandika Gamage
  • 92.
    II. Cyclic Queues Ex2. Possible Situations (Waiting to receive service) State Probability Station 1 Station 2 Station 3 3 0 0 S0 P0 2 1 0 S1 P1 2 0 1 S2 P2 1 2 0 S3 P3 1 1 1 S4 P4 1 0 2 S5 P5 0 3 0 S6 P6 0 2 1 S7 P7 0 1 2 S8 P8 0 0 3 S9 P9 By Ms. Erandika Gamage
  • 93.
    § Determine anacceptable waiting time for customers § Try to divert customer’s attention when waiting § Inform customers of what to expect § Keep employees not serving the customers out of sight § Segment customers § Train the servers to be friendly § Encourage customers to come during the slack periods By Ms. Erandika Gamage
  • 94.
    In a lifetime, the average person will spend , § SIX MONTHS Waiting at stoplights § EIGHT MONTHS Opening junk mail § ONE YEAR Looking for misplaced 0bjects § TWOYEARS Reading E-mail § FOUR YEARS Doing housework § FIVE YEARS Waiting in line § SIX YEARS Eating By Ms. Erandika Gamage