Vous êtes sur la page 1sur 67

Queuing System

A queueing system can be described as


customers arriving for service, waiting for
service if it is not immediate, and if having
waited for service, leaving the service
after being served.
The basic queuing System

Queuing System

Entered Service
Arriving Served
Population of customers mechanism Customers
Customers
prospective
customers C C C Customer
queue in service
Basic Elements of a Queuing System
(i) Population of prospective customers
(ii) Arrival Pattern or probability distribution
of inter arrival times
(iii) Queue
(iv) Queue discipline or service discipline
(v) Service Mechanism
(vi)Probability distribution of customer
service times
(vii) State of the System
Population of prospective
customers
This is an input source from which
customers requiring service are generated
over time.
Size of population:
If arrival rate of customer to the queueing
system is affected by no. of customer in
the queueing system the population is
assumed as finite otherwise infinite.
Arrival pattern of customers We assume customers
arrive in a Poisson process. This is same as assuming
the interval times are exponential random variables
with the same parameter (i.e., the same parameter
which given in Poisson Process )
Queue: A queue is characterized by the maximum
permissible number m of customers that it can
contain. A queue is called infinite or finite if this
number is infinite of finite.
Queue Discipline The rule for selecting the next
the customer from the queue for sevice
FCFS First Come First Serve
LCFS Last Come First Serve
SIRO Service in Random Order
Sometimes on the certain priority basis
Service Mechanism A service station may have
one or several servers arranged in parallel.
Another service mechanism may consists of
several service facilities in a series.
Service Time Distribution Service times for
different customers will be assumed to be
independent and exponential random variables.

State of the System: The state of the system at


an instant of time refers to the total number of
customers in the system at that instant which
includes those who are under service and also
those who are in queue.
Terminology and Notations

N = the number of the customers in the system


at any instant.
Q= the number of the customers in the queue at
any instant.
Pn(T)=P(N(T)=n)
=P(there are n-customers in the system at time T)
Pn=P(N=n)
=P(there are n-customers in the system at any
instant ), n=0,1,2,.

Note: N and Q are random variables and


RN=RQ={0,1,2,}
s = the number of servers working in parallel
in the queuing system.
n = mean arrival rate when the state of the
system is n.
n = mean service rate when the state of the
system is n (which is different from
mean service time).
Note: Relation between mean service rate
and mean service time
Mean service time =1/(mean service rate)
L = Expected number of customers in the
system at any instant
= E(N)

nPn
n 0

Lq = expected number of customers in the


queue at any instant
= E(Q)
Now

E (Q) kP(Q k )
k 0

kP ( N k s )
k 0

( n s ) P ( N n)
ns

(n s ) Pn
ns

Server utilization =
s



Note that: Server utilization and both are same for
single server system.

In general, both are different notations or terminology.


W = Mean waiting time of a customer in the system at
any instant.
Wq = Mean waiting time of a customer in the queue at
any instant.
Relation between W and Wq
1
If the mean service time is 1 then W Wq

Kendalls Notation:
A queuing system can be expressed as (a/b/c): (d/e/f)
a Inter-arrival time distribution
b Service time distribution
c No. of servers
d Queue discipline
e System capacity
f size of the population
We use the symbol M for Exponential distribution (
which can be used for a and b )
Example: ( M/M/ 4) : ( FCFS / 20 / )

Inter arrival time is exponential, service time is also


exponential for each of the 4 servers, queue discipline is
first come first serve basic, the maximum number of
customers allowed to the system is 20 (4 in service and
16 in queue), and the population size is infinite.
Littles Law: L W
Lq Wq

These relationships do not hold when the maximum


customers allowed into the system is finite.

In case finite, the modified littles law as follows:

L W
Lq Wq

where n Pn , called effective arrival rate
n 0
In each queueing problem, the parameters Pn , L, Lq , W and Wq to
be determined.

The main problem is to calculate Pn . So we need to have some


method to determine Pn .

Birth and Death Process


Birth is an entry into the system and death is a departure after
service completion.

Dr. J. K. Sahoo (BITS) Lecture 3 Section-1 3 / 10


B IRTH AND D EATH P ROCESS
Assumptions

1. Given that N(T ) = n, the conditional probability distribution of the


time until the next birth is exponential with parameter
n , n = 0, 1, 2,
2. Given that N(T ) = n, the conditional probability distribution of the
time until the next death is exponential with parameter
n , n = 1, 2, with 0 = 0.
3 P(more than one event occurs in interval (T , T + T )) = o(T )
4 Only one birth or one death can occur at a time. Also births and
deaths are independent.
Dr. J. K. Sahoo (BITS) Lecture 3 Section-1 4 / 10
F ROM THE ABOVE 4 ASSUMPTIONS

1. P(no birth in (T , T + T )|N(T ) = n) = 1 n T + o(T ).

2. P(no death in (T , T + T )|N(T ) = n) = 1 n T + o(T ).

3. P(exactly one birth in (T , T + T )|N(T ) = n) = n T + o(T ).

4. P(exactly one death in (T , T + T )|N(T ) = n) = n T + o(T ).

5. P(two or more births/deaths in (T , T + T )|N(T ) = n) = o(T ).

6. P(no births and no deaths in (T , T + T )|N(T ) = n) =


1 (n + n )T + o(T ).

Dr. J. K. Sahoo (BITS) Lecture 3 Section-1 5 / 10


B IRTH AND D EATH P ROCESS

Let A be the event that exactly one birth and no death in


(T , T + T ).

Let B be the event that exactly one death and no birth in


(T , T + T ).

Let C be the event that no birth and no death in (T , T + T ). Then

P(A|N(T ) = n) = n T + o(T ).

P(B|N(T ) = n) = n T + o(T ).

P(C|N(T ) = n) = 1 (n + n )T + o(T ).

Dr. J. K. Sahoo (BITS) Lecture 3 Section-1 6 / 10


B IRTH AND D EATH P ROCESS

Since Pn (T ) = P(N(T ) = n), which implies


Pn (T + T ) = P(N(T + T ) = n). Now
Pn (T + T ) = P(N(T ) = n & C or N(T ) = n + 1 & B or N(T ) =
n 1 & A) + o(T )

Pn (T + T ) = P(N(T ) = n & C) + P(N(T ) =


n + 1 & B) + P(N(T ) = n 1 & A) + o(T )

Pn (T + T ) = P(C|N(T ) = n)Pn (T ) + P(B|N(T ) =


n + 1)Pn+1 (T ) + P(A|N(T ) = n 1)Pn1 (T ) + o(T )

Dr. J. K. Sahoo (BITS) Lecture 3 Section-1 7 / 10


B IRTH AND D EATH P ROCESS

Pn (T + T ) = {1 (n + n )T }Pn (T ) + n+1 Pn+1 (T )T +


n1 Pn1 (T )T + o(T )
Pn (T +T )Pn (T )
T =
o(T )
(n + n )Pn (T ) + n+1 Pn+1 (T ) + n1 Pn1 (T ) + T
dPn (T )
dT = (n + n )Pn (T ) + n+1 Pn+1 (T ) + n1 Pn1 (T )

The solutions of above equations are very difficult to obtain


analytically, except for some very special cases.

Dr. J. K. Sahoo (BITS) Lecture 3 Section-1 8 / 10


SPECIAL CASE ( PURE BIRTH ):

Pure Birth process (i.e. n = 0) with


n = , P0 (0) = 1, and Pj (0) = 0 for j 6= 0. Then the above
equation becomes

dPn (T )
= Pn (T ) + Pn1 (T ), for n 1 and
dT
dP0 (T )
= P0 (T ).
dT
(T )n eT
The solution in this case will be Pn (T ) = n! , n 0 and
T > 0.

Dr. J. K. Sahoo (BITS) Lecture 3 Section-1 9 / 10


SPECIAL CASE ( STEADY STATE / STATIONARY SYSTEM ):

dPn (T )
If limT Pn (T ) = Pn and limT dT = 0 for all n 0,we have

0 = (n + n )Pn + n+1 Pn+1 + n1 Pn1 for n 1 and

0 = 1 P1 0 P0 .

Pn+1 = n+1
n
Pn for n 0 and Pn = 0 1 1 2 n1
n
P0 for n 1.
 
As 0 0 1
P
n=1 P n = 1 which implies P0 1 + 1 + 1 2 + = 1.

Thus, the steady state probabilities exist if the series


0 1 n1
S = 1 + C1 + C2 + < , where Cn = 1 2 n

Then P0 = 1/S and Pn can be determined for any n.

Dr. J. K. Sahoo (BITS) Lecture 3 Section-1 10 / 10


Queueing Models:
Model 1. (M/M/1) : (FCFS//) with

n , n 0,1, 2,...
n , n 1, 2,...
n

Now Cn = = n , n 1,2,.......

1 1.
and S = 1 + C1 + C2 + ............. if
1
Thus for existence of steady state probabilities, we must
have 1.
P0 = 1 = 1 -
S
n
Also, Pn = Cn P0 = (1 - ), n = 0,1, 2, ...
which is geometric distribution with
probability of success 1 -
Hence, the steady state number of customers follows
geometric distribution.
Performance Measures:
L 1
L E(N ) , W
1
1 2
Wq W , Lq Wq
s ( ) ( )
Model 2. (M/M/1) : (FCFS/m/) with

, for n 0,1,..., m 1
n n for all n.
0, for n m

This gives 2 m

S 1 ...

1 2 ... m
1 m 1
if 1 or
1
and S m 1,
Therefore,

1
1 m 1 ,
P0
1 ,
m 1
and
(1 ) n
m 1
, , n 0,1,..., m
1
Pn
1 , , n 0,1,..., m
m 1
m m 1
n Pn Pn (1 Pm )
n0 n 0

Now, if , then
m
(1 ) n
m
L E ( N ) nPn n m 1
n 0 n 0 1
m m 1
(1 ) n ( m 1)

1 m 1

n0
n
1

1 m 1

m
1 m
If , then L n
n0 m 1 2

L L 1
W , Wq W
(1 Pm )
and Lq Wq
Model 3. ( M/M/s ) : (FCFS/ / ) with
n , ns
n , n 0,1, 2,... and n
s , ns
n
1 1 n
Therefore, Cn , for n 1, 2,..., ( s 1).
n! n!
1
and Cn n , for n s.
s ns s !
2 s 1 s s 1 s2
S 1 ... 2 ...
2! ( s 1) ! s! ss ! s s!


s 1


n

s
1 if s.
n0 n! s ! 1
s
For existence of steady state probabilities, we must
have s.
1
s 1 n s
1 1
Now P0
S
n 0 n ! s ! 1
s
n
P0 , n 0,1, ..., ( s 1).
n!
and Pn n

P0 , n s.
n
s s! s
sk

Lq ( n s ) P kP
ns
n
k 0
sk k k P0
k 0 s s!

s k s 1 2

P0 k k P0
s ! k 0 s
1
ss ! s
Lq
Wq

1
W Wq

L W
Model 4. (M/M/s) : (FCFS/m/) with
, for n 0,1,..., m 1 n , for n s
n and n
0, for n m s , for n s

2 2 s
Thus, C1 , C2 2
,..., Cs
2 2 s!
s m
and Cs 1 ,..., Cm m s
s! s s s!

Also, S 1 C1 C2 ... Cm
2 s 1 s ms
We get S 1 ... 1 ... m s
2 ( s 1)! s ! s s
m s 1
1
s 1
n
s
s

, 1
n 0 n ! s!
1
s s

s 1 n s

and S
n0 n!

s!
( m s 1), if
s
1
Therefore,
1
m s 1

1
s 1 n s s , if 1

n 0 n ! s !
P0

1
s

s

n s 1
s 1

n! s ! (m s 1) , if
s
1
n 0
n
P0 , for n 0,1,..., s 1
n!
n
Also , Pn n s P0 , for n s , s 1,..., m
s s!
0, for n m 1, m 2...



Now Lq (n s ) Pn kPk s
ns k 0
m s sk

k k P0
k 0 s s!
s 1 2 m s 1

P0 1 2 3 2 ... ( m s) m s 1
ss ! s s s
ms ms 1

s1 1 (m s 1) (m s)
s s
Lq P0 2
s s!
1
s
Also, (1 Pm )
Lq 1
Thus, Wq , W Wq

L W
Model 5. ( M /M /s ) : ( FCFS/K /K )
This Model, the limited source model in which there are
only K customers, is called the machine repair model,
the machine inference model or the cyclic queue model.
K- total number of machines working in parallel.
s- Number of mechanics (servers) and s K.
Assumptions:
1. The time until breakdown of a machine has
exponential distribution with parameter and the
machines function independently.
2. The service time of each machine is exponentially
distributed with parameter and service times are
independent.
Let there be n machines in the repair shop (system).
( K n ) machines are functioning.
Let T be the time until next machine arrives.
T min{T1 , T2 ,........., T( K n ) },
where Ti is the time until breakdown of the i th machine.
T has exponential distribution with parameter (K n).
The arrival occurs in poisson process with mean
( K n ), when there are n-customers in the system.
( K n) , n 0,1,..., K 1
n
0, nK
n , n 1, 2,..., s 1
Now n
s , ns

and
K K ( K 1) 2 K ( K 1) 2
C1 K , C2 2

1. 1.2 2
K! n
, n 1, 2,..., s 1
n !( K n)!
Cn
K! n
, n s, s 1,...K
s n s s !( K n)!
s 1 K
K! n K!
S ns n
n 0 n !( K n )! ns s s !( K n)!

P0 1
S

K! n

n !( K n)! P0 , n 1, 2,..., s 1

K!
Pn n s n P0 , n s, s 1,..., K
s s !( K n)!
0, nK


K
L nPn ,
n 0

K K
n Pn ( K n) Pn ( K n) Pn ( K L)
n 0 n 0 n 0

L 1
W , Wq W , L q W q .

Problem 1:

On an average, 5 customers reach the barbers


shop every hour. Determine the probability that
exactly 2 customers will reach in a 30 minute
period, assuming that the arrivals follow Poisson
distribution.

Ans: 5, t 0.5
t
e
2
P( X 2) (t)
2!
Problem 2: In a barbers shop with a single barber,
there are three chairs. Out of these, one chair is
for hair cutting and the other two for waiting inside
the shop. The customers arrive according to
Poisson distribution with average 2 customers per
hour. The service time is exponential with mean 20
minutes per customers. If all the chairs are
occupied, then any customer that comes goes
elsewhere for hair cutting. Find the probability that
(i) a customer will get a chair to sit.
(ii) a customer will get immediate service.
(iii) a customer will wait outside the shop or go
elsewhere for hair cutting.
Also find L and W.
Solution:
2
2, 3, m=3, .
3
(i) P0 P1 P2 1 P3

(ii) P0
(iii) P(n 3) P3
L
L P1 2P2 3P3, 2(1 P3 ), W .

Problem 3: Trains arrive at the yard exponentially
every 15 minutes and the service time is also
exponential with a mean of 30 minutes. If the line
capacity of the yard is limited to 4 trains, find

(a) The probability that the yard is empty.

(b) The average number of trains in the system.

Ans:
1 98
(a) P0 (b) L
31
31
Problem 4: Problem VII.3 Page 7.70
A telephone exchange has two long distance
operators. During the peak hours, long distance
calls arrive in a Poisson process at the mean rate
of 15 per hour. The length of service on these
calls is approximately exponential with mean 5
minutes.
(a) Find the probability that a subscriber will wait
for his long distance call during the peak
hours?
(b) Find the mean waiting time in the queue?
Solution: (M/M/2) : (FCFS//) model
with = 15, = 12, = 5/4<2
1 1 3
P0 s1 n s
2

13
n! s!(1 / s) 1 2
n0

P1 = P0 =15/52
Thus the probability that a new subscriber will wait for
the long distance call = Probability that the number of
customers in the system 2=1 - P0 - P1= 0.48
s1
25 5 64 3 125
Lq P
2 0
ss!(1 / s) 32 8 9 13 156

Lq 125 25
Wq hr 3.2min.
15615 468
Problem 5: Problem VII.5 Page 7.70
At a service station, customers arrive in a Poisson process at
the rate of 15 per hr. The service time of a customer is
exponential with mean 6 minutes. A server has to be paid Rs.
4/- per hour and the cost incurred and borne by the service
station due to the presence of a customer in the system is
Rs. 10/- per hr per customer.
(a) What is the minimum number of servers needed for
steady state to exist?
(b) What is the optimum number of servers needed to
minimize the expected cost per hr?
(c) If the service station charges Rs. 20/- from each served
customer (irrespective of the time devoted to serving
him), what is the optimum number of servers needed to
maximize the per hr net revenue of the service station?
Solution: Solution We have a (M/M/s) : (FCFS//) model
with = 15, = 10, =1.5
Thus for steady state to exist we must have < s
or s 2.
Case (i) s = 2.
1 9 48
P0 , Lq , L .
7 38 14
Expected Total cost per hour = 10 L + 4s =42.28.
Case (ii) s=3.
Expected Total cost per hour=10*66/38+4*3=29.36

Case (ii) s 4.
Expected Total cost per hour 31.
Thus optimum number of servers =3.
Problem 6: Arrival rate of telephone calls at a telephone booth
is according to Poisson distribution, with an average time of 9
minutes between two consecutive arrivals. The length of a
telephone call is assumed to be exponentially distributed with
mean 3 minutes.

(a) Determine the probability that a person arriving at the


booth will have to wait.

(b) Find the average queue length that forms from time to time.

(c) Find the fraction of a day that the phone will be in use.

Ans. (a) 0.33,(b) 0.166, (c) 0.33


Problem 7. In a clinic, patients arrive in Poisson
pattern at an average rate of 15 patients per hour.
The waiting room can accommodate maximum 14
patients. If the doctor takes on an average 6
minutes per patient and assuming exponential
service time, find
(i) the effective arrival rate.
(ii) the probability that an arriving patient will not wait.
(iii) the probability that an arriving patient will find a
vacant seat.
Solution 7.
We have (M/M/1) : (FCFS/15/) with
= 15, = 10, =1.5 .
(i) the effective arrival rate=15(1- P1 5 ).

(i) P0 .

(iii) P ( n 1 4 ) 1 P1 5 .
Problem 8. In a car repairing shop, there are two
mechanics for repairing the cars. The cars come in
a Poisson pattern on an average 3 cars per day.
The service time for any mechanic is exponentially
distributed with mean 4 hours. Assuming 8 hours
working day, find
(a) the hours of the day for which all the mechanics
are busy.
(b) the probabilities that both the mechanics are idle,
one mechanic is idle.
(c) the expected number of cars in the queue.
(d) the expected waiting time of a car in queue.
Solution 8.
We have (M/M/2) : (FCFS/ /) with
= 3, = 2 per day and =1.5 .
(a) P ( n 2 ) 1 P 0 P1 .
(b) P(both the mechanics are idle)= P 0 .
P1
P(one mechanic is idle)= P 0 .
2
(c) the expected number of cars in the queue= L q .

(d) the expected waiting time of a car in queue= W q


Problem 9: Problem VII.15 Page 7.73

Trucks arrive at a service station in a Poisson


process at a rate of 10 per hour. The service station
has two servers in parallel, each with a mean
service rate of 10 trucks per hour. Service times are
exponential. There is space for only two trucks
being served and for two in waiting. If all spaces are
filled up, the trucks will go to another service station.
(a) (i) What is the expected number of trucks in the
system?
(ii) What fraction of customers are lost?
(iii) What is the per hour effective arrival rate of the
service station?
(b) Answer all the four questions above if 3 spaces are
provided for waiting.
(c) If the provision of the third waiting space costs a
rental of Rs. 5/- per hour and if the revenue from the
service of a truck is Rs. 10/-, will the provision of the
3rd waiting space be profitable for the service station?
Solution: We thus have a (M/M/2):(FCFS/4/) model
with = 10 per hour and = 10 per hour.
Thus = 1.

1 1 8
P0 2 3 4

1 1 1 23
1 11
2! 2! 2 2! 4 2 4 8

P1= P0 = P0 =8/23, P2= 2P0/2 =4/23,


P3= 3P0/4 =2/23, P4 = 4P0/8 = 1/23
(i) L = P1+ 2 P2 + 3 P3 + 4 P4 = 26/23

(ii) Fraction of customers lost = P4 = 1/23


(iii) Effective arrival rate =(1- P4) = 220/23=9.57

(b) If there is one more waiting space, then we have a


(M/M/2):(FCFS/5/) model.

1 1 16
P0 2 3 4 5

1 1 1 1 47
1 11
2! 2! 2 2! 4 2!8 2 4 8 16
P1= P0 = P0 =16/47, P2= 2P0/2 =8/47,
P3= 3P0/4 =4/47, P4 = 4P0/8 = 2/47, P5 =1/47.
460
L=57/47, (1 P5 ) 9.79.
47

c) Extra trucks serviced per hour by providing extra


waiting space = 9.79-9.57 = 0.22.
The extra revenue earned per hour = Rs. 2.2 which is
less than the rental cost Rs. 5.00
Thus, the new arrangement is not profitable to the
company.
Problem 10: VII.14
A factory has 4 machines. The time until
breakdown of a machine is exponential with
mean 10 hours. The time to repair a machine
is exponential with mean 5 hours. A repairman
costs Rs. 15/- per hour. The cost of lost time of
an inoperative machine is Rs. 30/- per hour per
machine. Should the factory hire one
repairman or two repairmen? Justify.
Solution: This is a machine repair model with K
= 4, = 1/10, = 1/5. Thus =1/2.
Case (i) s=1
n = (4-n) , n =0, 1, 2, 3 and 0 elsewhere.
n = , n = 1, 2,
P1 = 4 P0 = 2 P0, P2 = 122 P0 = 3 P0
P3 = 243 P0 = 3 P0, P4 = 244 P0 = 3/2P0

2 4 6 6 3
P0 , P1 , P2 , P3 , P4 .
21 21 21 21 21
L= P1+2P2+3P3+4P4 = 46/21 and
the expected cost for the firm = 30 L+15=80.71

Case (ii) s=2.


n = (4-n) , n =0, 1, 2, 3 and 0 elsewhere.
1 = and n = 2 for n = 2,3,
P1 = 4 P0 = 2 P0, P2 = 62 P0 = 3/2 P0
P3 = 63 P0 = 3/4 P0, P4 = 34 P0 = 3/8P0
1 8 8
P0
3 3 3 8161263 45
12
2 4 8
and
16 12 6 3
P1 , P2 , P3 , P4 .
45 45 45 45
L=14/9 and
the expected cost for the firm=30L+30=76.67
Thus the firm will hire two repairmen.
Problem VII.8 (Page 7.71)
A bank has two tellers working on savings accounts. The first teller handles
withdrawals only and the second teller handles deposits only. The service time for
both deposits and withdrawals are exponential with mean 3 minutes per customer.
Depositors arrive in a Poisson fashion with a mean rate of 16 per hour, while
withdrawers arrive in a Poisson fashion with a mean rate of 14 per hour. What would
be the effect on the average waiting time in the system for depositors and withdrawers
if each teller could handle both deposits and withdrawals? What would be the effect if
this could be accomplished only by increasing the mean service time to 3.5 minutes?

Solution
Withdrawals Deposits W/D & DEP W/D&DEP
14 16 30 30
20 20 20 120/7
7/10 4/5 3/2 7/4
P0 3/10 1/5 1/7 1/15
Lq 49/30 16/5 27/14 343/60
L 7/3 4 24/7 112/15
W 1/6 1/4 4/35 112/450
=10 mts = 15 mts = 6.86 mts =14.93 mts

Vous aimerez peut-être aussi