Transcript Lecture 20
20. Extinction Probability for Queues
and Martingales
(Refer to section 15.6 in text (Branching processes) for
discussion on the extinction probability).
20.1 Extinction Probability for Queues:
• A customer arrives at an empty server and immediately goes
for service initiating a busy period. During that service period,
other customers may arrive and if so they wait for service.
The server continues to be busy till the last waiting customer
completes service which indicates the end of a busy
period. An interesting question is whether the busy periods
1
are bound to terminate at some point ? Are they ?
PILLAI
Do busy periods continue forever? Or do such
queues come to an end sooner or later? If so, how ?
•Slow Traffic ( 1)
Steady state solutions exist and the probability of extinction
equals 1. (Busy periods are bound to terminate with
probability 1. Follows from sec 15.6, theorem 15-9.)
•Heavy Traffic ( 1)
Steady state solutions do not exist, and such queues can be
characterized by their probability of extinction.
•Steady state solutions exist if the traffic rate 1. Thus
pk lim P X (nT ) k exists if 1.
n
•What if too many customers rush in, and/or the service
rate is slow ( 1) ? How to characterize such queues ?
2
PILLAI
Extinction Probability ( 0 ) for Population Models
X0 1
X0 1
Y2 2
2
X1 3
Y1
Y3 2
X2 9
X 3 26
Y1 3
Y2 3
Y3 3
Y4 3
Y5 3
Fig 20.1
Y6 3 Y7 3 Y8 3 Y9 3
3
PILLAI
Queues and Population Models
• Population models
X n : Size of the nth generation
Yi ( n ) : Number of offspring for the ith member of
the nth generation. From Eq.(15-287), Text
Xn
X n 1 Yk( n )
k 1
Let
ak = P{Yi ( n ) k}
• Offspring moment generating function:
P(z )
1
P ( z ) ak z k
k 0
(20-1)
a0
1
Fig 20.2
z
4
PILLAI
Pn 1 ( z ) P{ X n 1 k } z k E{z X n1 }
k 0
E ( E{ z
X n 1
Y
i 1 i
X n j}) E E z
X n j
j
E{[ P( z )] } {P( z )} P{ X n j} Pn ( P( z ))
j
j
(20-2)
j
Pn1 ( z ) Pn ( P( z )) P( Pn ( z ))
(20-3)
P{ X n k } ?
Extinction probability nlim
P{ X n 0} o ?
Extinction probability 0 satisfies the equation P( z ) z
which can be solved iteratively as follows:
z0 P(0) a0
(20-4)
and
zk P( zk 1 ) ,
k 1, 2,
(20-5)
5
PILLAI
• Review Theorem 15-9 (Text)
Let
E (Yi ) P (1) k P{Yi k} kak 0
k 0
(20-6)
k 0
P z
P z
1
a0
a0
1
Fig 20.3
0
1
1
(b) 1
1 0 1
(20-7)
1 0 is the unique solution of P( z ) z ,
a0 0 1
• Left to themselves, in the long run, populations either
die out completely with probability 0 , or explode with
6
probability 1- 0 . (Both unpleasant conclusions).
(a)
PILLAI
Queues :
X0
First
customer
Customers that arrive
during the first service time
X1
s1
Service time of
first customer
X2
Y2
Y1
s2
Service time of
second customer
X3
Y3
s3
s4
sk
Xn
Fig 20.4
X n 1 Yi
i 1
Busy period
t
k arrivals between two
ak P(Yi k ) P
0.
successive departures
Note that the statistics ak depends both on the arrival as well
as the service phenomena.
0
7
PILLAI
k
P
(
z
)
a
z
k : Inter-departure statistics generated by arrivals
•
k 0
• P(1) kak : Traffic Intensity 1
Steady state
k 1
1 Heavy traffic
• Termination of busy periods corresponds to extinction of
queues. From the analogy with population models the
extinction probability 0 is the unique root of the equation
}
P( z ) z
• Slow Traffic : 1 0 1
Heavy Traffic : 1 0 0 1
i.e., unstable queues ( 1) either terminate their busy periods
with probability 0 1 , or they will continue to be busy with
probability 1- 0 . Interestingly, there is a finite probability of
busy period termination even for unstable queues.
0 : Measure of stability for unstable queues.
8
PILLAI
Example 20.1 : M/M/ 1 queue
From (15-221), text,we have
k
k
1
ak
,
1 1
k 0, 1, 2,
(20-8)
P ( )
P( )
t
Number of arrivals between any two departures follows
a geometric random variable.
1
P( z )
,
(20-9)
[1 (1 z )]
P ( z ) z z 2 ( 1) z 1 ( z 1) ( z - 1) 0
1
0
1
1,
Fig 20.5
0 1
(20-10)
9
, 1
PILLAI
1
[x]
Example 20.2 : Bulk Arrivals M /M/ 1 queue
Compound Poisson Arrivals : Departures are exponential
random variables as in a Poisson process with parameter .
Similarly arrivals are Poisson with parameter . However each
arrival can contain multiple jobs.
P ( )
A2
A1
t1
Ai
t2
t
Fig 20.6
P( )
: Number of items arriving at instant ti
Let P{ Ai k} ck k 0, 1, 2,
,
and C ( z ) E{z } ck z k represents the bulk arrival statistics.
Ai
k 0
10
PILLAI
Inter-departure Statistics of Arrivals
P( z ) P{Y k} z k E{zY }
k 0
0 E{z ( A1 A2
An )
n 0
0 [ E{z }] e
Ai
n
n 0
0 e
n 0
t
t
n arrivals in (0,t )} P{n arrivals in (0,t )} f s (t) dt
(t )n
e t dt ,
n!
[ t C ( z )]n
1
n!
1 {1 C ( z )}
P( z ) [1 {1 C ( z )}]1 , Let ck (1 ) k ,
1
C( z)
,
1 z
(20-11)
k 0, 1, 2,
1 z
P( z )
1 (1 ) z
Traffic Rate P(1)
1
1
P ( z ) z (z - 1) [ (1 )z - 1] 0 0 1 /( (1 ))
(20-12)
11
PILLAI
Bulk Arrivals (contd)
• Compound Poisson arrivals with geometric rate
1
1
0
,
. (20-13)
(1 )
2
For , we obatain
3
3
1
0
,
(20-14)
2 (1 )
2
M/M/1
0
1
1
0
1
(a)
1
2
(b)
Fig 20.7
• Doubly Poisson arrivals
C ( z ) e (1 z ) gives
1
P( z )
z
1 [1 C ( z )]
(20-15)
12
PILLAI
Example 20.3 : M/En / 1 queue (n-phase exponential service)
From (16-213)
P( z ) 1 (1 z )
n
n
n
P( z ) z x n x n 1 x 0,
(20-16)
xz
1
n
2
1 1 8
n 2
, 1
0
2
0 (1 / n) n ,
n 1
(20-17)
2
M / M /1 n 1
0 0.5
M / E2 / 1 n 2
0 0.38
Example 20.4 : M/D/1 queue
Letting m in (16.213),text, we obtain P( z ) e (1 z ) ,
so that
0 e
(1 e )
,
1.
(20-18)
13
PILLAI
20.2 Martingales
Martingales refer to a specific class of stochastic processes
that maintain a form of “stability” in an overall sense. Let
{ X i , i 0} refer to a discrete time stochastic process. If n refers
to the present instant, then in any realization the random
variables X 0 , X 1 , , X n are known, and the future values
X n1 , X n 2 ,
are unknown. The process is “stable” in the sense
that conditioned on the available information (past and
present), no change is expected on the average for the future
values, and hence the conditional expectation of the
immediate future value is the same as that of the present
value. Thus, if
E{ X n 1 | X n , X n 1 ,
, X1 , X 0 } X n
(20-19)
14
PILLAI
for all n, then the sequence {Xn} represents a Martingale.
Historically martingales refer to the “doubling the stake”
strategy in gambling where the gambler doubles the bet on
every loss till the almost sure win occurs eventually at which
point the entire loss is recovered by the wager together with
a modest profit. Problems 15-6 and 15-7, chapter 15, Text
refer to examples of martingales. [Also refer to section 15-5,
Text].
If {Xn} refers to a Markov chain, then as we have
seen, with
pij P{ X n 1 j | X n i},
Eq. (20-19) reduces to the simpler expression [Eq. (15-224),
Text]
j pij i.
j
(20-20)
15
PILLAI
For finite chains of size N, interestingly, Eq. (20-20) reads
P x2 x2 ,
x2 [1, 2, 3,
, N ]T
(20-21)
implying that x2 is a right-eigenvector of the N N transition
probability matrix P ( pij ) associated with the eigenvalue 1.
However, the “all one” vector x1 [1, 1, 1, , 1]T is always
an eigenvector for any P corresponding to the unit eigenvalue
[see Eq. (15-179), Text], and from Perron’s theorem and the
discussion there [Theorem 15-8, Text] it follows that, for
finite Markov chains that are also martingales, P cannot be
a primitive matrix, and the corresponding chains are in fact
not irreducible. Hence every finite state martingale has
at least two closed sets embedded in it. (The closed sets in the
two martingales in Example 15-13, Text correspond to two
absorbing states. Same is true for the Branching Processes
discussed in the next example also. Refer to remarks
16
following Eq. (20-7)).
PILLAI
Example 20.5: As another example, let {Xn} represent the
branching process discussed in section 15-6, Eq. (15-287),
Text. Then Zn given by
Z n 0X n ,
Xn
X n 1
Yi
(20-22)
i 1
is a martingale, where Yi s are independent, identically
distributed random variables, and 0 refers to the extinction
probability for that process [see Theorem 15.9, Text].
To see this, note that
E{Z n 1 | Z n ,
, Z 0 } E{ 0X n1 | X n ,
k
Yi
E{ 0
i 0
, X 0}
X n k
| X n k } [ E{ 0Yi }] [ P( 0 )] X n 0X n Z n ,
i 1
since {X n } is
a Markov chain
since Yi s are
independent of Xn
(20-23)
use (15-2)
where we have used the Markov property of the chain,
17
PILLAI
the common moment generating function P(z) of Yi s, and
Theorem 15-9, Text.
Example 20.6 (DeMoivre’s Martingale): The gambler’s ruin
problem (see Example 3-15, Text) also gives rise to various
martingales. (see problem 15-7 for an example).
From there, if Sn refers to player A’s cumulative capital
at stage n, (note that S0 = $ a ), then as DeMoivre has observed
q
Yn p
Sn
(20-24)
generates a martingale. This follows since
Sn 1 Sn Z n 1
(20-25)
where the instantaneous gain or loss given by Zn+1 obeys
P{Z n 1 1} p,
and hence
E{Yn 1 | Yn , Yn 1 ,
P{Z n 1 1} q,
q
E{ p
q
, Y0 } E{ p
Sn 1
| Sn , Sn 1 ,
Sn Z n 1
| Sn },
(20-26)
, S0 }
18
PILLAI
since {Sn} generates a Markov chain.
Thus
E{Yn 1 | Yn , Yn 1 ,
q
, Y0 } p
Sn
q
q
p
p
p
1
q
q p
Sn
Yn (20-27)
i.e., Yn in (20-24) defines a martingale!
Martingales have excellent convergence properties
in the long run. To start with, from (20-19) for any given
n, taking expectations on both sides we get
E{ X n 1} E{ X n } E{ X 0 }.
(20-28)
Observe that, as stated, (20-28) is true only when n is known
or n is a given number.
As the following result shows, martingales do not fluctuate
wildly. There is in fact only a small probability that a large
deviation for a martingale from its initial value will occur.
19
PILLAI
Hoeffding’s inequality: Let {Xn} represent a martingale and
1 , 2 , , be a sequence of real numbers such that the random
variables
Yi
X i X i 1
i
1
with probability one.
(20-29)
Then
P{| X n X 0 | x} 2e
( x 2 / 2 in1 i2 )
(20-30)
Proof: Eqs. (20-29)-(20-30) state that so long as the
martingale increments remain bounded almost surely, then
there is only a very small chance that a large deviation occurs
between Xn and X0. We shall prove (20-30) in three steps.
(i) For any convex function f (x), and 0 1, we have
(Fig 20.8)
f ( x1 ) (1 ) f ( x2 ) f ( x1 (1 ) x2 ),
(20-31)
20
PILLAI
which for 12a , 1 12a ,
| a | 1, x1 1, x2 1 and
f ( x) e x , 0 gives
1
1
(1 a)e (1 a)e e a ,
2
2
f ( x)
f ( x2 )
f ( x1 ) (1 ) f ( x 2 )
f ( x1 (1 ) x2 )
f ( x1 )
| a | 1.
(20-32)
x1
x
x2
x (1 ) x
1
2
Fig 20.8
Replacing a in (20-32) with any zero mean random variable
Y that is bounded by unity almost everywhere, and taking
expected values on both sides we get
Y
E{e
2 /2
1
} 2 (e e ) e
(20-33)
Note that the right side is independent of Y in (20-33).
On the other hand, from (20-29)
E{Yi | X i ,
, X 1 , X 0 } E ( X i | X i 1 ) X i 1 X i 1 X i 1 0
(20-34)
and since Yi s are bounded by unity, from (20-32) we get
(as in (20-33))
21
PILLAI
Yi
E{e
| X i 1 ,
2 / 2
, X1, X 0} e
(20-35)
(ii) To make use of (20-35), referring back to the Markov
inequality in (5-89), Text, it can be rewritten as
P{ X } e E{e X }, 0
and with X X n X 0 and x, we get
(20-36)
P{ X n X 0 x} e x E{e ( X n X 0 ) }
(20-37)
But
E{e ( X n X 0 ) } E{e ( X n X n1 ) ( X n1 X 0 ) }
use (20-29)
E [ E{e ( X n1 X 0 ) e nYn | X n 1 ,
, X 1 , X 0 }]
E [e ( X n1 X 0 ) E{e nYn | X n 1 ,
, X 1 , X 0 }]
e
( X n 1 X 0 )
E{e
2 n2 / 2
}e
2 2
n /2
using (20-35)
2 in1 i2 / 2
e
.
(20-38)
22
PILLAI
Substituting (20-38) into (20-37) we get
P{ X n X 0 x} e
( x 2 in1 i2 / 2)
(20-39)
(iii) Observe that the exponent on the right side of (20-39) is
minimized for x / in1 i2 and hence it reduces to
P{ X n X 0 x} e
x 2 / 2 in1 i2
,
x 0.
(20-40)
The same result holds when Xn – X0 is replaced by X0 – Xn,
and adding the two bounds we get (20-30), the Hoeffding’s
inequality.
From (20-28), for any fixed n, the mean value
E{Xn} equals E{X0}. Under what conditions is this result
true if we replace n by a random time T ? i.e., if T is a
random variable, then when is
23
PILLAI
?
E{ X T }
E{ X 0 }.
(20-41)
The answer turns out to be that T has to be a stopping time.
What is a stopping time?
A stochastic process may be known to assume a
particular value, but the time at which it happens is in general
unpredictable or random. In other words, the nature of the
outcome is fixed but the timing is random. When that outcome
actually occurs, the time instant corresponds to a stopping
time. Consider a gambler starting with $a and let T refer to the
time instant at which his capital becomes $1. The random
variable T represents a stopping time. When the capital
becomes zero, it corresponds to the gambler’s ruin and that
instant represents another stopping time (Time to go home for
the gambler!)
24
PILLAI
Recall that in a Poisson process the occurrences of the first,
second, arrivals correspond to stopping times T1 , T2 , .
Stopping times refer to those random instants at which there
is sufficient information to decide whether or not a specific
condition is satisfied.
Stopping Time: The random variable T is a stopping time
for the process X(t), if for all t 0, the event {T t} is a
function of the values { X ( ) | 0, t} of the process up to
t, i.e., it should be possible to decide whether T has occurred
or not by the time t, knowing only the value of the process
X(t) up to that time t. Thus the Poisson arrival times T1 and T2
referred above are stopping times; however T2 – T1 is not
a stopping time.
A key result in martingales states that so long as
25
PILLAI
T is a stopping time (under some additional mild restrictions)
E{ X T } E{ X 0 }.
(20-42)
Notice that (20-42) generalizes (20-28) to certain random
time instants (stopping times) as well.
Eq. (20-42) is an extremely useful tool in analyzing
martingales. We shall illustrate its usefulness by rederiving the
gambler’s ruin probability in Example 3-15, Eq. (3-47), Text.
From Example 20.6, Yn in (20-24) refer to a martingale in the
gambler’s ruin problem. Let T refer to the random instant at
which the game ends; i.e., the instant at which either player A
loses all his wealth and Pa is the associated probability of ruin
for player A, or player A gains all wealth $(a + b) with
probability (1 – Pa). In that case, T is a stopping time
26
and hence from (20-42), we get
PILLAI
E{YT } E{Y0 }
q
p
a
(20-43)
since player A starts with $a in Example 3.15. But
E{YT }
q
p
0
Pa
Pa
q
p
a b
q
p
a b
(1 Pa )
(1 Pa ).
(20-44)
Equating (20-43)-(20-44) and simplifying we get
Pa
p
1 q
p
1 q
b
a b
(20-45)
that agrees with (3-47), Text. Eq. (20-45) can be used to derive
other useful probabilities and advantageous plays as well. [see
Examples 3-16 and 3-17, Text].
Whatever the advantage, it is worth quoting the master
Gerolamo Cardano (1501-1576) on this: “The greatest
advantage in gambling comes from not playing at all.” 27
PILLAI