Chapter 1

advertisement
Chapter 2
Simple Markovian Queuing
Model
CONTENTS
2.1
BIRTH-DEATH PROCESS ................................................................................ - 2 FLOW BALANCE PROCEDURE ........................................................................... - 4 2.2 SINGLE- SERVER QUEUES (M/M/1) ............................................................... - 5 2.2.1 SOLVING FOR {pn} USING AN ITERATIVE METHOD ............................. - 6 2.2.2 SOLVING FOR {pn} USING AN GENERATING FUNCTIONS ..................... - 7 2.2.3 SOLVING FOR {pn} USING OPERATORS................................................. - 8 2.2.4 MEASURES OF EFFECTIVENESS ......................................................... - 10 2.2.5 WAITING TIME DISTRIBUTION .......................................................... - 13 RELATION BETWEEN Wq AND Lq - LITTLE’S FORMULA.................................. - 16 2.3 MULTISERVER QUEUES (M/M/c) ................................................................. - 18 2.4
CHOOSING THE NUMBER OF SERVERS ......................................................... - 26 -
2.5
QUEUES WITH PARALLEL CHANNELS AND TRUNCATION (M/M/c/K) ......... - 31 -
2.6
ERLANG’S FORMULA (M/M/c/c) .................................................................. - 35 -
2.7
QUEUES WITH UNLIMITED SERVICE (M/M/∞) ........................................... - 37 -
2.8
FINITE SOURCE QUEUE M/M/c/∞//M ......................................................... - 39 -
2.9
STATE-DEPENDENT SERVICE ....................................................................... - 50 -
2.10 QUEUES WITH IMPATIENCE ......................................................................... - 54 2.10.1 M/M/1 BALKING ................................................................................ - 55 2.10.2 M/M/1 RENEGING.............................................................................. - 57 2.11 TRANSIENT BEHAVIOR ................................................................................. - 58 2.11.1 TRANSIENT BEHAVIOR OF M/M/1/1 .................................................. - 58 2.11.2 TRANSIENT BEHAVIOR OF M/M/1/∞ ................................................ - 59 2.11.3 TRANSIENT BEHAVIOR OF M/M/∞.................................................... - 64 2.12 BUSY PERIOD ANALYSIS FOR M/M/1 AND M/M/c ....................................... - 68 -
2.1 BIRTH-DEATH PROCESS
 t

interarrival time : an (t )  ne n
The 
is exponential, and the
 n t
: bn (t )  ne

service time
arrival and conditional service rates are Poisson, when the system
is in state n  0 . From Eq 1.33, we have
Pr an arrival in an infinitesimal interval of length t in state n
 n t  O(t )
Pr more than one arrival occur in t in state n
 O(t )
Pr a service completion in t in state n system not empty
 n t  O(t )
Pr more than one service completion in t in state n more than one in sys.
 O(t )
0
0
1
1
1
2
…
2
2
 n-2
 n-1
n
n-1
3
 n-1
-2-
n
n
 n+1
n+1
 n+1
 n+2
Queue
n+1
n
an(t)
n-1
Server
…
2
1
bn(t)
n
n
0  (n  n ) pn  n 1 pn 1  n 1 pn 1
 n  1
(2.1)
0  0 p0  1 p1
n  n
n 1

p

p

pn 1
n
 n 1



n 1
n 1

 p  0 p
 1 1 0
n
 pn  p0 
i 1
(2.2)
i 1
i
n


 
 p0  1   i 1 
 n 1 i 1 i 
-3-
 n  1
(2.3)
1
(2.4)
FLOW BALANCE PROCEDURE
At steady state, Flow out = Flow in
0
0
 n-1
1
…
n
n-1
1
n
n
n+1
n+1
Fig. 2.2 – Flow balance between states
In the long term, the rate of transitions from n  1 to n  n 1 pn 1 
must equal the rate of transitions from n to n  1  n pn  . This
yields
n 1 pn 1  n pn
-4-
 n  1
(2.5)
2.2 SINGLE- SERVER QUEUES (M/M/1)
interarrival time : a(t )   e t
Since the 
are exponential,
 t
: b(t )   e
service time
and the arrival and conditional service rates are Poisson, we have

0

1



…
2


n
n-1



Queue
n+1
n
n-1
a(t)


n+1


Server
…
2
1
b(t)


0  (   ) pn   pn 1   pn 1
 n  1
(2.6)
0  0 p0   p1



p

p

pn 1
n
 n 1



 p1   p0


-5-
 n  1
(2.7)
2.2.1 SOLVING FOR {pn} USING AN ITERATIVE METHOD
p1 

p0

2



p2 
p1  p0    p0



2

p3    p0










Iteration

n

pn    p0

This is prove by mathematical induction.
Let

  . The ration  is called the utilization factor.

 pn   n p0

p
n0
n
 p0 1 
1
Thus for the existence of steady state solution,  

less than 1 (
 i 
i 0
1
1 
converges iff   1 ).
n
And pn  (1   )  ,
-6-


1


must be

2.2.2 SOLVING FOR {pn} USING AN GENERATING
FUNCTIONS
n
n
n
pn 1z  (1   )pn z   pn 1z ,

p1   p0
n 1
After some manipulation, we have
P (z ) 
where P (z ) 
p0
1  z

p z
n
n 0
n
:the probability Generating function
Boundary Condition

P (z  1)   pn  1 
n 0
p0
1 
( po  0    1 )
 p0  1  
 P (z ) 
1 
1  z
Talyer’s Expansion
P (z ) 

 (1   )  z
n
n 0
 pn  (1   )  n
-7-
n
2.2.3 SOLVING FOR {pn} USING OPERATORS
Define Da n  a n 1 : A linear operator defined on a sequence
a 0, a1, a 2,   
Then a general linear difference equation
C nan  C n 1an 1 
 C n  ka n  k 
n k
C a
i n
i i
0
may be written as
 n k
i n 
C
D
 i
 an  0
 i n

since D mak  ak m
 Example
C 2an 2  C 1an 1  C 0a n  0
(2.18)
C D
(2.19)
2
2

 C 1D 1  C 0 an  0
If the quadratic in D has real roots r1 and r2
D  r1 D  r2  an  0
Then an  d1r n or d2r n , where d1 and d2 are constant.
1
2
Then for the stationary equations of the M/M/1 model,
 pn 2  (  )pn 1   pn  0
-8-
(n  0,1,2
)

subject to the boundary condition that p1  p 0 and


p
n 0
n
 1,
We have
( D 2  (    )D   )pn  0
( D  )(D  1)pn  0


 pn  d1(1)n  d2 ( )n
r1  1, r2 




p1  d1  d2 ( )  d1  d2 


p 2  d1  d 2 ( ) 2  d1  d 2  2
d1 and d2 are to be found with the use of boundary conditions.
From boundary condition p1   p0 ,

p
n 0
d1  d2    p0 

  d1  0
2
2
d1  d2    p0 
 pn   n p0

since
p
n 0
n
 1  p0  1  
 pn  (1   )  n
-9-
n
1
d2  p0
2.2.4 MEASURES OF EFFECTIVENESS
Let N represent the R.V. of the number of customers in the system
at the steady state, then we have


E[N ]   np   n (1   )  n
n
n 0
n 0


 (1   ) n   (1   ) n  n 1
n
n 0
  (1   )
  (1   )
d 
n


d   n 0 

n 1




2
(1


)
(1   )
L
We let L  E[N ], then L 

1 
1

Let Nq and Ns denote the R.V. of the number of customers in the
waiting queue and the R.V. of the number of customers in the
server, respectively.
And let Lq  E[N q ], then

2
Lq  L  E [N s ] 
 
.
1 
1 

We can check by Lq   (n  1)pn .
n 1
- 10 -
We might also be interested in the expected queue size of
nonempty queue, which we denote by Lq .
 Lq  E[N q | N q  0] 

 (n  1)p
n
n 2
where pn is the conditional prob. distribution of n in the system
given that the queue is not empty, that is
pn  Pr n in the system n  2

Pr{n in the system and n  2}
Pr{n  2}( 1  p0  p1     (1   )   2 )
 pn
2
 pn  
0

, if n  2
, if n = 0,1

 Lq   (n  1)
n 2
pn
2


1 
 2   npn   pn 
  n 2
n 2

pn

1
1
1




L

p

(1

p

p
)

L



1
0
1 
 1 
2 
2 
As a side of observation, we can have
P r{N  n }   n .
Proof: P r{N  n } 

 (1   )
k
k n
- 11 -
 (1   ) 

n

k 0
k
 n
By little’s formula, if we know L and Lq, we have
W 
Wq 
L


1

 1 

1
 
1 2



  1   
Lq
- 12 -
2.2.5 WAITING TIME DISTRIBUTION
 mean waiting time
 we get waiting time distribution first
Let Tq denote the R.V. of time spent waiting in the queue of an
arrival, and Wq(t) denote its CDF of waiting time distribution.
(i)
t=0
W q (0)  P r[T q  0]  q0  p0  1  
(2.28)
where qn is the condition prob. of n in the system given that
an arrival is about to occur .
In M/M/1, qn  pn .
In M/M/c/K,qn  pn .
- 13 -
(ii) t > 0
Wq (t )  Pr Tq  t

  pn Pr n completions in  t | an arrival found n in the system
n 1
Wq (0)

   (1   ) 
n
t
   x
(n  1)!
0
n 1
t
  (1   )   e
0
n 1
x
e   x dx  (1   )
    x  n1 

dx  (1   )
(
n

1)!
 n1

t
  (1   )   e   x e  x dx  (1   )
0
 1   e   (1  ) t ,
t 0
The expected waiting time
E(T q )  W q  0 1       td[1  e   (1  )t ]

0
Wq 



(    ) (    )
Let T denote the R.V. of the total time spent in the system for
one customer. Its density by w(t), and its expected value by W,
then
w(t )  (    )e  (    ) t ,
W  E(T ) 
- 14 -
1
 
t 0
 Example: The same as example 2.1
Wq 

5/ hr
5

 hr  50 min
(    ) 6/ hr (6  5) / hr 6
W 
1
 1hr  60 min .
 
Wq  time spent waiting in the queue for those customers
who actually have to wait
=
Note that:
1
 1hr .
 
1
and
1 
L
1
1
W q  q 

  1      
We have Lq 
P r T q  1  1  W q (1)
 1  (1  e   (1  ) )
 e   (1  )
5
 e 1  0.306
6
30.6% of the customers on a Saturday morning must wait over
an hour.
- 15 -
RELATION BETWEEN Wq AND Lq - LITTLE’S FORMULA
We see that
W Wq 
1

It is certain intuitive, since
T  Tq  S
E(T )  E(T q )  E(S )
W  Wq 
1

(It holds for any queue)
Or we check this by this M/M/1
W 
W W q 

1
 
Wq 

 
1

1


(1   )
     
1
 
1
(
)
  

From results, we can see that
L  W
Lq  W q
They are generally referred to as Little’s Formula
- 16 -
Proof

pn   Pr{n arrival during a system time T | T  t}dW (t )
0


0
( t ) n   t
e dW (t )
n!

L   npn  


0
( t ) n   t
e dW (t )

(
n

1)!
n 1
 
0
n 1
PASTA property
(t ) n 1   t
t 
e dW (t )
n 1 ( n  1)!


  tdW (t )   E (T )  W (General Service FCFS queue)
0
It holds for any arrival process. Jewell(1976) has proven it in
his paper entitled “A Simple Proof of L  W ”
Table 2.1 show the relations.
L  W is valid for any general arrival process and general
service queue.
可依 L  W 的方法來證明 Lq  W q , or
L  Lq  
 Lq    (W q 
W Wq 
1

)
- 17 -

1

Lq  W q
2.3 MULTISERVER QUEUES (M/M/c)
1
2
e
…
…
-t
e-t
c
Fig. - The Conceptual Queuing Model
 c servers, each has an independently and identically distributed
exponential service distribution.
 Poisson arrive process.
n=
0
0
1
1

for all n
2
…
2
2
c-1
3
c
c-1
 c-1
c
c
c+1
c+1
c
c
n>c
It is still a birth-death process because for one death
Pr exact one death in t
 [ t  O(t )][1  t  O(t )]c 1 C1c
 ct  O (t )
- 18 -
For two deaths,
Pr exact 2 death in t
 Pr exact 2 death in t in one of c servers
 Pr exact one death in one of the two serverrs among c
c
c
2
   O(t ) 2     t  O (t ) 
1
 2
 O(t )
From (2.2) we know that
p  n  n p  n 1 p
 n 1
n 1 n n 1 n 1

p1   p0


n
 pn  p0 
i 1
i 1
i
n


 
p0  1   i 1 
 n 1 i 1 i 
 n  

 M/M/c : 
n
 n  

c
- 19 -
n 1
(2.3)
1
(2.4)
, n
,n  c
,n  c
(2.30)
Utilizing (2.3) in (2.4), we obtain
  p
n !  n 0
pn  
n


p0
c n cc !  n
n
1n c
(2.31)
n c
1 2
c c1
n

Note that
 c !  c c n c n
c
 c n cc ! n

 c 1  n
n 
1   pn p0  
  n c
n
n 
n
!

c
c
!

n 0
n

0
n

c



Define r 

,


 r

c c
Therefore we can write
1
 c 1 r n  r n 
 c 1 r n
cr c 
p0      n c     

 n 0 n! n c c c !
 n 0 n! c !(c  r ) 
 r

r
  

 n 0 n! c !(1   ) 
c 1
n
c
1
1
r
  1
c
 c 1 1    n 1   c c 
      

n
!

c
!

c



 
 n 0  

- 20 -
1
note that  / c  1
(2.32)
Measures of Effectiveness for the M/M/c/  model
(i)
Average Queue size Lq


rn
Lq   (n  c )pn   (n  c ) n c p0
c c!
n c
n c
r c p0  (n  c )r n c
r c p0 
m


m



c ! n c
c ! m 1
c n c
rc
d   m
  p0
 


c!
d  m 1 

rc
  p0  m  m 1
c!
m 1
rc
d
  p0
c!
d
  
1   


 rc

r c 1 / c
 Lq 
p

0
 c !(1   )2  p0
c !(1  r / c )2


(2.33)
(ii) Average system size L
It is hard to obtain L if via L 

 np
n 0
Let us go by finding W q 
Lq

n
, W Wq 
 r c 1 / c

L  r  
p
2 0
c
!(1

r
/
c
)


or
 rc

L r 
p
2 0
c
!(1


)


- 21 -
1

, and L  W
(2.36)
(r  1  p0 in M / M / 1)
The average number of customers being served; The system
throughput can be derived as
0  p0  1  p1 

c  pc  c

p
n c 1
n

rn
rn
  npn  c  pn  
p0  c  n c p0
(
n

1)!
c!
n 0
n c 1
n 1
n c 1 c
c
c
 c 1 r n r c   r n 
 p0r       
 n 0 n ! c ! n 0  c  
 c 1 r n r c
1
 p0r   
 n 0 n ! c ! 1  r /


c
r
(iii) CDF of waiting time Tq: Wq(t)
Tq = 0
Wq (0)  Pr{Tq  0}  Pr{n  c  1 in the system}
c 1
c 1


rn
rn
  pn  p0   1   pn  1   n c p0
c!
n 0
n 0 n!
n c
n c c
1
1
cr c 
rc 
 p0  
 p0  


 p0 c !(c  r ) 
 p0 c !(1   ) 
r c p0
1
c !(1   )
(2.37)
- 22 -
Equivalently,
c 1 n
 rc
r c p0
rc
r 
C  c, r   1  Wq (0) 



c !(1   ) c !(1   )  c !(1   ) n 0 n! 
1
: Erlang - C formula (2.38)
Tq > 0
Wq (t )  Pr Tq  t

  Pr{n  c  1 completions in  t|
nc
arrival found n customers in the system}  pn  Wq (0)

 p0 
n c

rn
c
n c
t
 c(  cx) n c
0
(n  c)!
c !
( /  )c 1  e  (  c  ) t 
(c  1)!(c   /  )
 Wq (0) 
e   cx dx  Wq (0)
p0  Wq (0)
r c p0 1  e  (  c  ) t 
c !(1   )
(see page 71).
代入Wq (0)
r c p0e ( c   )t
W q (t )  1 
c !(1   )
And
Pr Tq  t  1  Wq (t )
- 23 -
(2.39)
r c p0
e ( c   )t
Pr Tq  t c !(1   )
Pr Tq  t Tq  0 

 e ( c   )t
1  Wq (0)
Pr Tq  0




Pr Tq  t Tq  0  1  e ( c   )t
From (2.39), we can show that
  /    
rc
W q  E (T q )  
p 
p
2 0
2 0
c !(c  )(1   )
(c  1)!(c    ) 
c
 pdf of Tq, wq(t)
c


c  /  
p0   (t )
 1 
  c !(c   /  ) 
wq (t )  
 ( /  ) c  e  (  c   ) t
p0

(c  1)!

,t 0
,t 0
And (left as problem 2.19)
W (t )  Pr T  t

c  (1   )  Wq (0)
c  (1   )  1
(1  e  t ) 
- 24 -
1  Wq (0)
c  (1   )  1
(1  e ( c   )t )
Notice that :
W (t )  Pr T  t




 Pr T  t Tq  0 Pr Tq  0  Pr T  t Tq  0 Pr Tq  0


 Wq (0)(1  e   t )  1  Wq (0)   Pr S  Tq  t Tq  0 
 Wq (0)(1  e
 t




t

(
c



)
t
)  1  Wq (0)  (1  e )  (1  e
)


  e t

- 25 -
2.4 CHOOSING THE NUMBER OF SERVERS
How to find the number of servers that adequately balances the
quality and cost of service?
 A helpful approximation in choosing the number of servers
for an M/M/c queue.
(works for queues with a large number of servers)
Observe that for system stability in steady state, the number of
servers c must be greater than the offered load r. Thus
c  r  ,
where   0 is the number of additional servers in excess of
the offered load ( may be a fraction to make c an integer).
 Now, consider an M/M/c queue with offered load r  9 ,
c  12 , and traffic intensity   0.75 (System is stable).
 Suppose that the offered load quadruples to r  36 .
 How many new servers should the owner hire?
1. Choose c to maintain a constant traffic intensity .
In the baseline case, there are 4 servers available for
every 3 customers in service, on average (   0.75 ).
- 26 -
Keep this ratio constant  c  48 .
2. Choose c to maintain a constant measure of congestion.
An example congestion measure is 1  Wq (0) , the
probability, obtained from the Erlang-C formula (2.38),
means that a customer is delayed in the queue.
In the baseline case, 1  Wq (0)  0.266 when r  9 ,
c  12 .
Keep this level of service  c  42
More generally, let  be the maximum desired fraction
of callers delayed in the queue. Then c can be chosen as
follows:
Find the smallest c such that 1  Wq (0)  
(2.40)
3. Choose c to maintain a constant “padding” of servers.
In the baseline case, there are 3 ( c  r ) extra servers
beyond the minimum number needed to handle the
offered load r  9 .
Keep the extra servers  c  r  3  39 , when r  36
The three approaches hold constant , 1  Wq (0) , and , respectively.
- 27 -
Table 2.1 Example Performance Measures for Various Choices of c
c

1-Wq(0)

12
48
0.75
0.75
0.266
0.037
3
12
2. Quality and efficiency domain (QED) 42
3. Efficiency domain
39
0.86
0.92
0.246
0.523
6
3
Baseline
1. Quality domain
For a larger queueing system:

In the quality domain: Hold  constant
As r   , 1  Wq (0)  0
System has very little queueing delay.

In the efficiency domain: Holding  constant
As r   ,   1, 1  Wq (0)  1
System is nearly always congested.

In quality and efficiency domain: Holding 1  Wq (0) constant
- 28 -
 A simple approximate formula for choosing c in QED:
cr r
or
 r
(2.41)
where  is a constant.
Basic idea:
no. of excess servers
should increase with
the square root of the offered load
The square-root law (2.41) is justified theoretically by the
following theorem (Halfin and Whitt, 1981).
- 29 -
Theorem. Consider a sequence of M/M/c queues indexed by
. Suppose that queue n has cn  n
the parameter n  1, 2,
servers and offered load rn . Then
lim C  cn  n, rn   
n 
,0    1
(2.42)
if and only if
lim
n  rn
n 
n

,  0
(2.43)
where C  c, r  is the Erlang-C formula, and  and  are
constants related via

 ()
 (  )    ()
(2.44)
where  () and () are the PDF and CDF of a standard
normal random variable.
The parameter  nad  can be interpreted as constants
representing the quality of service:
 : probability of nonzero delay in the queue   1  Wq (0)
 : is a constant related to  via the relationship in (2.44)
- 30 -
2.5 QUEUES WITH TRUNCATION (M/M/c/K)
For K  c
 ,
n  
0
 n ,

 n  c  ,

0,
0nK
nK
0nc
cnK
nK
Substitute them into (2.31)
n
 n
1 
p0    p0 ,

n
n!  
 n!
pn  
n
 n
1 
 n  c n p0  n  c   p0 ,
c c!  
 c !c 
k
Boundary condition
p
n0
n
1 n  c
cnK
 1 will yield p0 ; that is
1
1
 c 1 1    n K 1    n 
 c 1 1 n K 1 n 
p0        n c       r   n c r 
c! 
 n 0 n!
n c c
 n 0 n!   n c c c !   
  r c 1  (  ) K c 1 c 1 r n  1
  ,

n 0 n! 
 c! 1  

1
c 1 n
 r c
r 
  ( K  c  1)    ,
n 0 n! 
 c!
( 

 1)
c
(2.46)
(   1)
Note   1 and even   1 are allowed because it is a blocked and lost system.
- 31 -
 Measure of Effectiveness
p0 K (n  c)r n p0 r c  K n c 1
Lq   (n  c) pn  



n c
c ! n c c
c ! n c 1
n c
K
p0 r c  d 1   K c 1 

c ! d   1   
p0 r c 
1   K c 1  (1   )( K  c  1)  K c 

2 
c !(1   )
(2.47)
K
L   npn
n 0
L  Lq  平均在server內的個數
c 1
K
n0
n c
 Lq   npn   cpn  Lq 
L  L
q

(1  pK )

 r in M/M/c 
Prove that the average number of customers in servers for
M/M/c/K is

(1  pK )

- 32 -
 Since the PASTA property : eff   (1  pK )
For M /M /c /K ,
平均在server的customer個數 
effective arrival rate eff

.
service rate

Little Formula :
W
L
eff   (1  pK ) : effective arrival rate
eff
eff
eff 
1
c
Wq 
Lq
eff
Wq  W 
,
For M/M/1/k ,
1

 (1   )  n
 1   K 1 ,   1

pn  
 1
 1
 K  1 ,
L  Lq  (1  p0 )  Lq 

(2.50)
 (1  pK )

 (1  pK )
 1  p0   (1  pK )   1  p0 

effective arrival rate (effective input rate) = effective output rate
- 33 -
 Waiting time CDF of M/M/c/K
qn  Pr{n in system | acceptable arrival about to occur}

Pr{acceptable arrival about to occur | n in system}pn
K
 Pr{acceptable arrival about to occur | n in system }p
n
n 0
[t  O(t )] pn
 lim K 1
t 0
[t  O(t )] pn
n 0

 pn

K 1
 p
pn
1  pK
,
if n  
for 0  n  K -1
n
n 0
K 1
Notice that
q
n0
n
K
 1,
while
p
n0
n
1 
qn  pn
Wq (t )  Pr{Tq  t}
K 1
 Wq (0)   Pr{n  c  1 completions in  t | accpetable arrival
n c
formula found n in the system}  qn
c  (c  x ) n  c  c  x
Wq (t )  Wq (0)   qn 
e dx
0
(n  c)!
n c
K 1
t
K 1
n c
  ct 
n c
i 0
i!
 1   qn 
i
e  ct
c 1
Notice that Wq (0)   qn
n0
- 34 -
2.6 ERLANG’S LOSS FORMULA (M/M/c/c)
The special case of the truncated queue M/M/c/K for which K = c,
that is, where no line is allowed to form, gives rises to a stationary
distribution which is known as Erlang’s Formula.
pn 
( /  ) n / n !
0nc
c
 ( /  )
i
/ i!
i 0
The result formula for pc is itself called Erlang’s loss formula or the
Erlang-B formula B(c, r ) .
( pc : The probability of a full system; the probability that all
channels are busy.)
B (c, r )  pc 
(c  ) c / c !
c
 (c  )
i

/ i!
i 0
r c / c!
c
r
i
, c   r
(2.53)
/ i!
i 0
The formula is still valid for any M/G/c/c, independent of the
form of the service-time distribution.
- 35 -
 Computational Issues
For the Erlang-B formula :
B(c, r ) 
rB(c  1, r )
, c  1,
c  rB(c  1, r )
With initial condition B(c=0,r)=1.
Let C(c,r)=1-Wq(0) be the Erlang-C probability of delay in M/M/c queue.
Then
C ( c, r ) 
cB(c, r )
,
c  r  rB(c, r )
And

Lq  C( c, r)

1 
r
C( c, r)
cr
.
Erlang - C Formula :
-From M/M/c queueing model
-It is a blocked-call-delayed system
Erlang - B Formula
-From M/M/c/c queueing model
-It is a blocked-call-lost system
Example 2.7
A queueing system with   6, M  3, and c  4 .
- 36 -
2.7 QUEUES WITH UNLIMITED SERVICE (M/M/∞)
Infinite number of servers
Example system is such as self-service type system.
Use the general birth-death results given by (2.3).
n   and n  n , for all n
n
pn 
p0
n! n
or
rn
pn  p0
n!
,n 1

We find p0 by using the boundary condition
p
n0
n
1
which yields
1
  
 /  1
 / 
r


p0   

e

e

e
.
n


n
!

 n0

And then
( /  ) n   /  ( r ) n  r
pn 
e

e
n!
n!
It is valid for any M/G/∞ model too.
Hence the steady-state probability distribution of n in the
system is given by the Possion with parameter  /  .
Expected system size L, is the mean of the Poisson distribution
- 37 -
L 


Since we have as many servers as customers in the system,
Lq  0 , and Wq  0
W
1

 Example 2.8
TV Broadcast Networks
T  100,000 hr
 for KCAD is 100,000 5  20,000 hr
 one of the five major TV stations 
1

 1.5hr
L 

 20,000  1.5  30,000 people

- 38 -
2.8 FINITE SOURCE QUEUE
Calling population
is finite : M
N=n
1

…
…
M-n
n
c

For a calling unit, the prob. that it will enter into the system
by time t and t+t is t + O(t)
 ( M  n) ,
n  
0,

0nM
M n
n ,
n  
c ,
M
0
cn
( M  1) (M  2) (M c 1) ( M  c)
1

0nc
...
2
2
3
...
c
c
- 39 -
2
c

M
M-1
c
c
Using (2.3) yields
 M  n
 n  (r ) p0 ,
 
pn  
 M  n!
n
 n  c n  c c ! (r ) p0 ,
 
0nc
(2.58)
c  n  M,
where r   /  and p0 is found in the usual way from

p
n0
n
 1, as
 c 1  M     n M  M  n!    n 
p0            n  c   
 n  0  n     n  c  n  c c !   
1
 Measures of effectiveness
n
 M     M  M  n!   
L   npn  p0  n       n   n  c  
c !  
n0
n0  n    
nc  n  c
c 1
M
n
There is no neater expression for L
M
M
M
nc
nc
n c
Lq   (n  c) pn   npn   cpn
c 1
c 1


 L  c   ( c  n ) pn  L   c   ( c  n ) p n 


n0
n0

the average number of servers which are free
c 1
while c   (c  n) pn is the number of servers which are busy
n0
- 40 -
Cellular System
M

…
…
idle
The effective arrival rate eff
M
eff   (M  n ) pn  (M  L )
n 0
It is certainly intuitive, since, on the average, L are in the system,
on the average M-L are outside and each has a mean arrival rate  .
eff

 L  Lq 
 Lq   M  L   Lq  r  M  L 


 W
L
 ( M  L)
,
Wq 
Lq
 ( M  L)
Another way to obtain W or Wq
W  Wq 
1

Another way to obtain eff
eff   ( L  Lq )

- 41 -
L  Lq 
eff

Physical meaning :
At stationary,
effective arrival (input) rate = effective departure (output) rate
eff   ( L  Lq )
where L-Lq is total number of customers in the servers
Proof
Denote  eff the effective departure rate
c 1
M
n 0
n c
eff   n pn   c pn
 c 1

    ( n  c ) pn  c 
 n 0

c 1


   c   ( c  n ) pn 
 n 0

   L  Lq 
The above results are still valid for M/G/c/c case.
- 42 -
 Example 2.9 : Repairing Queueing System
Five robots : M=5
Two repair people : c=2

…
n
M-n
: In operation
In this case, 3 robots break down
: Break down
 Each robot has a life time in exponential distribution with
parameter   1 30hr
 Each broken robot has a repair time in exponential
distribution with   1 3hr
 p0  0.619
The average number of robots in repair :
L  0.465;
The mean maintenence time (down time) :
W
L
 3.075hr;
  M  L
The average number of robots in operation :
M - L  4.535.
- 43 -
The fraction of idle time of each server (repair person) :
p0 
1
p1  0.773
2
eff
?
c
(1 
eff
)?
c
If c = 1
p0  0.564
L  0.640
M  L  4.360
W  4.4hr
What is your decision?
- 44 -
 Find qn  The probability of n in the system given an
acceptable arrival occurs
qn  Pr{n in the system | an acceptable is about to occur}

Pr{an acceptable is about to occur | n in system}Pr{n in system}
M
 Pr{an acceptable is about to occur | j in system}  Pr{ j in system}
j 0
 lim
[( M  n)t ] pn

t  0 M
[(M  j )t ] p
j 0

j
( M  n ) pn
M
 (M  j) p
j 0
j
M n
pn
M L
This qn is indeed dependent on pn for effective acceptable
arrival rate eff  ( M  n)
M 1
n c
 ct  e ct
nc
i 0
i!
Wq (t )  Pr{Tq  t}  1   qn 
- 45 -
i
 If the model considers the use of spares, then
1
Maintenance
department
M+Y
Y is spares
…
…
c
 : failure rate for one machine
c repairmen
M : Active Machines  at most 
Y : Spare Machines
M 

n  ( M  n  Y )

0
n
n  
c
n
n
, 0 n Y
, Y  n  M Y
, M Y  n
,0  n  c
,c  n  M  Y

‚
c
c
Y
n
M+Y
Then we can have the results such as pn in (2.62) and (2,63)
for cases of ○
1 c  Y and
○
2
and Lq can be obtained similarly.
- 46 -
c  Y , respectively. Then L
The effective arrival rate
Y 1
M Y
n 0
n Y
eff   M  pn 
 ( M  Y  n ) p
Y M


   M   (n  Y ) pn 


n Y
n
(2.64)
 Waiting Time Distribution Wq(t)
Standard Procedure
Define {qn} as the probability of n in the system given an
acceptable arrival occurs
(1) care with no spare :
qn  Pr n in the system an acceptable arrival is about ot occur

Pr arrival is about to occur n in the system  Pr n in the sys.
M
 Pr arrival is about to occur
n 0
 M  n  t  pn
 lim M
t 0
  M  n  t  pn
n 0

 M  n  pn
M L
- 47 -
n in the system  Pr n in the sys.
care with Y spares :
Mpn

Y M

 M   ( n  Y ) pn
n Y

qn  
 ( M  n  Y ) pn
Y M

 M   ( n  Y ) pn

n Y
, 0 nY
, Y  n  Y  M 1
(2.65)
Prove that :
(i)
Without spares
qn (M )  pn (M  1)
(Problem 2.44)
(ii) With spares Y
qn (M )  pn (Y  1)
- 48 -
(Problem 2.45)
Derive the waiting time distribution
Wq (t )  Pr{Tq  t}

M Y 1

[Pr{( n  c  1) completions within t
n c
arrival found n in system}  qn ]  Wq (0)

t
  c   cx 
n 0
(n  c)!
M Y 1
q
n c
1
M Y 1
n c
 q
n c
n
i 0
  ct 
i
nc
e   cx dx  Wq (0)
e   ct
i!
- 49 -
 see p.91 in textbook 
2.9 STATE-DEPENDENT SERVICE
The service rate depends on the state of the system
 The First Model:
service time : Markovian, Fast rate, Slow rate
 1
n  
 
,1  n  k
,k  n
   n
  p0
 1 
 pn  

n
 k 1 n  k 1 p0
 1 
  1
…

k
1

,1  n  k
,k  n
From the boundary condition
p
n
n
 1, we find that
1
1
 k 1   n 

n
 k 1 n  k 1 n  k 1 
p0        k 1 n  k 1    1   1 

 n0

nk
 n  0  1  n  k 1 

or
1  1k 1k 1 
p0  

1


1   

1
If 1  1,   1
1
; 1 
 

p0   k 

 1  
- 50 -


, = 1
1

1
 Measurements of effectiveness
 1[1  (k  1) 1k  k 1k 1 ] 1k 1[k  (k  1)  ] 
L  p0 


2
(1


)
(1   ) 2


1
Lq  L  (1  p0 )
W
The W  Wq 
1

L
and

Wq 
Lq

cannot be used here.
The expected service time is
W  Wq  ( L  Lq )  1  p0
W W q 
or say
1

( L  Lq ) 
1  p0


 1  p0 , where   is the average service rate

  

1  p0

1 1  p0

: Expected service time



Input rate = Output rate
- 51 -
(2.69)
 Example 2.10
Car-polishing
service
=1/30
…
k
0  n  k : 1 
1
40
: 
1
20
kn
For case 1, k = 2, and then p0 , L, W,
This is a kind of
For case 2, k = 3, and then p0 , L, W,
threshold-based contract
k 1

n0
nk
If the expected cost of operation is C (k )  15 pn  24 pn
Then C (2)  $16.80 / hr , C (3)  $17.22 / hr
Since k = 2 has the system idle more often that makes up
for high speed operation cost.
- 52 -
 The Second Model : State-dependent service
A single server, Markovian state-dependent service model :
n  


 n  n 
n
pn 
n
  rn 
p0  
 
 n  0 (n!) 
n

(n!) 
1
r
n
p0


The above infinite series will be convergent for any r as long
as   0 , but it is obtainable in closed form unless   1.
We may find N by computer calculation such that
pˆ 0 ( N )  pˆ 0 ( N  1)  
The remaining part will be left for students to study.
- 53 -
2.10 QUEUES WITH IMPATIENCE
 Impatience:
1.) Balking: blocking, the reluctance to join a queue
2.) Reneging: give up after joining and waiting
3.) Jockeying
…
…
Jockeying
…
…
- 54 -
2.10.1 M/M/1 BALKING
 M/M/1/K can be said to be a queue with impatient customer.
 n  bn , 0  bn 1  bn  1 monotonically decreasing function,
and b0  1.
The process is still birth-death, but
n  bn

 n  
n
From (1.39)
pn  p0 
i 1
We have
i 1
i

pn  p0  

n
,n 1
n
b
i 1
i 1
We get p0 in the usual way as
  
p0  [1     
 n2   
p0 has solution if  
n n 1
b
i 1
i 1
]1

 1 and iff ergodic.

- 55 -
 Example 1 : M/M/1 balking that
 1

bn   n  1
0
 1 ,  
1
2
1/ 2
,
0nk
kn
i.e.,  
 p0
2


p
 pn   n 0
 2 (n  1)!

0

k


And p0  1  [2n (n  1)!]1 
 n 1

1
2
,n 1
,2  n  k
,n  k
1
k
n
n
n 1 2 ( n  1)!
Therefore L  p0 
 Example 2
bn  e n
bn  e n / 
- 56 -
2.10.2 M/M/1 RENEGING
Reneging rate r  n 
r  n   lim
Pr unit reneges during t when there are n customers
t
t  0
e.g.
r  n   e n 
r  0  0
;
,n  2
r 1  0
Consider a single-channel birth-death model where both reneging
and the simple balking are considered. Then,
n  bn 1, 0  bn 1  bn  1,
n
n    r (n)
 pn  p0
n
n
bi 1

i 1   r (i )

p0  [1   
n 1
n
n
bi 1 1
]



r
(
i
)
i 1
- 57 -
n 1
2.11 TRANSIENT BEHAVIOR
We consider the transient behavior of three specific queueing
systems,
namely
M/M/1/1,
M/M/1/∞,
and
M/M/∞
for
simplification.
2.11.1 TRANSIENT BEHAVIOR OF M/M/1/1

dp1  t 
  p0  t    p1  t 
dt
0
dp0  t 
  p0  t    p1  t 
dt
1

Ans:
p0 (t )  p1 (t )  1
 p1 (t )  (   ) p1 (t )  
 p1 (t )  Ce (    )t 


Given p1 (t ) at t  0 , then C  p1 (0) 




 (   )t
 (   )t
p
(
t
)

p
(0)
e

(1

e
)
1
1






(2.71)
 p (t )  1  p (t )  p (0)e  (    ) t   (1  e  (    ) t )
1
0
 0

- 58 -
We can find steady state probabilities p0 and p1 directly
from p0 (t ) and p1 (t ) , where

1

p

lim
p
(
t
)


 0 t  0
   1 


 p  lim p (t )    
 1 t  1
   1 
2.11.2 TRANSIENT BEHAVIOR OF M/M/1/∞
From (1.30), we have
 pn (t )  (   ) pn (t )   pn 1 (t )   pn 1 (t )

 pn (t )   p0 (t )   p1 (t )
,n 1
,n  0
(2.72)
 用 Moment Generating Function 方式來解
Define P (z , t ) 

 p (t )z
n
n
n 0

上述二公式各乘
z
n
及 z 0 , respectively, then we have
n 1

 p (t )z
n 0
n

n

   pn (t )z    pn (t )z n
n
n 0

n 1

  pn 1(t )z    pn 1(t )z n
n
n 1
n 0
- 59 -

P (z , t )  P (z , t )  [P (z , t )  p 0(t )]
t
zP (z , t ) 


z
[P (z , t )  p 0 (t )]
1z
[(   z )P (z , t )   p0 (t )]
z
Of course, it is subject to the condition that P (z , 0)  z i
if n  i
1
pn (0)  
0
elsewhere
 Solve the partial differential equation (PDE) by Laplace
transform method.
Define

L [ P( z , t )]   P ( z , t )e  st dt  P ( z , s )
0

L [ pi (t )]   pi (t )e  st dt  pi ( s )
0
0i





Convergence in z  1, and Re s  0
Then
L[


P( z, t )
P( z, t )]   e st
dt  sP ( z, s)  z i
0
t
t
sP ( z , s )  z i 
1 z
(    z ) P ( z, s)   p0 ( s) 
z
- 60 -
szP( z , s )  z i 1   z 2  (   ) z    P( z , s )   (1  z ) P0 ( s )
z i 1   (1  z ) P0 ( s)
 P ( z, s) 
(    s ) z     z 2
(2.73)
Since the above equation P ( z , s ) converges in the region of
z  1, Re s  0 , wherever the denominator has zeros in
that region, so must the numerator.
The denominator has two zeros
    s  (    s)2  4
z1 
2
    s  (    s)2  4
z2 
2
z1  z2 
    s ,

z1 z2 


 Rouché’s Theorem
If f ( z ) and g ( z ) are functions analytic inside and on a
closed contour C and if g ( z )  f ( z ) on C, then f ( z ) and
f ( z )  g ( z ) have the same number of zeros inside C.
- 61 -
For z  1, Re s  0 , we see that
f ( z )  (    s ) z      s         z 2
g ( z)
 f ( z )  g ( z ) has only one zero inside C. It is z1
 The numerator has zero at z1
z1i 1
 p0 ( s) 
 (1  z1 )
z i 1  (1  z ) z1i 1 /(1  z1 )
 P ( z, s) 
 ( z  z1 )( z2  z )
Numerator 
=
1
(1  z1 )( z i 1  z1i 1 )  (1  z1 ) z1i 1  (1  z ) z1i 1 
1  z1
1
(1  z1 )( z  z1 )( z i  z i 1 z1  zz1i 1  z1i )  ( z  z1 ) z1i 1 
1  z1

1 i 1 
 ( z  z1 ) ( z i  z i 1 z1  zz1i 1  z1i ) 
z1 
1

z


1

1 i
z
i i 1
i
P  z, s  
( z  z1 z  ...  z1 )  ( ) k
 z2
k  0 z2
i
j i j
 z1 z
j 0

z1i 1
z

( )k

 z2 (1  z1 ) k  0 z2
,


z
1
z2
L [ P( z, t )]  L [ pn (t ) z ]   pn ( s) z n
n
n 0
- 62 -
n 0
1
 pn ( s )  [
1
 z2 n i 1

 /
z2 n i  3
( /  )2
(  /  )i
 n i 5  ...  n i 1
z2
z2
 n 1   j
( )
( ) )]


j  n i  2 
Inverse Laplace Transform, we have




pn (t )  e  (    ) t [( )( n i )/2 I n i (2t  )  ( ) ( n i 1)/2 I n i 1 (2t  )
  n    j /2
(1  )( )  ( ) )I j (2t  )]
  j  ni  2 
,(n  1)
where
( y / 2)n  2 k
I n ( y)  
, (n  1)
k
!(
n

k
)!
k 0

Modified Bessel function of the first kind with properties
(i)
I n ( y)  k  n J n (ky) ,where
J n ( y ) is the regular Bessel function
(ii) (2n y) I n ( y)  I n 1 ( y)  I n 1 ( y)
(iii) I  n ( y)  I n ( y)
yn
(iv) I n ( y )  n  O( y n )
2 n!
ey
1
 O( )
(v) I n ( y ) 
y
2 y
- 63 -
2.11.3 TRANSIENT BEHAVIOR OF M/M/∞
The differential-difference equation (2.76)
 pn (t )  (  n ) pn (t )  (n  1)  pn 1 (t )   pn 1 (t )

 p0 (t )   p0 (t )   p1 (t )
(n  1)
Let us denote the generating function of the transient probability
pn (t ) by
P (z , t ) 

 p (t )z
n 0
n
n
and since

 p (t )nz
n 1
n 1
n

  pn 1(t )(n  1)z n
n 0
 

Pn 1(t )Z n 1

z n 0
 

Pn (t )Z n

z n 0

 P (z , t )
z

 p (t )z
n 0
n
n


P (z , t )
t
We have
P (z , t )
P (z , t )
 (1  z)
 (1  z )P (z , t )
t
z
- 64 -
The Derivation


P (z , t )
n
  (   n  )pn (t )z   (n  1)  pn 1(t )z n
t
n 0
n 0

   pn 1(t )z n
n 1
  z
P (z , t )
P (z , t )

 P (z , t )  zP (z , t )
z
z
 (1  z )
P (z , t )
 (1  z )P (z , t )
z
 P (z , t )
P (z , t )


(1

z)
 (1  z )P (z , t )
 t
z

p P (z , t )  q P (z , t )  r

t
z
 Note that any equation of the form
ax+by+z=d
Any equation of the form
z
(a,b,1)
p
y
P
t
 q
P
z
 r
(The planar differential eq.)
has an surface integral solution P(z,t)
x
a
dz
Normal Line
 0
The line which the equations
x
b
dz
y
dz dz
( a , b ,1)   (
,
,  1)
x y
dt
(t0 , z 0 , p 0 )
 0
Surface
p
(p,q,r)
P=f(z,t)
 ( p , q , r ) 為 lin e 之 d ire c tio n n u m b e r.
平面垂直方向
- 65 -

dz
q

dp
r
via ( t 0 , z 0 , p 0 ) are
perpendicular to thermal line
For the case at hand, p  1 ,q  (1  z ) , r  (1  z )P (z, t )

dt
dz
dP (z , t )


1  (1  z ) (1  z )P (z , t )
This yields the two solutions
(1  z )e  t  c1

z  / 
 c2
P (z , t )e
And c2 and c1 are functionally related, i.e., c2  g(c1 )
P (z , t )e z  /   g(c1 )  g (1  z )e  t 
P (z , t )  e z  / g (1  z )e  t 
If
1
Pn (0)  
0
(if n  0)
(if n  1)
Syst em is empt y
Then

P (z , 0) Pn (0)z n  1
n 0
 g (1 - z )  e z  / 
- 66 -
By letting y  1  z
g(y )  e (1y )  / 


 g (1  z )e  t   exp (1  z )e  t  1 




)  exp  (1  z )e  t  1 





 exp  (z  1)(1  e  t ) 


 P (z , t )  exp(
z
To use Taylor series expansion about z  0 , we have
1  n P (z , t )
pn (t ) 
n ! z n z  0
n
1 

 t  
 t  

(1

e
)
exp

(1

e
) 

n ! 
 


It is easily seen that letting t   , we have
(  /  )n   / 
pn 
e
n!
- 67 -
,(n  0)
2.12 BUSY PERIOD ANALYSIS FOR M/M/1 AND M/M/c
 Busy period: To begin with the arrival of a customer to an idle
channel and to end when the channel next becomes idle.
 Busy cycle: Busy period + adjacent idle period.
 Idle period distribution: Exponential with mean 1/  .
Busy period 可看成當系統 = 1 ( initial size) 到系統 = 0 間之
期間
1st arrival
(System size = 1)
busy cycle
busy period
idle
idle period
busy
…
…
t=0
Last departure
(System size = 0)
且我們若將(2.72)的 eq.看成

0
1


…
2



n
n-1


- 68 -



n+1


Initial condition
 pn (0)  1

 pn (0)  0
,if n  1
,if n  1
The transition will be terminated at n  0 .

 p (t )
所求得出來之
n 1
n
(0~t) 為 busy period 之 CDF , 故
p0 (t ) 即為 busy period 之 CDF.

 p (t )  Pr T
n 1
n
b
 t
p0 (t ) PrTb  t 
故
 Example
0
即 n=1的 case
1

p 0 (t )
p0 (t )  1  e  t
p1 ( t )
p1 (t )  et
可看成 t   , CDF of busy period Tb  1
 p0 ()  1
- 69 -
C D FTb o f
 p0 (t )   p1 (t )


 p1 (t )        p1 (t )   p2 (t )

 pn (t )        pn (t )   pn 1 (t )   pn 1 (t )
 p1 (0)  1
with initial condition 
 pn (0)  0
(n  2)
,n  1
z 2  (1  z )(    z )( z1 / s )
P ( z, s) 
 ( z  z1 )( z2  z )
(2.78)
z1 and z2 have the same as before.
Q1: The distribution of idle period is exponential with mean 1/ .
Q2: p0 (t ) is the CDF of busy period.
1st arrival
(System size = 1)
T: Interarrival Time
(Exponentially distributed)
t = t1 + ti
idle
t1
…
busy
busy
ti
idle
…
Last departure
(System size = 0)
- 70 -

 p (t )  Pr T
n 1

n
busy
 t  CDF of Tbusy

p0 (t )  1   pn (t )  CDF of Tbusy
n 1
Solution 1 of Q1
Pr Ti  ti   Pr Ti  t | Ti  t1,
where ti  t  t1
Pr t1  Ti  t e  t1  e  t


Pr Ti  t1
e  t1
 1  e   ( t t1 )  1  e  ti
Ti has an exponential distribution
Solution 2 of Q1
以 t1 後的時間, t 的時間內仍然是會有一個 arrival 的概率
為 t  O(t ) , 不來者為 1  t  O(t ) , 如此來證明
dp0 (t )
  p0 (t )
dt
p0 (t )  Ce   t  e   t  Pr T  t
 Pr T  t  1  e   t
 a(t )   e   t
- 71 -
Solution of Q2
即 
p0 ( s )  L [ p0 (t )]  P ( z , s ) z 0   pn ( s ) z n
n 0


 sz2

z 0
2
s (    s  (    s ) 2  4
L [ p0 (t )]  sp0 (s)  p0 (0)  sp0 (s)
pdf of busy period : p0 (t )
1


2


 p0 (t )  L 2      s  (    s )  4 
 
 
-1

 /  e (    )t I1 (2  t )
t
 To get the average length of the busy period
Since
d
d
d

sp
(
s
)

p
(
s
)

L  sp0 (t )  s 0
 0  s 0
 0  s 0
ds
ds
ds

d 
 st

  p0 (t )e dt   tp0 (t )e  st dt
0
ds 0
s 0
s 0

   tp0 (t )dt  E(Tbusy )
0
- 72 -
E Tbusy    t  p0 (t )dt
 We just find
p0 ( s ) s 0 
d
d
 sp0 (s) or  p0 (s)
ds
ds
s 0
s 0
d
 sp0 ( s) s 0
ds
1
d 
2

 2
    s  (    s )  4

 s 0
ds
 2 
1  (    s )  (    s ) 2  4 
    s  (    s ) 2  4 


1/2
2
s 0

1
 
 2 


(2  ) 2
 
1
 E(Tbusy )  (
1
1
)
 
 
 An attractive alternative way to find E(Tbusy ) , E(Tbp )
E Tbp 
E Tidle 

1  p0

p0
1  (1 
1
- 73 -



)




1




 
Since E Tidle  
 E Tbp  
1

1
 
and
E Tbc  
1


1
 
(2.79)
 For M/M/c case
Tb ,i : i -channel busy period,
ic
 pi1 (t )  i pi (t )

 pi(t )  (  i ) pi (t )  (i  1)  pi 1 (t )

 pn (t )  (  n ) pn (t )   pn 1 (t )  (n  1)  pn 1 (t )

 pn (t )  (  c ) pn (t )   pn 1 (t )  c pn 1 (t )
,n  c
,n  c
Any resultant CDF Pi 1 (t ) would be in terms of modified
Bessel function.
- 74 -
Download