0% found this document useful (0 votes)
46 views85 pages

Lec - 05 Queuing Theory

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views85 pages

Lec - 05 Queuing Theory

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 85

Queuing Theory

Kazi Saeed Alam


Lecturer, Dept. of CSE, KUET
Courtesy: Prof. Dr. Sk. Md. Masudul Ahsan

1
Queuing System
 Waiting for service is part of our daily life. We queue up for
 Bus, check out counter etc.

 Not only for human, jobs wait to be processed on a machine


 Study of queue quantifies the phenomenon of waiting lines using
 Average queue length, average waiting time, average facility utilization
 Thereby reduce the adverse impact of waiting to tolerable levels

2
Queuing System
 A queuing system is a facility consisting of one or several servers designed to perform
certain tasks or process certain jobs and a queue of jobs waiting to be processed.
 Examples of queuing systems are:
 a shared computer executing tasks sent by its users;
 an internet service provider whose customers connect to the internet, browse, and disconnect;
 a printer processing jobs sent to it from different computers;
 a medical office serving patients; and so on.

3
Queuing System
 Main components

4
Queuing System - Input process
 Usually called the arrival process.
 Arrivals are called customers.
 We assume that no more than one arrival can occur at a given instant.
 If more than one arrival can occur at a given instant, we say that bulk arrivals are
allowed.
 Models in which arrivals are drawn from a small population are called finite source
models.
 If a customer arrives but fails to enter the system, we say that the customer has balked.

5
Queuing System - Output process
 To describe the output process of a queuing system, we usually specify a probability
distribution – the service time distribution – which governs a customer’s service time.
 Two arrangements of servers:
 Servers are in parallel if all server provide the same type of service and a customer need only
pass through one server to complete service.
 Servers are in series if a customer must pass through several servers before completing service.

6
Queuing System - Queue discipline
 Describes the method used to determine the order in which customers are served.
 The most common - FCFS discipline (first come, first served), served in order of their
arrival.
 LCFS discipline (last come, first served), the most recent arrivals are the first to enter
service.
 Customer is randomly chosen from waiting line - SIRO discipline (service in random
order).
 Priority queuing disciplines - classifies each arrival into one of several categories.
 Each category is then given a priority level, and within each priority level served on an FCFS
basis.

7
Modeling Arrival Processes
 We define ti to be the time at which the ith customer arrives.
 we define Ti = ti+1 - ti to be the ith interarrival time.
 In modeling the arrival process we assume that the Ti’s are independent, continuous random
variables described by A having a density function a(t).
 The assumption that each interarrival time is governed by the same random variable implies
that the distribution of arrivals is independent of the time of day or the day of the week.
 This is the assumption of stationary interarrival times.
 Stationary-(whose distribution characteristics do not change over time)

8
Modeling Arrival Processes
 The independence assumption means, for example, that the value of T 2 has no effect on the
value of T3, T4, or any later Ti
 Stationary interarrival ties is often unrealistic, but we may often approximate reality by
breaking the time of day into segments.
 A negative interarrival time is impossible. This allows us to write
c 
P(A  c)   a (t )dt and P(A  c)   a (t )dt
0 c

 We define λ to be the arrival rate or units of arrivals per hour


 So, 1/λ to be the mean or average interarrival time or units of hours per arrival.

1
=∫ 𝑡𝑎( 𝑡 ) 𝑑𝑡
𝜆 0

9
Modeling Arrival Processes
 How to choose A - to reflect reality and still be computationally tractable.
 The most common choice for A is the exponential distribution.
 An exponential distribution with parameter λ has a density
a(t) = λe-λt.
 We can show that the average or mean by
1
E (A) 

 And Variance by
1
var A 
2

10
Modeling Arrival Processes
 Lemma 1: If A has an exponential distribution, then for all nonnegative values of t and
h,

P ( A  t  h | A  t )  P ( A  h) (5)

 For example, if h=4, then (5) yields, for t=5, t=3, t=2, and t=0

 For reasons that become apparent, a density that satisfies the equation is said to have the
no-memory property.
 The no-memory property of the exponential distribution is important because it implies
that if we want to know the probability distribution of the time until the next arrival,
then it does not matter how long it has been since the last arrival.
11
Modeling the Service Process
 We assume that the service times of different customers are independent random variables and that each
customer’s service time is governed by a random variable S having a density function s(t).
 We let 1/µ be then mean service time for a customer.
 so µ is service rate.
 As with interarrival times, we hope that service times can be accurately modeled as exponential random
variables

 Unfortunately, actual service times may not be consistent with the no-memory property.
 For this reason, we often assume that s(t) is an Erlang distribution with shape parameters k and rate
parameter μ.

The Erlang distribution was developed by A. K. Erlang to examine the


number of telephone calls which might be made at the same time to the
operators of the switching stations.
12
The Kendall-Lee Notation for Queuing Systems
 Standard notation used to describe many queuing systems.
 The notation is used to describe a queuing system in which all arrivals wait in a single
line until one of s identical parallel servers id free. Then the first customer in line enters
service, and so on.
 To describe such a queuing system, Kendall devised the following notation.
 Each queuing system is described by six characters:
1/2/3/4/5/6

14
The Kendall-Lee Notation for Queuing Systems
 The first characteristic specifies the nature of the arrival process. The following
standard abbreviations are used:
M = Interarrival times are independent, identically distributed (iid) having an exponential
distribution.
D = Interarrival times are iid and deterministic
Ek = Interarrival times are iid Erlangs with shape parameter k.
GI = Interarrival times are iid and governed by some general distribution

15
The Kendall-Lee Notation for Queuing Systems
 The second characteristic specifies the nature of the service times:
M = Service times are iid and exponentially distributed
D = Service times are iid and deterministic
Ek = Service times are iid Erlangs with shape parameter k.
G = Service times are iid and governed by some general distribution

16
The Kendall-Lee Notation for Queuing Systems
 The third characteristic is the number of parallel servers.
 The fourth characteristic describes the queue discipline:
 FCFS = First come, first served
 LCFS = Last come, first served
 SIRO = Service in random order
 The fifth characteristic specifies the maximum allowable number of customers in the
system.
 The sixth characteristic gives the size of the population from which customers are
drawn.

17
The Kendall-Lee Notation for Queuing Systems
 In many important models 4/5/6 is GD/∞/∞. If this is the case, then 4/5/6 is often
omitted.
 M/E2/4/FCFS/10/∞
 might represent a health clinic with 4 doctors,
 exponential interarrival times,
 two-phase Erlang service times,
 an FCFS queue discipline, and
 a total capacity of 10 patients.

18
Birth-Death Processes

19
Birth-Death Processes
 We will use it to answer questions about several different types of queuing systems.
 Number of people present in any queuing system at time t to be the state of the queuing
systems at time t.
 We call πj the steady state, or equilibrium probability, of state j.
 The behavior of Pij(t) before the steady state is reached is called the transient behavior of the
queuing system.
 A birth-death process is a continuous-time stochastic process for which the system’s state at
any time is a nonnegative integer.

Pij(t) = transition probability that the system is in state j at time t starting from state i, at t=0

Pij(t) =the probability that j people will be present in the queuing system at time
t, given that at time 0, i people are present
20
Birth-Death Processes
You may think it like DTMC, but better not to These are transition
probability
1-1-1 1-2-2 1-j - j
1-0
0 1 2 j-1 j
0 1 2 …. j ….
1 2 3 j j+1
These are transition
Sometimes, simplified to the following one rate in BD process

0 1 2 j-2 j-1 j j+1

0 1 2 …. 0
j-1 j j+1 ….
1 2 3 j-1 j j+1

21
Laws of Motion for Birth-Death
 Law 1
 With probability λjΔt+o(Δt), a birth occurs between time t and time t+Δt.
 A birth increases the system state by 1, to j+1.
 The variable λj is called the instantaneous birth rate in state j.
 In most queuing systems, a birth is simply an arrival.
 Law 2
 With probability µjΔt+o(Δt), a death occurs between time t and time t + Δt. A death decreases the
system state by 1, to j-1.
 The variable µj is the death rate in state j.
 In most queuing systems, a death is a service completion.
 Note that µ0 = 0 must hold, or a negative state could occur.
 Law 3
 Births and deaths are independent of each other.
22
Birth-Death Processes
 M/M/1/FCFS/∞/∞ queuing system in which interarrival times are exponential with parameter λ and
service times are exponentially distributed with parameter μ.
 If the state (number of people present) at time t is j, then the no-memory property of the exponential
distribution implies that the probability of a birth during the time interval [t,t+ Δt] will not depend on
how long the system has been in state j.
 Thus, may be determined as if an arrival had just occurred at time t.
 Then the probability of a birth occurring during [t,t+ Δt] is

23
M/M/1/FCFS/∞/∞ queuing system

24
M/M/3/FCFS/∞/∞ queuing system
 Interarrival times are exponential with λ = 4 and service times are exponential with μ=5.

• If either interarrival times or service times are nonexponential, then the birth–death
process model is not appropriate.
• Suppose, for example, that service times are not exponential, and we are
considering an M/G/1/FCFS/∞/∞ queuing system.
• Since the service times for an M/G/1/FCFS/∞/∞ system may be nonexponential,
the probability that a death (service completion) occurs between t and t+ Δt will
depend on the time since the last service completion.
• This violates law 2, so we cannot model an M/G/1/FCFS/∞/∞ system as a birth–
death process.
25
Birth-Death Processes
0 1 2 j-2 j-1 j j+1

0 1 2 …. 0
j-1 j j+1 ….
1 2 3 j-1 j j+1

For a continuous Markov chain which is currently in state i, the probability


that the chain will leave state i and go to state j(j ≠ i) in the next infinitesimal
amount of time ∆t, no matter how long the chain has been in state i, is
Pij (t  t )  qij t  o(t )
Or simply
Pij (t  t )  qij t

qij is the instantaneous transition rate of leaving state i for state j

26
Birth-Death Processes – steady state probabilities
0 1 2 j-2 j-1 j j+1

0 1 2 …. 0
j-1 j j+1 ….
1 2 3 j-1 j j+1

we define j(t) = P[X(t) = j] the chain in a particular state at time t

probability change in an infinitesimal amount of time t


 j (t  t )   j 1 (t )( j 1t )   j 1 (t )(  j 1t )  j (t )(1   j t   j t )

probability that the system will be


in state j - 1 at time t and transit to j at time t +t =  j 1 (t )( j 1t )
in state j + 1 at time t and transit to j at time t +t =  j 1 (t )(  j 1t )

in state j at time t and doesn’t leave j at time t +t =  j (t )(1   j t   j t ) 27


Birth-Death Processes – steady state probabilities
0 1 2 j-2 j-1 j j+1

0 1 2 …. 0
j-1 j j+1 ….
1 2 3 j-1 j j+1

 j (t  t )   j 1 (t )( j 1t )   j 1 (t )(  j 1t )  j (t )(1   j t   j t )

 j (t  t )   j (t )  t  j 1 (t ) j 1   j 1 (t )  j 1   j (t )( j   j ) 

dividing by ∆t and taking limits,


  j (t )   j 1 (t ) j 1   j 1 (t )  j 1   j (t )( j   j )
 ( t t )  ( t )
lim j
t
j

t  0

For j=0,  1 (t ) 1   0 (t )0  0

28
Steady-State Probabilities for Birth-Death Processes

For t,  j (t )  0
called steady state probability

 j 1 j 1   j 1 j 1   j ( j   j ) ( j  1,2,...) Notice the simplified


notion
For j=0,  11   0 0

 The above equations are often called the flow balance equations, or conservation of flow
equations, for a birth-death process.

 j 1 j 1   j 1 j 1 = Expected no. of entrances into state j


 j ( j   j ) = Expected no. of departures from state j
29
Solution of Balance Eq.
 We obtain the flow balance equations for a birth-death process:

0 1 2 j-2 j-1 j j+1

0 1 2 …. 0
j-1 j j+1 ….
1 2 3 j-1 j j+1

( j  0)  0 0   11
( j  1) (1  1 ) 1  0 0   2 2
( j  2) (2   2 ) 2  1 1   3 3

( jth equation ) ( j   j ) j   j 1 j 1   j 1 j 1

30
Solution of Balance Eq.
0
j0 1  1 0
1 1 0 1
j 1 2  2  1  1 ( 1 1  0 0 ) 
2 2 1  1 2 0
2 2 0 12
j2 3  3  2  1 (  2 2  1 1 ) 
3 3 2  1 2  3 0
:
0 12 ... j 1
j  j 1 j  1 2  3 ...  j 0
0 12 ... j 1
let C j  1 2  3 ...  j for j  1, 2, 3, ... and C j  1 for j  0 then
 j  C j 0 for j  0, 1, 2, ...

The requirement is that


   
 j 1    C j  0  1
j 0  j 0 
31
Solution of Balance Eq.
j 
 If  c
j 0 j is finite, we can solve for π0:
1 1
0  j 
 j 

c
j 0
j 1  c j
j 1

It can be shown that if  j 1 c jis infinite, then no steady-state distribution exists.


j 

 The most common reason for a steady-state failing to exist is that the arrival rate is at
least as large as the maximum rate at which customers can be served.

32
Solution of Balance Eq.
0
j0 1  1 0
1 1 0 1
j 1 2  2  1  1 ( 1 1  0 0 )
2
 2 1  1 2 0
2 2 0 12
j2 3  3  2  1 ( 2 2  1 1 )
3
 3 2  1 2  3 0
:
0 12 ... j 1
j  j 1 j  12 3 ...  j 0

Another way of writing flow balance eqn

for j  0,1, 2,...


 j  j   j 1 j 1

33
Flow balance Eqn of B-D process
 Global eqn
 j 1 j 1   j 1 j 1   j ( j   j )
for j  1, 2,...


for j  0,1, 2,...
Local eq n
 j  j   j 1 j 1

34
Birth Death Process - Summary
0 1 2 j-2 j-1 j j+1

0 1 2 …. 0
j-1 j j+1 ….
1 2 3 j-1 j j+1

 j 1 j 1   j 1 j 1   j ( j   j ) ( j  1,2,...)

 11   0 0

 j  C j 0 for j0
1

1 for j  0  j 

C j   012 ... j 1
for j  0  0    C j 

 1 2 3 ... j  j 0 

35
M/M/1 Queuing System

36
M/M/1/GD/∞/∞ Queuing System
      

0 1 2 …. 0
j-1 j j+1 ….
     

Here, j =  j= 0, 1, 2, … Be remember
0 = 0 • State represents no.
j =  j= 1, 2, … of customer in the q

Let, the traffic intensity be  =  / and 0 ≤  < 1

0 12 ... j 1 j
Cj  1 2  3 ...  j
 j  j

for j0

37
M/M/1/GD/∞/∞ Queuing System
      

0 1 2 …. 0
j-1 j j+1 ….
     

1 1
   
 
j  j  1
 0    C j 
     j

  1      ...    ...
2 j

 j 0   j 0 

   1 1
1   1 
 j   (1   )
j

If  ≥ 1, the infinite sum “blows up”, thus, no steady-state distribution exists.

So, rest of this section, we assume  < 1, 38


M/M/1/GD/∞/∞ Queuing System
 The steady state parameters we are interested in
 L = average number of customers in the queuing system
 Lq = expected no. of customers waiting in the queue
 LS = expected no. of customers in service
= average number of busy server = s
 L = Lq + LS

39
M/M/1/GD/∞/∞ Queuing System
 The steady state parameters we are interested in
 W = average time a customer spends in the system
= average response time
 Wq = average time a customer spends in line
 Ws = average time a customer spends in service
 W = Wq +Ws
Little’s Queuing Formula L = eff W

 For any queuing system in which a steady-state distribution exists, the following relations hold:
L = λW
Lq = λWq
Ls = λWs

 Utilization = s/s
40
M/M/1/GD/∞/∞ Queuing System
 Derivation of L
 We know that E(X) = [x f(x)] and P(X=x) =f(x)
 X = no. of customer in the system during steady state
 X can have values j = 0, 1, 2, … with probability 
j

j  j 
L  E ( X )   j j   j j (1   )
j 0 j 0
j  j 
 (1   )  j  (1   )   j j 1
j

j 0 j 0

j 
 j 

 (1   )   dd   (1   )  d      (1   ) 
j d  j d
 
1
d 1 
j 0  j 0 
 
 (1   )  (11 ) 2  
1   
41
M/M/1/GD/∞/∞ Queuing System
 Derivation of L
 Another way
j  j 
L   j j   j j (1   )
j 0 j 0
j 
 (1   )  j j  (1   ) S 
j 0

 
 
1   

L  1
 avg. service time
W  1
 
 1  1  proba. of idle
1

  42
M/M/1/GD/∞/∞ Queuing System
 Derivation of Lq
 Let, the system in state j=0,1,2,… with probability j
 i.e. there are j customer in the system now
 Since only 1 server, there are j-1 customer is waiting in queue
j  j  j  j 
Lq   ( j  1) j   j j    j   j j  (1   0 )
j 1 j 1 j 1 j 0
 L
  2
 2 Lq  2

Lq     Wq    1 
1  1   (   )  1    (1   )


 (   )

43
M/M/1/GD/∞/∞ Queuing System
 Derivation of LS

Ls  0 0  1( 1   2  )  1   0 1  (1   )   = s
 1
Ls
Ws   
  
If we already know L and Lq
 2  (1   )
Ls  L  Lq     = s
1  1  1 

If we already know L and LS


 2
Lq  L  Ls  
1  1  44
M/M/1/GD/∞/∞ Queuing System

45
M/M/1/GD/∞/∞ Queuing System

46
M/M/1/GD/∞/∞ Queuing System
 Example 4 (Winston)
 Suppose that all car owners fill up when their tanks are exactly half full.
 At the present time, an average of 7.5 customers per hour arrive at a single-pump gas
station.
 It takes an average of 4 minutes to service a car.
 Assume that interarrival and service times are both exponential.
1. What is the probability that the teller is idle?
2. For the present situation, compute L , Lq and W, Wq.

47
M/M/1/GD/∞/∞ Queuing System
3. Suppose that a gas shortage occurs and panic buying takes place.
– To model the phenomenon, suppose that all car owners now purchase gas when their tank are
exactly three quarters full.
– Since each car owner is now putting less gas into the tank during each visit to the station, we
assume that the average service time has been reduced to 3 minutes.
– How has panic buying affected L and W?

48
Solutions
 We have an M/M/1/GD/∞/∞ system with
λ = 7.5 cars per hour µ = 60/4=15 cars per hour.
 = 7.5/15 = 0.5
1. Idle probability 0 = 1   = 0.5

2. L = /(1  )= 0.5/(1  0.5) = 1,


W = L/λ = 1/7.5 = 0.13 hour = 8 mins.

Lq = 2/(1- )= 0.25/(1  0.5) = 0.5


Wq = Lq/λ = 0.5/7.5 =1/15 hr = 4 mins.

 Hence, in this situation, everything is under control, and long lines appear to be unlikely.
49
Solutions
3. We now have an M/M/1/GD/∞/∞ system with
λ = 2*7.5 =15 cars per hour
µ = 60*3/10=18 cars per hour.
 = 15/18 =5/6
5
6 L 5 1
L  5 cars and W    hours  20minutes
1
5  15 3
6

Lq 
 6
5 2 Lq
 cars and Wq  
25 25 5
 hours  16.67 minutes
1
5 6  6 *15 18
6
 Thus, panic buying has cause long lines.
50
M/M/s Queuing System

51
M/M/s/GD/ ∞ /∞ Queuing System
      

0 1 2 …. 0
s-1 s s+1 ….
 2 3 (s-1) s s

Here, j =  j= 0, 1, 2, …
Let, the traffic intensity be
j = j j= 0, 1, 2, …,s
 =  /(s) and 0 ≤  < 1
j = s j= s+1, s+2, …
0 12 ... j 1 If j<=s customers are present,
Cj  1 2  3 ...  j
then all j customers are in
service; if j>s customers are
present, then all s servers are
j ( s ) j occupied, and j-s customers are
  for j  s
 (2  )(3 )...( j ) j! waiting in line.
𝑗
𝜆
¿ =¿ ¿
𝜇( 2 𝜇 )(3 𝜇) ... ( 𝑠 𝜇)( 𝑠 𝜇) ... (𝑠 𝜇) 52
M/M/s/GD/∞/∞ Queuing System

( ¿
) ¿¿
𝑗 =∞ −1
𝜋 0= ∑ 𝐶𝑗
𝑗=0

¿¿¿ 𝜋 0=¿ ¿
If  ≥ 1, the infinite sum “blows up”, thus, no steady-state exists.
53
M/M/s/GD/∞/∞ Queuing System
steady-state probability that all servers are busy or delay probability


Pd = 𝑃(𝑗≥𝑠)=∑ 𝜋 𝑗
Most of the parameters of interest can be
expressed in terms of this probability.

Pd =

𝑗= 𝑠
54
M/M/s/GD/∞/∞ Queuing System

• As the probability mass function j consists of two functions


• it is easier to first find Lq, the number of customers waiting in the queue, instead of L
so that the discontinuity in pmf can be avoided:

55
M/M/s/GD/∞/∞ Queuing System

∞ ∞
𝐿𝑞=∑ ( 𝑗−𝑠)𝜋 𝑗=¿∑ 𝑛𝜋𝑠+𝑛 [𝑡𝑎𝑘𝑖𝑛𝑔, 𝑗−𝑠=𝑛]¿
steady-state probability that all servers are busy also
called delay probability

Pd =

The time spent in the waiting queue:

Lq
Pd
Wq  

𝑗= 𝑠 𝑛=0
 s  

56
M/M/s/GD/∞/∞ Queuing System

Since Ws = L s =
= s = average number of busy servers, s’

The number of customers in the The time spends in the queueing


queueing system: system:

(s )s 
 0  s
s! (1   ) 2


 Pd  s 
1 
57
M/M/s/GD/∞/∞ Queuing System
15.6-5 Taha

58
M/M/s/GD/∞/∞ Queuing System
As M/M/2 system

=8  = 60/12 = 5 s=2  = /s= 0.8

𝜋 0=¿ ¿
𝑊 𝑞 = 𝐿𝑞 / 

𝐿𝑞 =¿ ¿
Lq 
( 2 * 0.8) 2 1
* *
0 .8 𝜋 0= ¿ ¿
2! 9 (1  0.8) 2
1.28
 * 20  2.844
9
Wq  Lq / 8  0.356hr  21.33 min
59
M/M/s/GD/∞/∞ Queuing System
As M/M/4 system
 = 2*8=16  = 60/12 = 5 s = 2*2  = /s= 0.8

1
4 1 j
( 4 * 0.8) ( 4 * 0.8) 
4
 0     

 j  0 j! 4! (1  0.8) 
1
 3.2 2
3.2 3
(3.2) 4


 1  3.2    
 2 6 4.8 
 1  3.2  5.12  5.46133  21.8453
1

 1 / 36.62666  0.0273

60
M/M/s/GD/∞/∞ Queuing System
As M/M/4 system
 = 2*8=16  = 60/12 = 5 s = 2*2  = /s= 0.8

( 4 * 0.8) 4 0.8
Lq  * 0.027 *
4! (1  0.8) 2
 4.369 * 0.0273 * 20  2.386
Wq  Lq / 16  0.149hr  8.95 min

61
M/M/s/GD/∞/∞ Queuing System
9.22 Rama murthy
Ships arrive at a port at the rate of one in every 4 hours
with exponential distribution of inter arrival times. The
time a ship occupies a berth for unloading has
exponential distribution with an average of 10 hours. If
the average delay of ships waiting for berths is to be
kept below 14 hours, how many berths should be provided
at the port?

62
M/M/s/GD/∞/∞ Queuing System

aren’t

63
Waiting Time Distribution of M/M/s/FCFS// 
 In addition to a customer’s expected time in the system, the distribution of a
customer’s waiting time is of interest.
 For example, if all customers who have to wait more than 5 minutes at a
supermarket checkout counter decide to switch to another store, the probability
that a given customer will switch to another store equals P(W > 5).
 To determine this probability, we need to know the distribution of a
customer’s waiting time.

64
Waiting Time Distribution of M/M/s/FCFS// 
 Average waiting time Wq is independent of queue discipline
 But the probability distribution is not
 For FCFS queue with s=1
 System waiting time distribution : exponential with parameter  - 

And
 Queue waiting time distribution
𝑤𝑞 (𝑡)=1 − 𝜌 , 𝑡=0
− ( 𝜇− 𝜆 ) 𝑡
𝑤𝑞 (𝑡)=𝜌 ( 𝜇− 𝜆 ) 𝑒 , 𝑡>0

65
Waiting Time Distribution of M/M/s/FCFS// 
 For FCFS queue with s=1
W
P (t  W )  1   w(t ) dt For M/M/1
0
 
W L 
 1   (    )e (   ) t dt 1   
0 L 1
W 
  
 1  1  e  (    )W

 e 1  0.368
About 37% customer wait longer
than average waiting time

66
Waiting Time Distribution of M/M/s/FCFS// 
 For FCFS queue with s=1
 Gas buying : probability of waiting more than 4 min in queue, where λ = 7.5 cars per
hour µ = 60/4=15
4
P (t  Wq  4)  1   wq (t ) dt
0
4
 1    (    )e (   ) t dt
0

 1  0.51  e  ( 7.5) 4 
 0.5

67
Waiting Time Distribution of M/M/s/FCFS// 
 For FCFS queue with s

68
M/M/1/GD/n/∞ Queuing System

69
M/M/1/GD/ n /∞ Queuing System
    

0 1 2 …. 0
n-1 n
    

Here, j =  j= 0, 1, 2, …n-1
Let, the traffic intensity
n = 0 be  =  / and   0
0 = 0
j =  j= 1, 2, …,n
𝜆 0 𝜆1 𝜆2 ... 𝜆 𝑗 −1
𝐶 𝑗=
𝜇 1 𝜇 2 𝜇3 ...𝜇 𝑗
=𝜌
𝑗
𝑓𝑜𝑟 𝑗=0 , 1 ,... , 𝑛
The M/M/1/GD/n/∞ system is identical to the M/M/1/GD/∞/∞ system
except for the fact that when n customers are present, all arrivals
are turned away and are forever lost to the system.
70
M/M/1/GD/n/∞ Queuing System
1 1
 j n
 j n

 0    C j 
 j 0 
   
 j 0
j




 1      ...  
2

n 1

  
 n1 1
 1
1

1 
1   n 1
for   1

1
0  for   1
n 1

 j   j 0 𝑓𝑜𝑟 𝑗=1 , ... ,𝑛 and 𝑓𝑜𝑟 𝑎𝑛𝑦 𝜌

Saturation probability 1  n 1
When j=n n   , 𝑓𝑜𝑟 𝜌≠ 1 or  n  , 𝑓𝑜𝑟 𝜌= 1
1  n 1
n 1 71
M/M/1/GD/n/∞ Queuing System
j n
1   j n j
L j j  n 1 
j
1   j 0 j n
S   j j    2  2  ...  n n
j 0

1  j 0
 S
1  n 1
S   2  2  3  ...  n n 1
[1  (n  1)  n  n n 1 ]
 for   1
1   n1 1    S  S     2   3  ...   n  n n 1
1   n 1
  (1  n n 1 )
1 
1   n 1  1    n n 1  n n  2

1 
𝑗 =𝑛
𝑛 [1  (n  1)  n  n n 1 ]
𝐿= ∑ for   1 (verify)
¿𝑗 𝜋
2𝑗

1 
𝑗 =0
72
M/M/1/GD/n/∞ Queuing System
 Derivation of LS

or 1
𝜋 0=
𝑛+1
Lq  L  Ls

73
M/M/1/GD/n/∞ Queuing System
arrivals
lost   n
𝜆 Net eff    lost   (1   n )
𝜆 𝑒𝑓𝑓 departure

lost   n    eff L
W
eff
Rejected
arrivals
Lq
Wq 
eff
Ls
Ws 
eff

74
M/M/1/GD/n/∞ Queuing System - Example
 A car wash facility with single bay for wash and 4 parking space, arrival rate = 4 /
hr, service time = 10 min / car, all are exponential [Taha Problem 15.6D]
 Determine the following

 Here
4  6   2 / 3  0.667
n  4 1  5

1  1 1 243
 (a) 0   3
 3
  0.3654135
1  n 1
1  36
64 665
36
665
75
M/M/1/GD/n/∞ Queuing System - Example

(b) [1  (n  1)  n  n n 1 ] 0.432556


L   1.422556
1   1   
n 1
0.3040695

Ls  1   0  0.6345865 Lq  L  Ls  0.7879695

 n   n 0   5  (2 / 3) 5 * 0.3654135  0.04812 (d)

Lq
eff   (1   5 )  3.80752 Wq   0.207 hr  12.42 min
eff

(c) Expected empty parking spaces = 4  Lq = 3.212


76
M/G/1/GD// Queuing System

77
M/G/1/GD// 
 interarrival times are exponential, let  be the arrival rate
 but the service time distribution (S) is not
 Let, 1/ = E(S) and 2 = var(S)
 It is not a birth–death process
 because the probability that a service completion occurs between t and t+Δt when the
state of the system at time t is j depends on the length of time since the last service
completion.
 Determination of the steady-state probabilities for M/G/1/GD/∞/∞ queuing system is a
difficult matter.
 Fortunately, however, utilizing the results of Pollaczek and Khinchin, we may determine
Lq, L, Ls, Wq, W, Ws.

78
M/G/1/GD// 
 Pollaczek and Khinchin showed that for the M/G/1/GD/∞/∞ queuing system,

 
2 2 2
Wq 
Lq
Lq 
2(1   ) 
1
L  Lq   W  Wq 

 It can also be shown that π0 = 1  .
 The result is similar to the one for the M/M/1/GD/∞/∞ system.

79
M/G/1/GD// 
 consider an M/M/1/GD/∞/∞ system with =5 customers per hour and  = 8 customers
per hour
Considering it as a M/G/1 system
E(S) =1/ = 1/8
2 = 1/2 =1/64 [since S is exponential]
M/G/1/GD// 
 Erlang Distribution is a two parameter family of continuous probability distributions with
support x ∈ [ 0 , ∞ )
 The two parameters are:
 a positive integer k the "shape", and
 a positive real number λ , the "rate". The "scale", μ , the reciprocal of the rate, is sometimes used instead.
 It is a special case of the Gamma distribution.
 The probability density function is

Or

81
M/G/1/GD// 
 Erlang Distribution
 Mean: k / λ.
 Variance: k / λ2.

 Erlang distribution with k = 1 simplifies to exponential distribution.

 Consider an M/G/1/GD/∞/∞ queuing system in which an average of 10 arrivals occur each


hour. Suppose that each customer’s service time follows an Erlang distribution, with rate
parameter 1 customer per minute and shape parameter 4. [ Winston page 1098]
a) Find the expected number of customers waiting in line.
b) Find the expected time that a customer will spend in the system.
c) What fraction of the time will the server be idle?

82
M/G/1/GD// 
𝑘=
Since, service time distribution is Erlang with4 𝜆 s=1 / min¿ 60/ h 𝑟

𝑘 4 1 1
𝑚𝑒𝑎𝑛 𝑠𝑒𝑟𝑣𝑖𝑐𝑒 𝑡𝑖𝑚𝑒= = h𝑟= h𝑟=4min= Mean service
𝜆𝑠 60 15 𝜇 fx
rate

0.25

0.2

0.15

0.1

0.05

0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15 83
M/G/1/GD// 
a) Find the expected number of customers waiting in line.
b) Find the expected time that a customer will spend in the system.
c) What fraction of the time will the server be idle?
arrival rate   10 / hr
service rate   60 / 4  15 / hr
  2/3 L  Lq    5 / 6  2 / 3

Lq 
2 2   2  3 / 2 cust
2(1   )
W  L  3
20 hr  9 min
(10 / 30) 2  ( 2 3 ) 2

2
3
5 5
 9
 cust  0  1   1/ 3
2
3 6 84
M/D/1/GD// 
 consider an M/D/1/GD/∞/∞ system with =5 customers per hour and
 = 8 customers per hour
 E(S) =1/ = 1/8
 2 = 0 For M/M/1

2 ( 85 ) 2 25
Lq    customer
1   1  8 245

 a typical customer will spend only half as much time in


line as in an M/M/1/GD/∞/∞ queuing system with identical arrival
5
and service rates.

 even if mean service times are not decreased, a decrease in the


variability of service times can substantially reduce queue size and
customer waiting time 85
References
 Operations Research : Applications and Algorithms
Wayne L. Winston
 Operations Research An Introduction
Hamdy A. Taha

86

You might also like