Professional Documents
Culture Documents
Queuing Theory
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
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)
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.
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
Server
Unit currently
Population Arrival Units in Queue/Waiting Line Departure
being served
o Traffic Control
o Determining the sequence of computer operations
Unit currently
Population Arrival Units in Queue/Waiting Line Departure
being served
e!"# λt $
x!
𝜆 – Average rate of arrivals
e!%# µt $
x!
µ – Average rate of service provision
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 o Multi Server Queue
Server Server 2
Server 3
Server 1
Server Server 2
Server 3
By Ms. Erandika Gamage
o Single Server Queue o Multi Server Queue
Server Server 2
Server 3
II. Last Come First Served (LCFS)/ Last in First Out (LIFO)
Ex: Elevator
II. Last Come First Served (LCFS)/ Last in First Out (LIFO)
Ex: Elevator
(M / M / 1) : ( FIFO / ∞ / ∞ )
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
§ 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”
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?
b) Number of sets ahead of the set just taken for repair (LQ)
LQ = θ2/ (1-θ) = (5/8)2/ (1-5/8) = 1 ½4
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.
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
Avg number of units in queuing system ( Ls ) Rate of service
provision (3µ)
µ Server 1
Avg number of units in queue ( Lq )
Rate of arrival ( 𝜆 )
µ Server 2
Waiting Room
µ Server 3
Average time spent by unit in queue ( Wq )
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 Case II : n > S
P (n) = (θn / n!) P (0) P (n) = (SS / S!) * (θ / S)n * P(0)
P (S) = (θS / S!) P (0)
§ Evaluate P(0)
1 / P (0) = [ ∑+!'
&)* (θ /n!) + (θ /S!) { 1 / (1-( θ /S)) } ]
n S
P (0) = 1/ [ ∑+!'
&)* (θn /n!) + (θ /S!) { 1 / (1-( θ /S)) } ]
S
.∑+,)* Hr P (S−r)
S '!
S
Ls = λ Ws
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
By Ms. Erandika Gamage
H = Number of working hours per day
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.
LS = WS λ
WS = 14 /14
Waiting time (WS) =1 hour
1 / P (0) = [∑&)'
&)* (14 / 15) /n!)+ (14 / 15) /2!) {1 / (1-(14 /30))}]
n 2
S '!
S
1
(14 /15) n 22 14/15 2 14/15 1
Ls = 0.363636 ∑&)'
&)' + +
&!' ! 2! 2 '!
14/15 2 14/15
!
2 '!
2
LS = 0.363636 [(14 /15) 1 / 0! + 4 / 2 (14 / 30)2 {(60 / 16) + (14 / 30)(30 / 16)2}]
LS = = 1.1931805
µ Server 1
Avg number of units in queue ( Lq )
Rate of arrival ( 𝜆 )
µ Server 2
Waiting Room
µ Server 3
Average time spent by unit in queue ( Wq )
Case II : n > S
§ Rate of arrival = λ
Variables :
n = Number of units in the queuing system
S = Number of servers
§ Evaluate P(0)
(θ / S)S − (θ / S)L+1
1 / P (0) = ∑/!'
2)* (θ /n!)
n + (θS /S!)
1−θ/S
P (S-r) =
.∑+,)* Hr P (S−r)
By Ms. Erandika Gamage
§ Average number of units in queuing system ( Ls )
.
θn SS θ S θ 1
Ls = P(0) ∑+!'
&)' + +
&!' ! S! S '!
θ S θ
!
S '!
S
Lq =
Ls = λ Ws
Lq = λ Wq
Variables :
S = Number of servers
λ = Rate of arrival of units
r = Number of servers idle
nμ = Rate of service provision (if n <= S)
H = Number of working hours per day
Sμ = Rate of service provision (if n > S)
n = Number of units in the queuing system
L = Size of waiting room
By Ms. Erandika Gamage
Avg number of units in queuing system ( Ls )
§ Evaluate P(0)
N!
1 / P (0) =∑3
&)* θn
(N−n)!
$!
**Computer software is used to evaluate ∑$
!"# θn
$ &! !
H P(0)
N!
H * 1/ ∑3
&)* θn
(N−n)!
Ls = λ Ws
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
Avg number of units in queuing system ( Ls ) Rate of service
provision (3µ)
µ Server 1
Avg number of units in queue ( Lq )
Rate of
arrival
(N-n)𝜆
µ Server 2
Waiting Room
µ Server 3
Average time spent by unit in queue ( Wq )
Population Size (N)
Case II : n > S
§ Rate of arrival = (N-n)λ
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 Case II : n > S
N! N!
P (n) = θn P(0) P (n) = (SS / S!)(θ / S)n P(0)
(N−n)!n! (N−n)!
N!
P (S) = θS P(0)
(N−S)!S!
§ Evaluate P(0)
N! N!
1 = ∑+!'
&)* θn P(0) + ∑3
&)+ (SS / S!) (θ / S)n P(0)
(N−n)!n! (N−n)!
P (S-r) =
.∑+,)* Hr P (S−r)
Ls = λ Ws
Lq = λ Wq
Variables :
(N-n)λ = Rate of arrival of units S = Number of servers
nμ = Rate of service provision (if n <= S) r = Number of servers idle
Sμ = Rate of service provision (if n > S) H = Number of working hours per day
n = Number of units in the queuing system
N = Size of the population
By Ms. Erandika Gamage
§ A queuing system where the output of one queue is the input to another is called a
queuing network.
2 3
Arrival Departure
Arrival Departure
µ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)