Professional Documents
Culture Documents
Probability Queueing Theory Unit 4
Probability Queueing Theory Unit 4
Probability Queueing Theory Unit 4
−(λn + µn ) Pn (t ) + λn −1 Pn −1 + Pn +1 (t ) µn +1
Pn' (t ) =
0
'
−λ0 P0 (t ) + P1 (t ) µ1
P (t ) = ( A)
Steady state equations
−(λ + µ ) Pn + λ Pn −1 + Pn +1µ =
0 .....(1)
−λ P0 + P1µ =
0 .....(2)
Values of P0 and Pn
λ
P0 = 1 − .....(4)
µ
Hence
λ λ
n
= 1 −
µ
Pn
µ
Remark:
(1) λ
P0 = 1 −
µ
(2)The quantity
λ
= ρ
µ
is called the traffic intensity
Average number (Ls) of customers in the
system
Let n be the customers in the system.
Then
∞
=
Ls =
E ( n) ∑ nP
n =0
n
λ λ
n
∞
∑ n
µ 1 −
n =0 µ
λ λ
n
∞
= 1 − ∑ n
µ n =0 µ
n −1
λ ∞
λ λ
= 1 − ∑ n
µ n =0 µ µ
λ λ λ
n
∞
= 1 − ∑ n
µ µ n =0 µ
∞
λ
{1 − ρ} ρ ∑ nρ where ρ =
= n −1
n =1 µ
={1 − ρ } ρ {1 + 2 ρ + 3ρ 2 + .........}
−2
{1 − ρ} ρ {1 − ρ}
=
Q (1 − x )−2 =+
1 2 x + 3x + ............
2
ρ
= .......... ( 5 )
{1 − ρ }
λ
µ
=
λ
1 −
µ
λ
= .......... ( 6 )
{µ − λ}
Remark:
1.By the average number of customers Ls in the system,
we mean the number of customers in the queue + the
person who is getting serviced.
∞
=
Lq E=
( n) ∑ (n − 1) P
n =1
n
λ
n
∞
λ
1 − ∑ ( n − 1)
=
µ n =1 µ
n−2
λ ∞
2
λ λ
1 − ∑ ( n − 1)
=
µ n =1 µ µ
n−2
λ λ
2
∞
λ
=
1 − ∑ ( n − 1)
µ µ n=2 µ
∞
λ
{1 − ρ} ρ
= 2
∑ ( n − 1) ρ
n=2
n−2
where ρ =
µ
={1 − ρ } ρ {1 + 2 ρ + 3ρ + .........}
2 2
{1 − ρ } ρ 2 {1 − ρ }
−2
=
Q (1 − x ) −2 =+
1 2 x + 3 x 2 + ............
ρ
Lq = .......... ( 7 )
{1 − ρ }
λ
2
µ
=
λ
1 −
µ
λ2
Lq = .........(8)
µ {µ − λ}
Remark :
1)By the average number of customers in the queue we
mean the number of customers in the queue excluding
the person who is getting serviced
λ
L= Ls − .......(9)
q
µ
λ λ
n
Q P= 1 −
µ µ
n
λ
n
∞
λ
= 1 − ∑
µ n= k +1 µ
λ λ
k +1 k +2
λ
=
1 − + + ....
µ µ µ
λ λ
k +1
λ λ 2
=1 − 1 + + + .....
µ µ µ µ
k +1 −1
λ λ λ
=
1 − 1 − µ
µ µ
k +1
λ
= ........(10)
µ
=ρ k +1
........(11)
Average number Lw of customers in the
nonempty queue
L=
w E {( N − 1) / ( N − 1) > 0}
E ( N − 1)
=
P {( N − 1) > 0}
λ2
1
× ∞ (by (8))
µ {µ − λ}
∑ Pn
n=2
λ2
µ2
= × 2 (by (10))
µ {µ − λ} λ
µ
= ......(12)
µ −λ
Probability density function of the waiting
time in the system.
Let Ws be the continuous random variable that
represents the waiting time of a customer in the
system.
∑ f (w / n) Pn
∴ f ( w) =
n =0
......(13)
Now f(w/n) =p.d.f of sum of (n+1) service times
=p.d.f of sum of (n+1)independent
random variables
∞
µ n +1
f ( w) = ∑ e −µw n
w Pn
n =0 n!
n
∞
µn +1
−µw n λ λ
∑ e w 1 −
n =0 n ! µ µ
λ − µw ( λ w)
n
∞
1 − µ e ∑ (µ − λ)e e
−µw λw
= =
µ n =0 n!
= (µ − λ)e −( µ − λ ) w
........(14)
1
Ws = ......(15)
µ −λ
(since , if λ is the parameter of the
exponential distribution then the mean of the
Distribution is 1/λ )
λ
= ......(16)
µ (µ − λ )
∫ ∫( µ λ ) − ( µ −λ ) w
P (Ws > t )= f ( w) dw = − e dw
t t
− ( µ −λ ) w ∞
− e
= e− ( µ −λ )t
= ........(17)
t
Probability density function of the waiting
time in the system
∑ g (w / n) pn
∴ g ( w) =
n =0
.....(18)
Now g(w/n) = p.d.f of sum of n service times
Hence
µn
g ( w / n) e − µ w wn −1 , w > 0
( n − 1)!
λ
= 1 − λ e −µw λw
e
µ
λ
( ) −( µ − λ ) w
= µ − λ e ( w > 0)
µ
λ
(µ − λ) (w =
0)
µ
Little’s formula
We have a relation between Ws,Wq,Ls,Lq given as
follows
λ
=Ls = λWs
µ −λ
λ λ
L=s = Lq +
µ −λ µ
1 1
W= = Wq +
s
µ −λ µ
λ2
=
Lq = λWq
µ −λ
Remark:
Using Little’s formula, if one value is calculated then the
other 3 values can be found using the above relation
Problems
Example 1
Arrival rate of telephone calls at a telephone booth is
according to the Poisson distribution with an average
time of 9 minutes between two consecutive arrivals. The
length of telephone call is assume to be exponentially
distributed with mean 3 minutes.
= 0.33
•Average queue length that forms from time to time
µ
Ls =
µ −λ
1 1
3 = 3 9
= =
1 1 2 6
−
3 9 9
= 1.5
λ1
4= ( Q The waiting time toinstall a second booth is 4minutes)
1 1
( − λ1 )
3 3
4 4λ1
− λ1
=
9 3
4 4λ1
= λ1 +
9 3
4 7 λ1
=
9 3
4
λ1 = arrivals / minute
21
4 1
∴ Increase in flow of arrivals = −
21 9
5
= per minute
63
•Probability of waiting time more than 10 minutes
= P(Ws > 10)
∞
λ
∫10 µ ( µ − λ ) e
− ( µ − λ )t
dt
λ 0 + e −10( µ − λ )
=
µ
1 1
1 −10 −
= e 3 9
3
20
1 −
= e 9
3
1
= (approximately)
30
∫( ) − ( µ − λ )t
µ − λ e dt
10
1
µ 1 3 1
= ( By (d ))
λ 30 1 30
9
= 0.1
•The expected fraction of day that the
phone will be in use is equal to
=
λ
µ
1
= 9
1
3
= 0.33
Example 2:
1
Mean service rate = = 10
µ
1
∴µ = per minute
10
Step 3: To find the following:
1
λ 12
=
Ls =
µ −λ 1
−
1
10 12
= 5 customers
Expected number of customers in queue
1
λ2 144
Lq =
µ (µ − λ ) 1 1 1
−
10 10 12
= 4.17 customers
b) P( a customer straightly goes to the barber’s chair)
= P(no customer in the system)
(i.e., the system is idle)
1
λ
Po =1 − =1 − 12
µ 1
10
1
=
6
= 60 minutes or1hour
1
d ) Ws > 75, if > 75, where λr is the new arrival rate.
µ − λr
1
(i.e) if λr > µ −
75
1 1
(i.e) if λr > −
10 75
13
(i.e) if λr >
150
13 1 1
− = per minute
150 12 300
1
λ 12
e) Wq = = 50 minutes
µ (µ − λ) 1 1 1
−
10 10 12
− ( µ − λ )t
f ) P (W > t ) =e
1 1
− − ×30
P (W > 30) =
e 10 12
−0.5
=e
= 0.6065
=
g ) P (a customer has to wait ) P (W > 0)
=
1 − P (W =
0)
=
1 − P ( Number of customers =
0)
= 1 − Po
1
λ 12 5
= = =
µ 1 6
10
5
∴Percentage of customers who have to wait = ×100 =
83.33
6
( h) P ( N > 3) = P4 + P5 + P6 + .....
1 − { P0 + P1 + P2 + P3
= }
λ λ λ λ
2 3
= 1 − (1 − ) 1 + + +
µ µ µ µ
λ
n
λ
Since Pn = 1 − , for n ≥ 0
µ µ
λ
4 4
5
= =
µ 6
= 0.4823
Exercises:
and − λ0 P0 + P1µ1 =
0 .....(2)
This is a typical equations model where the number
of customers in the system is limited. In other
words, the system can accommodate only finite
number of customers in the system. If a customer
arrives and the queue is full, the customers leaves
the system without joining the queue.
Hence for this model
µn µ=
= , n 1, 2,3,...
&λn = λ , for n =
0,1, 2,3,...(n − 1)and is zero for n =
N , N + 1,...
λ
and hence P1 = P0 .....(4)
µ
Also, Pn +1 µ = (λ + µ ) Pn − λ Pn −1 , 0 < n < N .....(5)
=
and PN µ λ=
PN −1 , for n N .....(6)
From (5) P2 µ =
(λ + µ ) P1 − λ P0
2
λ
⇒ P2 =
P0 and so on .....(7)
µ
n
λ
In general=
, Pn P0 , 0 < n < N .....(8)
µ
λ
From (5), PN = PN −1 .....(9)
µ
N −1
λ λ
⇒ PN = P0
µ µ
N
λ
⇒ PN =
P0 .....(10)
µ
∑P
n =0
n =1
λ
N
N
⇒ ∑
n =0 µ
P0 =
1
λ
N
N
⇒ P0 ∑
n =0 µ
=
1
λ λ
2
λ
N
⇒ P0 1 + + + ... + =1
µ µ µ
λ
N +1
1 −
µ
⇒ P0 =
1 , valid for λ ≠ µ
λ
1−
µ
λ
1−
µ
⇒ =P0 , valid for λ ≠ µ
λ
N +1
1 −
µ
λ λ
N
If λ µ ,=
then =
1. Hence PN =
Po Po
µ µ
N N
∴∑ Pn =
1 ⇒ ∑ P0 =
1
n 0=n 0
1
∴ ( N + 1) P0 =1 ⇒ P0 =
( N + 1)
Hence from (10), we have
λ
1−
λ µ
N
Pn , for λ ≠ µ
µ λ
N +1
1 −
µ
1
and Pn = for λ µ
( N + 1)
Similar to the first model, we can find the following
•Probability that the system is idle.
1− ρ λ
P0 = Q ρ
1− ( ρ ) µ
N +1
1−
µ
k
=, for λ µ
2
λ'
µ (1 − P0 ) the effective arrival rate
Ls − , λ ' =
Lq =
µ
•Average waiting time in the queue
Lq
Wq =
λ '
Lq = Ls − (1 − P0 )
Example 1:
1
Service rate , µ = per minute
15
= 4 per hour
= 6 +1
=7
Step 3: To find the following
•The probability a customer can get directly into the
barber chair upon arrival i.e., P0 .
•Expected number of customers waiting for hair cut i.e.,
Lq
•Effective arrival rate i.e., Service rate x(1 – P0)
•The time a customer can expect to spend in the
barbershop i.e., Wq
Step 4 : Required computations
•The customer will directly go in barber chair when
the system at the time of his arrival is empty. The
probability in this situation is given by P0.
1− ρ λ 3
We know that P0= ,ρ
= =
1− ( ρ )
N +1
µ 4
3
1−
= 4
7 +1
3
1−
4
= 0.2778
•Expected number of customers waiting for the hair
cut(Lq)
Lq = Ls -1 +P0
N +1
λ
( N + 1 )
λ µ
− − 1 + P0
µ −λ λ
N +1
1−
µ
7 +1
3
( 7 + 1)
=
3
− 4
− 1 + 0.2778
7 +1
4−3 3
1−
4
8
3
8
= 3 − 8 − 1 + 0.2778
4
3
1−
4
= 1.38
= 4(1 − 0.2778)
Ls
Ws =
Effective arrival rate
L q +1- Po
=
Effective arrival rate
1.38 + 1 − 0.2778
=
2.89
= 43.2 minutes
Example 2:
Trains arrive at the yard every 15 minutes and
the service rate is 33 minutes. If the line
capacity at the yard is limited to 4 trains, find
ρ −1
P0 =
ρ N +1
−1
2.2 − 1 1.2
=
( 2.2 ) − 1
5
50.5
= 0.0237
N
Average number of trains in the system Ls = ∑ nPn
n =0
=P1 + 2 P2 + 3P3 + 4 P4
=ρ P0 + 2 ρ 2 P0 + 3ρ 3 P0 + 4 ρ 4 P0
= P0 ρ + 2 ρ 2 + 3ρ 3 + 4 ρ 4
= 3.26
Example 3:
A barbershop has space to accommodate only
10 customers . He can serve only one person at a
time. If a customer comes to his shop and finds it full
he goes to the next shop. Customers randomly arrive
at an average rate λ = 10 per hour and the barber
service time is exponential with an average of 5
minutes per customer . Find P0 & Pn
Step 1: Model Identification
Since there is only one barber, the number of
service channels is one. Also, since only 10 chairs
are available, the capacity of the system is finite.
Hence this problem comes under the model
(M/M/1) : (N/FCFS)
(Single Server / Finite Queue)
Step 2: Given data
10 1
λ
Arrival rate= =
60 6
1
Service rate µ =
5
5
1−
1− ρ 6
P0 =
1− ( ρ )
N +1 11
5
1−
6
0.1667
= 0.1926
0.8655
1− ρ N
Pn = .ρ
1− ( ρ )
N +1
n
5
( 0.1926
= ) ( n 0,1, 2,3,...10)
6
Exercise:
1) A car park contains 5 cars. The arrival of cars is
Poisson at a mean rate of 10 per hour. The length of time
each car spends in the car park is exponentially
distributed with mean of 5 hour. How many cars are
there in the car park on an average.
[Hint : Model identification – Given N, λ & µ. Find Ls
and P0 ]
2) In a railway marshalling yard, goods train arrive at
the rate of 30 trains per day. Assume that the inter
arrival time follows as exponential distribution and the
service time is also to be assumed as exponential with
mean of 36 minutes. Calculate
•The probability that the yard is empty.
•The average queue length, assuming the line capacity
of the yard is 9 trains.
[Hint : Model identification – Given N, λ & µ. Find Ls
and P ]
3) Patients arrival at a clinic having single
doctor according to Poisson distribution at a
rate of 30 patients per hour. The waiting room
does not accommodate more than 14 patients.
Examination time per patient is exponential
with mean rate of 20 per hour.
•Find the effective arrival rate at the clinic.
•What is the probability that an arriving patient will
not wait?
•What is the expected waiting time until a patient is
discharged from the clinic?
[Hint : Model identification – Given N, λ & µ. Find
Ls , P0, Effective arrival rate]