Stat333 Notes 2
Stat333 Notes 2
richardwu.ca
Table of Contents
1 January 4, 2018 1
1.1 Example 1.1 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Example 1.2 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 January 9, 2018 1
2.1 Example 1.3 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2.2 Example 1.4 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.3 Example 1.5 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Exercise 1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4 Tutorial 1 6
4.1 Exercise 1: MGF of Erlang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 Exercise 2: MGF of Uniform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.3 Exercise 3: Moments from PGF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.4 Exercise 4: PGF of Poisson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
7 Tutorial 2 16
7.1 Sum of geometric distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.2 Conditional card drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.3 Conditional points from interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
i
Winter 2018 STAT 333 Course Notes TABLE OF CONTENTS
10 Tutorial 3 27
10.1 Mixed conditional distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
10.2 Law of total expectations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
10.3 Conditioning on wins and losses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
11 February 1, 2018 30
11.1 Example 3.1 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
11.2 Example 3.2 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
11.3 Example 3.3 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
12 Tutorial 4 32
12.1 Law of total expectations with indicator variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
12.2 Discrete time Markov chain urn example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
12.3 Discrete time Markov chain weather example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
13 February 6, 2018 35
13.1 Example 3.4 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
13.2 Example 3.2 (continued) solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
13.3 Example 3.5 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
13.4 Theorem 3.1 (equivalent states have equivalent periods) . . . . . . . . . . . . . . . . . . . . . . . . 36
13.5 Example 3.6 solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
14 February 8, 2018 37
14.1 Theorem 3.2 (communication and recurrent state i implies recurrent state j) . . . . . . . . . . . . . 37
14.2 Theorem 3.3 (communication and recurrent state i implies mutual recurrence among all states) . . 38
14.3 Theorem 3.4 (finite-state DTMCs have at least one recurrent state) . . . . . . . . . . . . . . . . . . 38
15 Tutorial 5 39
15.1 Determining diagram, equivalence classes, period, and transience/recurrence of DTMC . . . . . . . 39
15.2 Discrete time Markov chain consecutive successes example . . . . . . . . . . . . . . . . . . . . . . . 40
15.3 Limiting behaviour of discrete Markov chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
ii
Winter 2018 STAT 333 Course Notes TABLE OF CONTENTS
18 Tutorial 6 49
18.1 Determining fi,i and recurrence using definition (infinite summation) from TPM . . . . . . . . . . 49
18.2 Making random walk recurrent with a reflecting boundary . . . . . . . . . . . . . . . . . . . . . . . 50
(n)
18.3 Determining pmf of Ni ∼ fi,i and the mean number of transitions between re-visit . . . . . . . . . 51
20 March 1, 2018 55
20.1 Example 3.12 solution (Gambler’s Ruin) (applying limiting probability) . . . . . . . . . . . . . . . 55
21 Tutorial 7 57
21.1 DTMCs and Ni (minimum n for Xn = i), transience and recurrence, limit probabilities, number of
transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
22 March 6, 2018 61
22.1 Example 3.11 (continued) solution (showing absorption probability equal limiting probabilities) . . 61
22.2 Example 3.13 solution (solving absorption probabilities) . . . . . . . . . . . . . . . . . . . . . . . . 62
22.3 Example 3.14 solution (absorbing states with absorbing recurrent classes) . . . . . . . . . . . . . . 64
22.4 Aside: n-step TPM (P (n) ) for absorbing DTMCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
22.5 Example 3.11 (continued) solution (mean absorption time wi ) . . . . . . . . . . . . . . . . . . . . . 65
22.6 Example 3.13 (continued) solution (mean absorption time wi ) . . . . . . . . . . . . . . . . . . . . . 66
22.7 Example 3.13 (continued) solution (average number of visits prior to absorption Si,l ) . . . . . . . . 66
23 Tutorial 8 67
23.1 Transforming problem into absorption problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
23.2 Mean recurrent time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
iii
Winter 2018 STAT 333 Course Notes TABLE OF CONTENTS
iv
Winter 2018 STAT 333 Course Notes 2 JANUARY 9, 2018
Abstract
These notes are intended as a resource for myself; past, present, or future students of this course, and anyone
interested in the material. The goal is to provide an end-to-end resource that covers all material discussed
in the course displayed in an organized manner. These notes are my interpretation and transcription of the
content covered in lectures. The instructor has not verified or confirmed the accuracy of these notes, and any
discrepancies, misunderstandings, typos, etc. as these notes relate to course’s content is not the responsibility of
the instructor. If you spot any errors or would like to contribute, please contact me directly.
1 January 4, 2018
1.1 Example 1.1 solution
What is the probability that we roll a number less than 4 given that we know it’s odd?
Solution. Let A = {1, 2, 3} (less than 4) and B = {1, 3, 5} (odd). We want to find P (A | B). Note that
A ∩ B = {1, 3} and there are six elements in the sample space S thus
2
P (A ∩ B) 6 2
P (A | B) = = 3 =
P (B) 6
3
2 January 9, 2018
2.1 Example 1.3 solution
Find the mgf of BIN (n, p) and use that to find E[X] and V ar(X).
Solution. Recall the binomial series is
m
m
X m
(a + b) = ax bm−x a, b ∈ R, m ∈ N
x
x=0
1
Winter 2018 STAT 333 Course Notes 2 JANUARY 9, 2018
So
y
p(x, y) 0 1 pX (x)
0 0.2 0 0.2
x 1 0 0.6 0.6
2 0.2 0 0.2
pY (y) 0.4 0.6 1
Note that
2
Winter 2018 STAT 333 Course Notes 2 JANUARY 9, 2018
where
2 X
X 1
E[XY ] = xyp(x, y) = (1)(1)(0.6) = 0.6
x=0 y=0
2
X
E[X] = xpX (x) = (1)(0.6) + (2)(0.2) = 0.6 + 0.4 = 1
x=0
X1
E[Y ] = ypY (y) = (1)(0.6) = 0.6
y=0
So Cov(X, Y ) = 0.6 − (1)(0.6) = 0. However, p(2, 0) = 0.2 6= pX (2)pY (0) = (0.2)(0.4) = 0.08, thus X and Y are
not independent (they are dependent).
ΦT (t) = E[etT ]
= E[et(X1 +...+Xn ) ]
= E[etX1 · . . . · etXn ]
= E[etX1 ] · . . . · E[etXn ] independence
Yn
= ΦXi (t)
i=1
3
Winter 2018 STAT 333 Course Notes 3 JANUARY 11, 2018
Proof.
y
p(x, y) 0 1 2 pX (x)
0 0 2/15 0 2/15
x 1 1/5 2/5 1/15 2/3
2 1/5 0 0 1/5
pY (y) 2/5 8/15 1/15 1
Then we have
2/15 1
p(0 | 1) = P (X = 0 | Y = 1) = =
8/15 4
2/5 3
p(1 | 1) = P (X = 1 | Y = 1) = =
8/15 4
0
p(2 | 1) = P (X = 2 | Y = 1) = =0
8/15
4
Winter 2018 STAT 333 Course Notes 3 JANUARY 11, 2018
x 0 1
p(x | 1) 1/4 3/4
We observe X | (Y = 1) ∼ Bern(3/4). We can take the known E[X] = p and V ar(X)p(1 − p) for X ∼ Bern(p),
thus
Solution. We want to find conditional pmf of X | (X1 + X2 = n). Let this conditional pmf be denoted by
p(x1 | n) = P (X1 = x1 | X1 + X2 = n)
P (X1 = x1 , X1 + X2 = n)
=
P (X1 + X2 = n)
Next, consider
P (X1 = x1 , X1 + X2 = n) = P (X1 = x1 , x1 + X2 = n)
= P (X1 = x1 , X2 = n − x1 )
= P (X1 = x1 )P (X2 = n − x1 ) independence
n 1 x1 n1 −x1 n2
= p (1 − p) · pn−x1 (1 − p)n2 −(n−x1 )
x1 n − x1
0 ≤ n − x1 ≤ n2
− n2 ≤ x1 − n ≤ 0
n − n2 ≤ x1 ≤ n
x1 = max{0, n − n2 }, . . . , min{n1 , n}
5
Winter 2018 STAT 333 Course Notes 4 TUTORIAL 1
Thus we have
P (X1 = x, X1 + x2 = n)
p(x1 | n) =
P (X1 + X2 = n)
n1 x1 n1 −x1 · n2 1 (1 − p)n2 −(n−x1 )
n−x
x1 p (1 − p) n−x1 p
= n1 +n2 n
n p (1 − p)n1 +n2 −n
n1 n2
x1 n−x1
= n1 +n2
n
4 Tutorial 1
4.1 Exercise 1: MGF of Erlang
Find the mgf of X ∼ Erlang(λ) and use it to find E[X], V ar(X).
Note that the Erlang’s pdf is for n ∈ Z+ and λ > 0
λn xn−1 e−λx
f (x) = x>0
(n − 1)!
Solution.
∞
λn xn−1 e−λx
Z
tX
ΦX (t) = E[e ]= etx dx
0 (n − 1)!
∞
λn xn−1 e−(λ−t)x
Z
= dx
0 (n − 1)!
Note that the term in the integral is similar to the pdf of Erlang but for λ = λ − t. So we try to fix it so the integral
is this pdf of Erlang
∞
λn xn−1 e−(λ−t)x
Z
ΦX (t) = dx
0 (n − 1)!
λ n ∞ (λ − t)n xn−1 e−(λ−t)x
Z
=( ) dx
λ−t 0 (n − 1)!
λ n
=( ) t<λ
λ−t
since the integral over the positive real line of the pdf of an Erlang(n, λ − t) is 1 and t < λ must hold so the rate
parameter λ − t is positive.
6
Winter 2018 STAT 333 Course Notes 4 TUTORIAL 1
Differentiating,
(1) d λ
ΦX (t) = ( )
dt (λ − t)n
nλn
=
(λ − t)n+1
(2) d nλn
ΦX (t) = ( )
dt (λ − t)n+1
n(n + 1)λn
=
(λ − t)n+2
Thus we have
(1) nλn n
E[X] = ΦX (0) = n+1
=
(λ − t) t=0 λ
n(n + 1)λ n n(n + 1)
(2)
E[X 2 ] = ΦX (0) = =
(λ − t)n+2 t=0 λ2
n(n + 1) n n
V ar(X) = E[X 2 ] − E[X]2 = 2
− = 2
λ λ λ
Remark 4.1. To solve any of these mgfs, it is useful to see if one can reduce the integral into a pdf of a known
distribution (possibly itself).
Differentiating
(1) d −1 t
ΦX (t) = (t (e − 1))
dt
= t−1 et − t−2 (et − 1)
tet − et + 1
=
t2
(2) d tet − et + 1
ΦX (t) = ( )
dt t2
t2 (tet + et − et ) − 2t(tet − et + 1)
=
t4
2 t t
t e − 2te + 2e − 2 t
=
t3
7
Winter 2018 STAT 333 Course Notes 4 TUTORIAL 1
We may calculate the first two moments by applying L’Hopital’s rule to calculate the limits
(1) tet − et + 1
E[X] = ΦX (t) = lim
t=0
t→∞ t2
tet + et − et
= lim
t→∞ 2t
e t 1
= lim =
t→∞ 2 2
Similarly
8
Winter 2018 STAT 333 Course Notes 4 TUTORIAL 1
Letting z = 1
∞
(2)
X
ΨX (1) = lim x(x − 1)z x−2 p(x)
z→1
x=2
∞
X
= x(x − 1)p(x)
x=2
∞
X
= x(x − 1)p(x)
x=0
= E[X(X − 1)]
= E[X 2 ] − E[X]
(2) (1)
So we have E[X 2 ] = ΨX (1) + ΨX (1). To find the variance
(2) (1) (1)
V ar(X) = ΨX (1) + ΨX (1) − (ΨX (1))2
λx
f (x) = e−λ x = 0, 1, 2, . . .
x!
Solution.
∞
X −λ
X (zλ)x
ΨX (z) = E[z ] = e
x!
x=0
−λ zλ
=e ·e
λ(z−1)
=e
where the second equality holds since the summation is the Taylor expansion of ezλ .
Differentiating
(1) d λ(z−1)
ΨX (z) = e
dz
= λeλ(z−1)
(2) d λ(z−1)
ΨX (z) = λe
dz
= λ2 eλ(z−1)
9
Winter 2018 STAT 333 Course Notes 5 JANUARY 16, 2018
10
Winter 2018 STAT 333 Course Notes 5 JANUARY 16, 2018
Pm
Cancelling out the eλ terms and let λY = i=1 λi
x
n! λj j (λY − λj )n−xj
p(xj | n) =
(n − xj )!xj ! λxYj n−x
λY j
n λj λj n−xj
= ( )xj (1 − )
xj λ Y λY
P (X = x, Y = y)
p(x | y) = P (X = x | Y = y) =
P (Y = y)
To find the support for x, note that from the graphical region, we realize that x = 0, 1, 2, . . . and y = 0, 1, 2, . . . , x
is equivalent to y = 0, 1, 2, . . . and x = y, y + 1, y + 2, . . ..
11
Winter 2018 STAT 333 Course Notes 5 JANUARY 16, 2018
So
∞ −λ x
X e λ x!
pY (y) = py (1 − p)x−y
x=y
x! (x − y)!y!
∞
λy e−λ py X λx−y (1 − p)x−y
=
y! x=y
(x − y)!
∞
e−λ (λp)y X [λ(1 − p)]x−y
=
y! x=y
(x − y)!
e−λ (λp)y λ(1−p)
= e
y!
e−λp (λp)y
= y = 0, 1, 2, . . .
y!
This resembles the POIson distribution with λ = λ(1 − p) but with a slightly modified domain.
So we see that
W | (Y = y) ∼ W + y
where W ∼ P OI(λ(1 − p)). This is the shifted Poisson pmf y units to the right (note that W and y are random
variables).
We can easily find the conditional expectations and variance e.g.
Determine the conditional distribution of X given Y = y where 0 < y < 1. Also calculate the mean of X | (Y = y).
(Note: the graphical region is a unit square box where the bottom left corner is at 0, 0: the inside of the box is the
support).
12
Winter 2018 STAT 333 Course Notes 6 JANUARY 18, 2018
Solution. Using our theory, we wish to find the conditional pdf of X | (Y = y) given by
f (x, y)
fX|Y (x | y) =
fY (y)
13
Winter 2018 STAT 333 Course Notes 6 JANUARY 18, 2018
Remark 6.1. The bounds on the integral are in terms of y: it is dependent on x in our f (x, y) definition.
Now
5e−3x−y
fY |X (y | x) =
5e−5x
= e−y+2x y > 2x
Note: recognize the conditional pdf of Y | (X = x) as that of a shifted exponential distribution (2x units to the
right). Specifically, we have
Y | (X = x) ∼ W + 2x
where W ∼ Exp(1). Thus E[Y | (X = x)] = E(W ) + 2x and V ar[Y | (X = x)] = V ar(W ).
14
Winter 2018 STAT 333 Course Notes 6 JANUARY 18, 2018
So
p(y | x)fX (x)
f (x | y) =
pY (y)
x (1 − x)1−y · 1
y
= 1
2
= 2xy (1 − x)1−y 0<x<1
= xfX (x)dx
−∞
= E[X]
15
Winter 2018 STAT 333 Course Notes 7 TUTORIAL 2
7 Tutorial 2
7.1 Sum of geometric distributions
Let Xi for i = 1, 2, 3 be independent geometric random variables having the same parameter p. Determine the value
3
X
P (Xj = xj | Xi = n)
i=1
Solution. Note that, by construction, the sum of k independent GEO(p) random variables is distributed as
N B(k, p). Recall that
P (Xj = xj ) · P ( 3i=1,i6=j Xi = n − xj )
P
= Xi ’s are independent
P ( 3i=1 Xi = n)
P
16
Winter 2018 STAT 333 Course Notes 7 TUTORIAL 2
y = 1, 2, . . . , N and x = y, y + 1, . . . , N
Remark 7.1. Whenever we want to find the marginal pmf/pdf for a given rv Y , we generally need to re-map the
support such that the support of Y is independent of the other rv X.
Note that
N N
X X 1
PY (y) = p(x, y) =
x=y x=y
xN
N
1 X1
= y = 1, 2, . . . , N
N x=y x
17
Winter 2018 STAT 333 Course Notes 7 TUTORIAL 2
1. Make assumptions about the marginal pdf f1 (x1 ) and conditional pdf f2|1 (x2 | x1 ).
Solution. 1. It makes sense that X1 ∼ U (0, 1) and X2 | (X1 = x1 ) ∼ U (0, x1 ) so that f1 (x1 ) = 1, 0 < x1 < 1
and f2|1 (x2 | x1 ) = x11 for 0 < x2 < x1 < 1.
0 < x2 < 1
x2 < x1 < 1
18
Winter 2018 STAT 333 Course Notes 7 TUTORIAL 2
f (x1 , x2 )
f1|2 (x1 | x2 ) =
f2 (x2 )
1
= 0 < x2 < x1 < 1
−x1 ln(x2 )
3. The probability that X1 + X2 ≥ 1 may be calculated by taking the double integral over the region R of their
support where X1 + X2 ≥ 1 holds. This region may be found as follows:
1
The region R is equivalent to the bounds 2 < x1 < 1 and 1 − x1 < x2 < x1 .
19
Winter 2018 STAT 333 Course Notes 8 JANUARY 23, 2018
E[X] = E[E[X | Y ]]
1
X
= E[X | Y = y]pY (y)
y=0
= (1 − p)E[X | Y = 0] + pE[X | Y = 1]
Note that
X | (Y = 1) = 1
with probability 1 (one success is equivalent to X = 1 for GEO(p)), and
X | (Y = 0) ∼ 1 + X
(the first one failed, we expect to take X more trials; same initial problem - recurse. See course notes for formal
proof).
20
Winter 2018 STAT 333 Course Notes 8 JANUARY 23, 2018
Thus we have
E[X 2 ] = E[E[X 2 | Y ]]
1
X
= E[X 2 | Y = y]pY (y)
y=0
= (1 − p)E[X 2 | Y = 0] + pE[X 2 | Y = 1]
= (1 − p)E[(1 + X)2 ] + p(1)2 from above
2
= (1 − p)E[1 + 2X + X ] + p
= (1 − p)(1 + 2E[X] + E[X 2 ]) + p
= 1 + 2(1 − p)E[X] + (1 − p)E[X 2 ]
2(1 − p)
⇒E[X 2 ](1 − (1 − p)) = 1 +
p
1 2(1 − p)
⇒E[X 2 ] = +
p p2
So we have
21
Winter 2018 STAT 333 Course Notes 8 JANUARY 23, 2018
Note that
V ar(E[X | Y ]) = V ar(v(Y ))
where v(Y ) = E[X | Y ] is a function of Y (not X!).
Therefore we have
as desired.
22
Winter 2018 STAT 333 Course Notes 9 JANUARY 25, 2018
So we have E[T | N ] = N µ.
Remark 8.2. We needed to first condition on a concrete N = n in order to unwrap the summation, then revert
back to the random variable N .
Thus we have
E[T ] = E[E[T | N ]] = E[N µ] = µE[N ]
which intuitively makes sense.
To find the variance:
We use our previous theorem on variance as expectation of conditionals
23
Winter 2018 STAT 333 Course Notes 9 JANUARY 25, 2018
Thus we have
Z ∞
P (X < Y ) = P (A) = P (A | Y = y)fY (y)dy law of total probability
Z−∞
∞
= P (X < Y | Y = y)fY (y)dy
Z−∞
∞
= P (X < y | Y = y)fY (y)dy
Z−∞
∞
= P (X < y)fY (y)dy X < y only depends on X; Y = y only depends on Y
Z−∞
∞
= P (X ≤ y)fY (y)dy X is a continuous rv
Z−∞
∞
= FX (y)fY (y)dy
−∞
Suppose that X and Y have the same distribution. We expect P (X < Y ) = 21 . Let’s verify it with our expression
Z ∞
P (X < Y ) = FX (y)fY (y)dy
−∞
Z ∞
= FY (y)fY (y)dy X∼Y
−∞
du
Let u = FY (y), thus dy = fY (y) ⇐⇒ du = fY (y)dy. So we have
Z 1
P (X < Y ) = udu domain for a CDF is [0, 1]
0
u2 1
=
2 0
1
=
2
9.2 Example 2.11 solution (P (X < Y ) where X ∼ EXP (λ1 ) and Y ∼ EXP (λ2 )
Suppose X ∼ Exp(λ1 ) and Y ∼ Exp(λ2 ) are independent exponential rvs. Show that
λ1
P (X < Y ) =
λ1 + λ2
24
Winter 2018 STAT 333 Course Notes 9 JANUARY 25, 2018
Solution. Let Nk be the rv which counts the number of trials needed to obtain k consecutive successes.
Current goal: we want to find E[Nk ].
Note: when n = 1, then we have N1 ∼ GEO(p), and so E[N1 ] = p1 .
For arbitrary k ≥ 2, we will try to find E[Nk ] using the law of total expectations, namely
E[Nk ] = E[E[Nk | W ]]
So we have
X
E[Nk ] = E[Nk | W = w]P (W = w)
w
= P (W = 0)E[Nk | W = 0] + P (W = 1)E[Nk | W = 1]
= (1 − p)E[Nk | W = 0] + pE[Nk | W = 1]
Note that
Nk | (W = 0) ∼ 1 + Nk
Nk | (W = 1) ∼?
We can’t simply have Nk | (W = 1) ∼ 1 + Nk−1 since Nk−1 does not guarantee that the k − 1 consecutive successes
are followed immediately after our first W = 1.
Perhaps we need another W , W = Nk−1 so we attempt to find
25
Winter 2018 STAT 333 Course Notes 9 JANUARY 25, 2018
Consider
E[Nk | Nk−1 = n]
conditional on Nk−1 = n, defin (
0 if the (n + 1)th trial is a failure
Y =
1 if the (n + 1)th trial is a success
Now we have
X
E[Nk | Nk−1 = n] = E[Nk | Nk−1 = n, Y = y]P (Y = y | Nk−1 = n)
y
Note that
Therefore
1 E[N1 ] 1 1
k = 2 ⇒ E[N2 ] = + = + 2
p p p p
1 E[N2 ] 1 1 1
k = 3 ⇒ E[N3 ] = + = + 2+ 3
p p p p p
..
.
k
X 1
E[Nk ] = k = 1, 2, 3, . . . by induction
pi
i=1
26
Winter 2018 STAT 333 Course Notes 10 TUTORIAL 3
1 1
p − pk+1
E[Nk ] =
1 − p1
10 Tutorial 3
10.1 Mixed conditional distribution
Suppose X is Erlang(n, λ) with pdf
λn xn−1 e−λx
fX (x) = x>0
(n − 1)!
Suppose Y | (X = x) is P OI(x) with pmf
e−x xy
pY |X (y | x) = y = 0, 1, 2, . . .
y!
Note that pY (y) is the Negative Binomial distribution shifted to the left n units. In other words, it counts the
number of “failures” before n successes, where the probability of success if λ/(λ + 1).
The distribution of X | (Y = y) is thus
pY |X (y | x)fX (x)
fX|Y (x | y) =
pY (y)
e−x xy λn xn−1 e−λx
y! (n−1)!
= (n+y−1)! λn
y!(n−1)! (λ+1)n+y
27
Winter 2018 STAT 333 Course Notes 10 TUTORIAL 3
2. Let {Xi }∞ i
i=0 an iid sequence where Xi ∼ BIN (10, 1/2 ), i = 0, 1, 2, . . .. Also let N ∼ P OI(λ) be independent
of each Xi . Find E[XN ].
N
Y n
Y
E[ Xi | N = n] = E[ Xi | N = n]
i=1 i=1
n
Y
= E[ Xi ] independence of Xi0 s and N
i=1
n
Y
= E[Xi ] independence of Xi0 s
i=1
n
Y 1
=
λ
i=1
1
=
λn
Thus by the law of total expectations
N
Y N
Y
E[ Xi ] = E[E[ Xi | N = n]]
i=1 i=1
∞
X 1
= (1 − p)n−1 p
λn
n=1
∞
p X
= (1 − p)n−1
λn
n=1
∞
p X 1 − p n−1
=
λ λ
n=1
∞
1 − p n−1
p X 1−p
= 1−
λ(1 − 1−p
λ ) n=1
λ λ
p 1−p
= summation of pmf of GEO( )
λ(1 − 1−p
λ )
λ
p
=
λ−1+p
1−p
provided that λ < 1 or 1 − p < λ.
28
Winter 2018 STAT 333 Course Notes 10 TUTORIAL 3
2. Condition on N = n we have
1 10
E[XN | N = n] = E[Xn | N = n] = E[Xn ] = 10 · n
= n
2 2
From the law of total expectations
Solution. Key idea: we condition on wins and losses each time until we can find some sort of recurrent relationship,
eliminating trivial cases along the way.
Let A denote the event that A is the overall winner, and Wi , Li denote that A wins or loses game i, respectively.
Then we have
1 1
P (A) = P (W1 )P (A | W1 ) + P (L1 )P (A | L1 ) = P (A | W1 ) + P (A | L1 )
2 2
We can then continue conditioning on subsequent games and their possible outcomes
1 1
P (A | W1 ) = P (A | W1 , W2 ) + P (A | W1 , L2 )
2 2
1 1
= (1) + [P (A | W1 , L2 , C wins)
2 2
1
+ P (A | W1 , L2 , C loses)]
2
1 1
= + P (A | W1 , L2 , C loses) P (A | W1 , L2 , C wins) = 0
2 4
since C wins twice in a row
1 1 1
= + [ P (A | W1 , L2 , C loses, W4 )
2 4 2
1
+ P (A | W1 , L2 , C loses, L4 )]
2
1 1
= + P (A | W1 , L2 , C loses, W4 ) P (A | W1 , L2 , C loses, L4 ) = 0
2 8
since B wins twice in a row
1 1
= + P (A | W1 ) since the probability is the same as
2 8
A winning its second game after a win
29
Winter 2018 STAT 333 Course Notes 11 FEBRUARY 1, 2018
8
Solving this recurrence we get P (A | W1 ) = 14 . Similarly
1 1
P (A | L1 ) = P (A | L1 , B wins) + P (A | L1 , B loses)
2 2
1 1 1
= [ P (A | L1 , B loses, W3 ) + P (A | L1 , B loses, L3 )] P (A | L1 , B wins) = 0
2 2 2
since B wins twice in a row
1
= P (A | L1 , B loses, W3 ) P (A | L1 , B loses, L3 ) = 0
4
since C wins twice in a row
1
= P (A | W1 )
4
2
So P (A | L1 ) = 14 .
5
Plugging this into our initial equation we get P (A) = 14 .
11 February 1, 2018
11.1 Example 3.1 solution
A particle moves along the state [0, 1, 2] according to a DTMC whose TPM is given by
0.7 0.2 0.1
P = 0 0.6 0.4
0.5 0 0.5
(3)
So P (X3 = 1 | X0 = 0) = P0,1 = 0.264.
30
Winter 2018 STAT 333 Course Notes 11 FEBRUARY 1, 2018
We see that all states communicate with each other (there is some path from state i to j and vice versa). Thre is
only one equivalence class, namely {0, 1, 2}. This is an irreduicble DTMC.
31
Winter 2018 STAT 333 Course Notes 12 TUTORIAL 4
From the diagram, there is only one equivalence class {0, 1, 2, 3}. This DTMC is irreducible.
Solution. From the state diagram there are two equivalence classes: {2} and {0, 1, 3}. Thus this DTMC is not
irreducible.
12 Tutorial 4
12.1 Law of total expectations with indicator variables
Suppose the number of people who get on the ground floor of an elevator follows P OI(λ). If there are m floors
above the ground floor and if each person is equally likely to get off at each of the m floors, independent of where
the others get off, calculate the expected number of stops the elevator will make before discharging all passengers.
32
Winter 2018 STAT 333 Course Notes 12 TUTORIAL 4
Solution. Let Xi denote the whether or not someone gets off at floor i, that is
(
0 no one gets off at floor i
Xi =
1 someone gets off at floor i
It is easier to think of the case where no one gets off at a floor. That is for N people
1 N
P (Xi ) = (1 − )
m
Since Xi is bernoulli, we have
1 n
E[Xi | N = n] = 1 − (1 − )
m
Let X = X1 + . . . + Xm denote the total number of stops for the elevator. Thus we have
∞
X Xm
E[X] = E[E[X | N = n]] = E[ Xi | N = n]pN (n)
n=0 i=1
∞
X 1 n e−λ λn
= m(1 − (1 − ) )·
m n!
n=0
∞ −λ n ∞ −λ 1 n
X e λ X e ((1 − m )λ)
= m[ − ]
n! n!
n=0 n=0
∞ −(1− 1 )λ 1 n
−λ X e m ((1 − m )λ)
= m[1 − e m ]
n!
n=0
−λ
= m(1 − e m )
where the second last and third last equality follows from the summation of Poisson distributions.
Solution. Since the determination of the number of white balls in the first urn in the nth step is only dependent
on the same information in the (n − 1)th step, the process {Xn , n = 0, 1, 2, . . .} satisfies the Markov property
assumption, and hence is a Markov chain.
Let Urn 1 contain i white balls and 3 − i black balls (and Urn 2 has 3 − i white balls and i black balls). There are 9
possible ways to choose a ball from each so we do a case analysis on what color ball is chosen from each
33
Winter 2018 STAT 333 Course Notes 12 TUTORIAL 4
So for i = 0, 1, 2, 3 we have
i2 2i(3 − i) (3 − i)2
Pi,i−1 = Pi,i = Pi,i+1
9 9 9
thus we have the TPM
0 1 0 0
1 4 4
0
P = 9 9 9
0 4 4 1
9 9 9
0 0 1 0
Solution. Let state 0, 1, 2 be the states for clear, overcast, and raining. Then we can easily construct the TPM
from the given probabilities of transitioning to the other states given an initial state
0.6 0.3 0.1
P = 0.2 0.5 0.3
0.4 0.2 0.4
Remark 12.1. We can’t just take α3,2 as the probability it rains on the third day then apply the multiplication
rule since we have some prior that the first day also rains. So we must use conditional probability here.
Thus we have
(2)
Where P (X2 = 2 | X0 = 2) = P2,2 since we already know day 0 has state 2.
34
Winter 2018 STAT 333 Course Notes 13 FEBRUARY 6, 2018
13 February 6, 2018
13.1 Example 3.4 solution
Consider the DTMC with TPM 1 2
3 0 0 3
1 1 1 1
P =2 4 8 8
0 0 1 0
3 1
4 0 0 4
which has equivalence classes {0, 3}, {1}, and {2}. Determine the period of each state.
Solution. Consider the state 0. There are many paths which we can go from state 0 to 0 in n steps, but one
obvious one is simply going from 0 to 0 n times which has probability (P0,0 )n . Therefore
(n)
P0,0 ≥ (P0,0 )n = (1/3)n > 0 ∀n ∈ Z+
(n)
Thus d(0) = gcd{n ∈ Z+ | P0,0 > 0} = gcd{1, 2, 3, . . .} = 1 (there is a way to get from 0 to 0 in any n ∈ Z+ steps,
so we take the gcd of Z+ which is 1).
In fact, since every term on the main diagonal of P is positive, the same argument holds for every state. Thus
d(1) = d(2) = d(3) = 1.
(note the bi-direction between 2 and 3). Determine the period for each state.
35
Winter 2018 STAT 333 Course Notes 13 FEBRUARY 6, 2018
36
Winter 2018 STAT 333 Course Notes 14 FEBRUARY 8, 2018
Clearly the DTMC is irreducible (i.e. there is just one class {0, 1, 2}).
Note that
(1)
P0,0 = 0
2
(2) 1 1
P0,0 ≥ P0,1 P1,0 = = >0
2 4
3
(3) 1 1
P0,0 ≥ P0,1 P1,2 P2,0 = = >0
2 8
14 February 8, 2018
14.1 Theorem 3.2 (communication and recurrent state i implies recurrent state j)
Theorem 14.1. If i ↔ j (communicate) and state i is recurrent, then state j is recurrent.
Proof. Since j ↔ j, ∃m, n ∈ N such that
(m)
Pi,j > 0
(n)
Pj,i > 0
37
Winter 2018 STAT 333 Course Notes 14 FEBRUARY 8, 2018
(m) (n)
since Pj,i , Pi,j > 0 and the series diverges by our premise. Therefore j is recurrent.
Remark 14.1. A by-product of the above theorem is that if i ↔ j and state i is transient, then state j is transient.
14.2 Theorem 3.3 (communication and recurrent state i implies mutual recurrence among
all states)
Theorem 14.2. If i ↔ j and state i is recurrent, then
Proof. Clearly the result is true if i = j. Therefore suppose that i 6= j. Since i ↔ j, the fact that state i is recurrent
implies that state j is recurrent by the previous theorem and fj.j = 1.
To prove fi,j = 1, suppose that fi,j < 1 and try to get a contradiction.
(n)
Since i ← j, ∃n ∈ Z+ such that Pj,i > 0 i.e. each time the DTMC visits state j, there is the possibility of being in
(n)
state i n time units later with probability Pj,i > 0.
If we are assuming that fi,j < 1, then this implies that the probability of returning to state j after visiting i in the
future is not guaranteed (as 1 − fi,j > 0). Therefore
This implies that 1 − fj,j > 0 or fj,j < 1, which is a contradiction. Therefore fi,j = 1.
14.3 Theorem 3.4 (finite-state DTMCs have at least one recurrent state)
Theorem 14.3. A finite-state DTMC has at least one recurrent state.
Proof. Equivalently, we want to show that not all states can be transient.
Suppose that {0, 1, 2, . . . , N } represents the states of the DTMC where N < ∞ (finite).
38
Winter 2018 STAT 333 Course Notes 15 TUTORIAL 5
To prove that not all states can be transient, we suppose they are all transient and try to get a contradiction.
Now for each i = 0, 1, . . . , N , if state i is assumed to be transient, we know that after a finite amount of time
(denoted by Ti ), state i will never be visited again. As a result, after a finite amount of time T = {T0 , T1 , . . . , Tn }
has gone by none of the states will be visited again.
However, the DTMC must be in some state after time T but we have exhausted all states fro the DTMC to be
in. This is a contradiction thus not all states can be transient in a finite state DTMC.
15 Tutorial 5
15.1 Determining diagram, equivalence classes, period, and transience/recurrence of DTMC
For the following Markov chain, draw its state transition diagram, determine its equivalence classes, and the periods
of states within each class, and determine whether they are transient or recurrent
0 1 0 0 0
0 2 1 0 0
3 3
1 4
P = 0 5 5 03 01
0 0 0
4 4
0 0 0 0 1
From the diagram we see the only closed loop path containing more than one state is 1 → 2 → 1, thus we have the
equivalence classes {0}, {1, 2}, {3}, {4}.
Clearly 0 → 1 with a probability of 1 so 0 is transient and its period is ∞.
Notice for states 1, 2, 3, 4 the main diagonal entries Pi,i > 0 so their periods are 1.
39
Winter 2018 STAT 333 Course Notes 15 TUTORIAL 5
(n)
For class {1, 2}, consider the values of f1,1
(1) 2
f1,1 = P (X1 = 1 | X0 = 1) = P1,1 =
3
(2) 1 1
f1,1 = P (X2 = 1, X1 6= 1 | X0 = 1) = P (X2 = 1, X1 = 2 | X0 = 1) = P1,2 P2,1 = ·
3 5
(3)
f1,1 = P (X3 = 1, X2 6= 1, X1 6= 1 | X0 = 1)
1 4 1
= P (X3 = 1, X2 = 2, X1 = 2 | X0 = 1) = P1,2 P2,2 P2,1 = ·
·
3 5 5
2
(4) 1 4 1
f1,1 = P (X4 = 1, X3 = 2, X2 = 2, X1 = 2 | X0 = 1) = P1,2 (P2,2 )2 P2,1 = · ·
3 5 5
n−2
(n) 1 4 1
f1,1 = P (Xn = 1, Xn−1 = 2, . . . , X2 = 2, X1 = 2 | X0 = 1) = P1,2 (P2,2 )n−2 P2,1 = · ·
3 5 5
So we have
∞
(n)
X
f1,1 = f1,1
n=1
∞
2 1 1 X 4 n−2
= + ·
3 3 5 5
n=2
∞
1 X 4 n
2
= +
3 15 5
n=0
2 1 1
= + 4
3 15 1 − 5
2 1
= +
3 3
=1
40
Winter 2018 STAT 333 Course Notes 15 TUTORIAL 5
say that the system is in state k at time n if we have ever observed at least k consecutive successes occur at least
once by time n. Finally, if we have not observed k consecutive successes by time n, and the nth trial was a failure,
then we say that the system is in state 0. Letting Xn denote the state of the system after the nth trial, calculate its
transition probability matrix.
Solution. Note at any state k = 1, 2, . . . , k − 1 we always have a probability of 1 − p of failing and going back to
state 0.
To transition from state k to state k + 1 successes, we must get a success on the next trial with probability p, unless
it’s already in state k.
Finally, once we reach state k (we have seen k consecutive successes), any successes or failures will not change the
system’s state at k, so Pk,k = 1.
Thus we have
0 1 2 ... k−2 k−1 k
0 1 − p p 0 ... 0 0 0
1
1 − p 0 p ... 0 0 0
2 1 − p 0 0 ... 0 0 0
P = ... ..
.
k−2 1 − p 0 0 ... 0 p 0
k−1 1 − p 0 0 . . . 0 0 p
k 0 0 0 ... 0 0 1
The corresponding state diagram of this DTMC is
0 1
0 1−p p
P =
1 0 1
Solution. We know the n-step TPM is simply the one-step TPM multipled by itself n times or
n
(n)
Y 1−p p
P =
0 1
i=1
41
Winter 2018 STAT 333 Course Notes 16 FEBRUARY 13, 2018
Note that
1
(n) (n−1) (n−1) (n−1) (n−1)
X
P0,0 = P0,k Pk,0 = P0,0 P0,0 + P0,1 P1,0 = P0,0 (1 − p) P1,0 = 0
k=0
(n−2) (1)
= P0,0 (1 − p)2 = . . . = P0,0 (1 − p)n−1 = (1 − p)n
1
(n) (n−1) (n−1) (n−1) (n−1)
X
P1,0 = P1,k Pk,0 = P1,0 P0,0 + P1,1 P1,0 = P1,0 (1 − p) P1,0 = 0
k=0
(n−2) (1)
= P1,0 (1 − p)2 = . . . = P1,0 (1 − p)n−1 = 0(1 − p)n−1 = 0
1
(n) (n−1) (n−1) (n−1) (n−1) (1)
X
P1,1 = P1,k Pk,1 = P1,0 P0,1 + P1,1 P1,1 = P1,1 1 = . . . = P1,1 = 1
k=0
for all n ∈ N. Using the fact that each row sum of a TPM must equal 1 we have
(n) (n)
P0,1 = 1 − P0,0 = 1 − (1 − p)n n∈N
So we have
0 1
p)n 1 − (1 − p)n
(n) 0 (1 −
P = n∈N
1 0 1
and by definition
(1 − p)n 1 − (1 − p)n
(n)
αn = α0 P = (1, 0) = ((1 − p)n , 1 − (1 − p)n )
0 1
Proof. Let us assume that Pi,j > 0 (one-step transition probability) and try to get a contradiction.
(n)
Then Pj,i = 0 ∀n ∈ Z+ otherwise states i, j communicate.
However, the DTMC, starting in state i, would have a positive probability of at least Pi,j of never returning to
state i. This contradicts the recurrence of state i, therefore we must have Pi,j = 0.
42
Winter 2018 STAT 333 Course Notes 16 FEBRUARY 13, 2018
Looking at the possible transitions that can take place among states 0, 1, and 3 we strongly suspect state 1 to be
transient (since there is a positive probability of never returning to state 1 if a transition to state 2 occurs). To
show this formally assume state 1 is recurrent and try to get a contradiction.
So if state 1 is recurrent, note that state 1 does not communicate with state 2. By theorem 3.5, we have that
P1,2 = 0, but in fact P1,2 = 18 > 0. This is a contradiction, so state 1 must be transient and so {0, 1, 3} is transient.
so state 0 is transient.
Furthermore (since state 2 is in its own equivalence class)
∞ ∞
(n)
X X
P2,2 = 0=0<∞
n=1 n=1
(1) 1
f1,1 = P1,1 =
3
AND
(n)
X
f1,1 = (2/3)(3/5)n−2 (2/5) n ≥ 2
n=2
43
Winter 2018 STAT 333 Course Notes 16 FEBRUARY 13, 2018
Now
∞ ∞
X (n) 1 X 2 3 n−2 2
f1,1 = f1,1 = ( )( ) ( )
3 3 5 5
n=1 n=2
1 2 2 X 3
= + ( )( ) ( )n−2
3 3 5 5
n=2
1 2 2 1
= + ( )( ) · 3
3 3 5 1− 5
=1
Solution. First of all since 0 < p < 1 all states clearly communicate with each other. This implies that {Xn , n ∈ N}
is an irreducible DTMC.
Hence we can determine its periodicity (and likewise its transcience/recurrence) by analyzing any state we wish.
Let us select state 0. Starting from state 0, note that state 0 cannot possibly visited in an odd number of transitions
since we are guaranteed to have the number of up(down) jumps exceed the number of down(up) jumps (try to brute
force this to see why).
(1) (3) (5)
Thus P0,0 = P0,0 = P0,0 = . . . = 0 or equivalent
(2n−1)
P0,0 = 0 ∀n ∈ Z+
However since it is clearly possible to return to state 0 in an even number of transitions, it immediately follows that
(2n)
P0,0 > 0 ∀n ∈ Z+ .
(n)
Hence d(0) = gcd{n ∈ Z+ | P0,0 > 0} = gcd{2, 4, 6, . . .} = 2.
Finally to determine whether state 0 is transient or recurrent, let us consider
∞ ∞ ∞
X (n)
X (2n)
X 2n n
P0,0 = P0,0 = p (1 − p)n
n
n=1 n=1 n=1
44
Winter 2018 STAT 333 Course Notes 16 FEBRUARY 13, 2018
an+1
L = lim
n→∞ an
(2(n+1))! n+1 (1 −
(n+1)!(n+1)! · p p)n+1
L= lim 2n! n n
n!n! · p (1 − p)
n→∞
4n2 + 6n + 2
= lim 2 · p(1 − p)
n→∞ n + 2n + 1
= 4p(1 − p)
45
Winter 2018 STAT 333 Course Notes 16 FEBRUARY 13, 2018
Note that if p 6= 12 then L < 1 which means state 0 is transient (and so is DTMC).
However, if p = 12 then L = 1 and the ratio test is inconclusive. We need another approach to handle p = 1
2 (this
approach can handle both p = 12 and p 6= 21 ).
Recall that fi,j = P (DTMC ever makes a future visit to state j | X0 = i).
Letting q = 1 − p and conditioning on the state of the DTMC at time 1 we have
Consider f2,0 : in order to visit state 0 from state 2, we first have to visit state 1 again, which happens with
probability f2,1 . This is equivalent to f1,0 , so f2,1 = f1,0 (probability of ever making a visit to the state one step
down).
Given you make a visit back to state 1, then we must make a visit back to state 0, which happens to with probability
f1,0 .
Putting this together we have
2
f2,0 = f2,1 · f1,0 = f1,0
Thus from equation 16.1 we have
2
f1,0 = q + p · f1,0
which is a quadratic in the form
2
pf1,0 − f1,0 + q = 0
46
Winter 2018 STAT 333 Course Notes 16 FEBRUARY 13, 2018
1 + |p − q|
r1 = ; or
2p
1 − |p − q|
r2 =
2p
must be inadmissible (intuitively: we see that if p < 0.5 then r1 will be bigger than 1 which is not possible for
probabilities so r1 does not work for all p).
To determine which it is, suppose that q > p. Then |p − q| = −(p − q) and the 2 roots become
1 − (p − q) q+q q
r1 = = = >1
2p 2p p
1 + (p − q) p+p
r2 = = =1
2p 2p
Thus we must have
1 − |p − q|
f1,0 =
2p
Note: using the exact same approach
1 − |p − q|
f−1,0 =
2q
With knowledge of f1,0 and f−1,0 we find that
f0,0 = 1 − (p − q)
=1−p+q
= 2q < 1
47
Winter 2018 STAT 333 Course Notes 17 FEBRUARY 15, 2018
which follows by taking P (1) and multiply it arbitrarily many times by P (2) (identity).
As such, limn→∞ P (n) does not exist since P (n) alternates between those two matrices..
(n) (n)
However, while limn→∞ P0,0 and limn→∞ P0,2 (and many other) do not exist, note that some limits do exist such as
(n)
lim P0,1 = 0
n→∞
and
(n)
lim P1,1 = 1
n→∞
Solution. There is only one equivalence class and so the DTMC is irreducible. Also it is straightforward to show
that the DTMC is aperiodic and recurrent.
It can be shown that
4 4 3
11 11 11
lim P (n) = 11
4 4
11
3
11
n→∞ 4 4 3
11 11 11
48
Winter 2018 STAT 333 Course Notes 18 TUTORIAL 6
(we can find this by using some software and repeatedly applying matrix exponentiation; we will later demonstrate
a way to solve this for certain DTMCs (see Example 3.10 (continued) solution (finding limiting probability using
BLT))).
(n)
Note that this matrix has identical rows. This implies that Pi,j converges to a value as n → ∞ which is the same
for all initial states i. In other words, there is a limiting probability the DTMC will be in state j as n → ∞ and
this probability is indepdendent of the initial states.
18 Tutorial 6
18.1 Determining fi,i and recurrence using definition (infinite summation) from TPM
Consider a DTMC {Xn , n = 0, 1, 2, . . .} with
0 1 2 3 4 5
1 1 1
0 4 2 0 4 0 0
1 1 3
1
5 2 10 0 0 0
2 3
2
5 0 5 0 0 0
P =
0
3 0 1 0 0 0
0 1 1
4 0 0 2 0 2
1
5 0 0 0 2 0 1
It is easy to show there are three equivalence classes {0, 1, 2, 3}, {4}, and {5}. Calculate f0,0 to show that state 0 is
recurrent (and hence its equivalence class is recurrent).
n=1 : 0→0
n=2 : 0→1→0
n≥3 : 0 → 1 → ... → 1 → 0
0 → 1 → ... → 1 → 2 → ... → 2 → 0
0 → 3 → 2 → ... → 2 → 0
49
Winter 2018 STAT 333 Course Notes 18 TUTORIAL 6
(n)
Thus we can compute f0,0
(1) 1
f0,0 = P0,0 =
4
(2) 11 1
f0,0 = P0,1 P1,0 = =
25 10
n−3
(n)
X
n−2 k n−3−k n−3
f0,0 = P0,1 P1,1 P1,0 + P0,1 P1,1 P1,2 P2,2 P2,0 + P0,3 P3,2 P2,2 P2,0
k=0
n−3
1 1 n−2 1 1 3 2 X 1 k 3 n−3−k 1 2 3 n−3
= + +
2 2 5 2 10 5 2 5 45 5
k=0
n−3
1 1 n−2 3 X 1 k 3 n−3−k 1 3 n−3
= + + n≥3
10 2 50 2 5 10 5
k=0
So we have
∞
(n)
X
f0,0 = f0,0
n=1
∞ n−3
( )
1 1 n−2 3 X 1 k 3 n−3−k 1 3 n−3
1 1 X
= + + + + n≥3
4 10 10 2 50 2 5 10 5
n=3 k=0
∞ ∞ m ∞
1 X 1 m 3 X X 1 k 3 m−k 1 X 3 m
1 1
= + + + +
4 10 20 2 50 2 5 10 5
m=0 m=0 k=0 m=0
∞ ∞
3 X X 1 k 3 m−k
1 1 1 1 1 1
= + + 1 + +
4 10 20 1 − 2 50 2 5 10 1 − 35
k=0 m=k
∞ ∞
1 1 1 3 X 1 k X 3 m−k 1
= + + + +
4 10 10 50 2 5 4
k=0 m=k
1 1 1 3 1 1 1
= + + + 1 3 +
4 10 10 50 1 − 2 1− 5
4
9 3 1
= + +
20 10 4
=1
as desired.
50
Winter 2018 STAT 333 Course Notes 18 TUTORIAL 6
Solution. It is clear to see that the DTMC is irreducible and has one equivalence class containing all the states.
Thus we only need to focus on a single state. Suppose state 0 is recurrent, then f0,0 = 1. Note that state 0
transitions to state 1 with a probability of 1 (P0,1 = 1), therefore f0,0 = f1,0 = 1. Letting q = 1 − p we can show that
2
f1,0 = q + pf2,0 = q + pf1,0
2 . Remember that we showed in class the
where we are condition on the state at time 2 and f2,0 = f2,1 f1,0 = f1,0
quadratic equation
2
pf1,0 − f1,0 + q = 0
has one solution where
1 − |p − q|
f1,0 =
2p
We plug in values for p, q. Specifically when p ≤ q or |p − q| = q − p
1 − (q − p) 2p
f1,0 = f0,0 = = =1
2p 2p
(n)
18.3 Determining pmf of Ni ∼ fi,i and the mean number of transitions between re-visit
Consider the DTMC with the TPM
0 1
0 α 1−α
P =
1 β 1−β
and assume α, β ∈ (0, 1) so the DTMC is irreducible (thus both states are recurrent). Find the pmf of N = min{n ∈
Z+ | Xn = 0} conditional on X0 = 0, use it to show that f0,0 = 1 and find the mean number of transitions between
successive visits to state 0.
(n)
Solution. By definition the pmf of N | (X0 = 0) is given as P (N = n | X0 = 0) = f0,0 for n ∈ Z+ . Thus
(1)
P (N = 1 | X0 = 0) = f0,0 = P0,0 = α
(n)
P (N = n | X0 = 0) = f0,0
n−2
= P0,1 P1,1 P1,0
= (1 − α)(1 − β)n−2 β n≥2
51
Winter 2018 STAT 333 Course Notes 18 TUTORIAL 6
Also note that the mean number of transitions mi between state i is defined as
∞
(n)
X
m0 = E[N | X0 = 0] = nf0,0
n=1
∞
X
= α + (1 − α)β n(1 − β)n−2
n=2
X∞
= α + (1 − α)β (m + 1)(1 − β)m−1
m=1
∞ ∞
!
1 X
m−1
X
m−1
= α + (1 − α)β m(1 − β) β+ (1 − β) β
β
m=1 m=1
by expectation and total probability of GEO(β) we have
1
= α + (1 − α) +1
β
1−α+β
=
β
Let α = 1/2 and β = 1/4. Evaluate E[N | X0 = 0] and find limn→∞ P (n) . What is the relationship between the
mean number of transitions and the limiting probability of being in state 0?
1−1/2+1/4
Solution. Note that we get m0 = 1/4 = 3. Furthermore note that we have
0 1
0 1/3 2/3
lim P (n) =
n→∞ 1 1/3 2/3
from R. This coincides with the Basic Limit Theorem (BLT) we proved in class for irreducible, aperiodic and
recurrent DTMCs where the limiting probability πi of being in some state i is equal to m1i (intuitively, since the
mean time of getting back to state 0 is 3 transitions, we are in some other state for the other two transitions. So
the limiting probability of observing a DTMC in state 0 is equal to the fraction of time we spend in that state 0).
52
Winter 2018 STAT 333 Course Notes 19 FEBRUARY 27, 2018
Furthermore we defined
∞
(n)
X
fi,j = P (DTMC ever makes a future visit to state j | X0 = i) = fi,j
n=1
53
Winter 2018 STAT 333 Course Notes 19 FEBRUARY 27, 2018
So we have
∞ ∞ X
n
(n) (k) (n−k)
X X
Pi,j = fi,j Pj,j
n=1 n=1 k=1
∞ ∞
(k) (n−k)
X X
= fi,j Pj,j
k=1 n=k
∞ ∞
(k) (l)
X X
= fi,j Pj,j l =n−k
k=1 l=0
∞
X (k) ∞
(l) (0)
X
= ( fi,j )(1 + Pj,j ) Pi,i = 1 ∀i
k=1 l=1
∞
(l)
X
= fi,j (1 + Pj,j )
l=1
∞
(l)
X
≤ 1+ Pj,j fi,j ≤ 1 since it’s a probability
l=1
< ∞ since jis transient so the summation is finite
P∞
Recall the nth term test: If limn→0 an 6= 0 or if the limit does not exist, then n=1 an diverges.
We can show by contradiction that if the series converges then the limit is 0.
By the nth term test for infinite series
(n)
lim Pi,j = 0
n→0
19.3 Example 3.10 (continued) solution (finding limiting probability using BLT)
Recall we were given the DTMC with TPM 1 1
2 2 0
P = 1 1 1
2 4 4
1 2
0 3 3
Find the limiting probability of this DTMC.
Solution. Clearly DTMC is irreducible, aperiodic and positive recurrent. The BLT conditions are met and
π = (π0 , π1 , π2 ) exists and satisfies
π = πP
πe0 = 1 e0 = (1, 1, . . . , 1)T
Thus we have
1 1
2 2 0
(π0 , π1 , π2 ) = (π0 , π1 , π2 ) 12 1
4
1
4
1 2
0 3 3
54
Winter 2018 STAT 333 Course Notes 20 MARCH 1, 2018
(we can disregard the π1 = . . . equation since it requires solving for the most terms and we have 4 equations for 3
unknowns). Solving the system we get
4
π0 = π1 =
11
3
π2 =
11
Recall we had
4 4 3
11 11 11 π0 π1 π2
lim P (n) = 4
11
4
11
3
11 = π0 π1 π2
n→∞ 4 4 3
11 11 11 π0 π1 π2
We observe that each row of P (n) converges to π as n → ∞.
20 March 1, 2018
20.1 Example 3.12 solution (Gambler’s Ruin) (applying limiting probability)
Consider a gambler who, at each play of a game, has probability p ∈ (0, 1) of winning one unit and probability
q = 1 − p of losing one unit. Assume that successive plays of the game are independent. If the gambler initially
begins with i units, what is the probability that the gambler’s fortune will reach N units (N < ∞) before reaching
0 units? This problem is often referred to as the Gambler’s Ruin Problem, with state 0 representing bankruptcy
and state N representing the jackpot.
Solution. For n ∈ N, define Xn as the gambler’s fortune after the nth play of the game. Therefore {Xn , n ∈ N} is
a DTMC with TPM
1 0 0 0 ... 0 0 0
q 0 p 0 . . . 0 0 0
0 q 0 p . . . 0 0 0
P = .
..
0 0 0 0 . . . q 0 p
0 0 0 0 ... 0 0 1
Where the TPM has entries Pij where i, j ∈ [0, N ] (for each i ∈ [1, N − 1], we have Pi(i−1) = q and Pi(i+1) = p.
P00 = PN N = 1 and all other Pmn = 0).
Note: States 0 and N are treated as absorbing states, therefore they are both recurrent.
States {1, 2, . . . , N − 1} belong to the same equivalence class and it is straightforward to see it is a transient class.
Goal: Determine P (i) for i = 0, 1, . . . , N which represents the probability that starting with i units, the gambler’s
fortune will eventually reach N units.
55
Winter 2018 STAT 333 Course Notes 20 MARCH 1, 2018
where the (0, 0) entry is 1 (0 state is recurrent), (0, N ) is 0 (can never reach state N from 0) and similarly for
(N, N ) and (N, 0).
Entries (i, N ) = P (i) by definition where P (0) = 0 and P (N ) = 1. Since the sum of the entries for a given row
must be 0, we get for entry (i, 0) as 1 − P (i).
Conditioning on the outcome of the very first game i = 1, 2 . . . , N − 1, we have
P (i) = p · P (i + 1) + q · P (i − 1)
(if we go up by 1 with probability p, then the probability of winning afterwards is P (i + 1) i.e. P (i + 1) = P (i | win)
and p = P (win). Similarly for q and P (i − 1)).
Note that p + q = 1, so we have
Note: the above k equations are linear in terms of the unknowns P (1), P (2), . . . , P (k + 1). Summing these k
56
Winter 2018 STAT 333 Course Notes 21 TUTORIAL 7
equations yields
k i
X q
P (k + 1) − P (1) = P (1)
p
i=1
k i
X q
⇒P (k + 1) = P (1) k = 0, 1, . . . , N − 1
p
i=0
k−1 i
X q
⇒P (k) = P (1) k = 1, 2, . . . , N
p
i=0
1
Letting k = N , we obtain for p 6= 2
N
q
1− p 1 − pq
1 = P (N ) = P (1) ⇒ P (1) =
− pq
N
1
1 − pq
21 Tutorial 7
21.1 DTMCs and Ni (minimum n for Xn = i), transience and recurrence, limit probabilities,
number of transitions
The state space S of DTMC is the set of all non-negative integers, namely S = {0, 1, 2, . . .}. For each i ∈ S, the
one-step transition probabilities have the form
α 2+i−α
Pi,i+1 = and Pi,0 =
2+i 2+i
57
Winter 2018 STAT 333 Course Notes 21 TUTORIAL 7
1. Explain why we must restrict α to the interval 0 ≤ α ≤ 2 in order for P to be a TPM when defined as above.
2. Let N0 = min{n ∈ Z+ | Xn = 0} be the time until the first return to state 0. For each value of α ∈ [0, 2], find
an expression for the pmf of N0 , conditional on X0 = 0.
3. For each value of α ∈ [0, 2], discuss the transience and recurrence of each state of S.
4. Letting 0 < α ≤ 2, find the mean recurrent time of state 0 and determine if the states of this DTMC are
positive or null recurrent.
5. For what values of α ∈ [0, 2] does the DTMC have a limiting distribution on S?
6. For the values of α where the Basic Limit Theorem is satisfied, find the limit probabilities {πj }j∈S .
7. Letting 0 < α ≤ 2, determine the expected number of of transitions to reach state 2, conditional on X0 = 0.
Solution. 1. Note that all transitions have some probability bounded by 0 ≤ Pi,j ≤ 1.
So for Pi,i+1 we have
α
0≤≤1⇒0≤α≤2+i
2+i
since the smallest value i can be is 0, then 0 ≤ α ≤ 2.
2. Note for each value α ∈ [0, 2] and by the structure of the DTMC we have
(1) α
f0,0 = P0,0 = 1 −
2
(2) α α
f0,0 = P0,1 P1,0 = · (1 − )
2 3
(3) α α α
f0,0 = P0,1 P1,2 P2,0 = · · (1 − )
2 3 4
(n) αn−1 α
f0,0 = P0,1 P1,2 . . . Pn−2,n−1 Pn−1,0 = · (1 − )
n! n+1
for n ∈ Z+ .
3. When α = 0, it is clear that only state 0 is recurrent and all other states are transient (since Pi,0 = 1 ∀i ∈ Z + ).
When α 6= 0, we note that all states are in one equivalence class, so we only focus on the transience one state
e.g. 0.
58
Winter 2018 STAT 333 Course Notes 21 TUTORIAL 7
So state 0 is recurrent and so are the other states, thus the DTMC is recurrent.
59
Winter 2018 STAT 333 Course Notes 21 TUTORIAL 7
If 0 < α ≤ 2, we know the DTMC is irreducible and positive recurrent. Also note that d(0) = gcd{2, 3, 4, . . .} =
1 implying that state 0 is aperiodic. Thus the conditions of the Basic Limit Theorem hold true and a unique
limiting distribution {πj }j∈S exists.
Putting both cases together a limiting distribution exists for all 0 ≤ α ≤ 2.
α
6. From part (e), 0 < α ≤ 2. From part (4) we see that π0 = eα −1 .
We can also derive π0 . From the Basic Limit Theorem, we have
∞
X
πj = πi Pi,j
i=0
∞
X
π1 = 1
i=0
Note Pi−1,i > 0 and Pi,0 > 0, and all other Pi,j = 0. Thus we have
∞ ∞
X X 2+i−α
π0 = πi Pi,0 = πi
2+i
i=0 i=0
α
π1 = π0 P0,1 = π0
2
α2
π2 = π1 P1,2 = π0
3!
α3
π3 = π2 P2,3 = π0
4!
..
.
αi
πi = π0 i∈S
(i + 1)!
P
Along with 1 = i∈S πi , we have enough equations to solve for each πi .
Solving for π0 we have
X α α2
1= πi = π0 + π0 + π0 + . . .
2! 3!
i∈S
∞
1 X αi
= π0 ·
α i!
i=1
∞
π0 X αi
= ( − 1)
α i!
i=0
π0 α
= (e − 1)
α
α
⇒π0 = α
e −1
1
which we recognize as m0 from (4). Therefore we have
αi+1
πi = ∀i ∈ S
(i + 1)!(eα − 1)
60
Winter 2018 STAT 333 Course Notes 22 MARCH 6, 2018
7. Let Ti denote the number of transitions to state 2 starting from state i. We want to find E[T0 ].
Conditioning on the state at step 1, we have
Likewise
Thus
2 α+6
E[T0 ] = +
α α2
3(α + 2)
=
α2
22 March 6, 2018
22.1 Example 3.11 (continued) solution (showing absorption probability equal limiting prob-
abilities)
Recall the earlier DTMC with TPM
1 0 0
P = 13 1
2
1
6
0 0 1
We previously claimed
1 0 0
lim P (n) = 32 0 13
n→0
0 0 1
(n)
Show that the absoprtion probabilities from transient state 1 into states 0 and 2 are equal to limn→∞ P1,0 and
(n)
limn→∞ P1,2 , respectively.
61
Winter 2018 STAT 333 Course Notes 22 MARCH 6, 2018
0∗ 1∗ 2∗
1 1 1
0∗ 2 3 6
P = 1∗ 0 1 0
2∗ 0 0 1
we get
62
Winter 2018 STAT 333 Course Notes 22 MARCH 6, 2018
1
4?
Since U = (I − Q)−1 R (matrix definition of absorption probability matrix) we need the inverse of
1 0 0.4 0.3 0.6 −0.3
I −Q= − =
0 1 0.1 0.3 −0.1 0.7
Recall if
a b −1 1 d −b
A= ⇒A =
c d ad − bc −c a
provided that ad − bc 6= 0. Thus we have
70 10
−1 1 0.7 0.3
(I − Q) = = 39
10
13
20
0.42 − 0.03 0.1 0.6 39 13
so we get
−1 0.589744 0.410256
U = (I − Q) R=
0.512821 0.487179
Thus U1,3 = 0.487179.
Now under the alternate set of initial conditions
P (DTMC ultimately in state 3) = P (final state 3 | X0 = 0)P (X0 = 0) + P (final state 3 | X0 = 1)P (X0 = 1)
3 1
= U0,3 + U1,3
4 4
3 1
= (0.410256) + (0, 487179)
4 4
≈ 0.429487
Alternatively we could calculate U1,3 using the definition of absorption probability as a system of equations
M
X −1
Ui,k = Ri,k + Qi,j Uj,k
j=0
63
Winter 2018 STAT 333 Course Notes 22 MARCH 6, 2018
Multiplying the first equation by 6 and subtracting one from the other we get
22.3 Example 3.14 solution (absorbing states with absorbing recurrent classes)
Consider the DTMC with TPM
0 1 2 3 4
0 0.4 0.3 0.2 0.1 0
1
0.1 0.3 0.3 0.3 0
P = 2
0 0 1 0 0
3 0 0 0 0.7 0.3
4 0 0 0 0.4 0.6
Suppose the DTMC starts off in state 1. What is the probability that the DTMC ultimately ends up in state 3?
(n)
Solution. Goal: find limn→∞ P1,3 . We can begin grouping states 3 and 4 together into a single state 3∗ resulting
in the revised TPM
0 1 2 3∗
0 0.4 0.3 0.2 0.1
1 0.1 0.3 0.3 0.3
P∗ =
0
2 0 1 0
3∗ 0 0 0 1
This is identical to the TPM from Example 3.13, so we have
U1,3 = 0.487179
Once in 3∗ , the DTMC will remain in recurrent class {3, 4} with associated TPM
3 4
3 0.7 0.3
4 0.4 0.6
Note: for this “smaller” DTMC, the conditions of the BLT are satisfied.
We can solve for limiting probabilities π3 , π4
0.7 0.3
(π3 , π4 ) = (π3 , π4 )
0.4 0.6
π3 + π4 = 1
4
We can show that π3 = 7 and π4 = 37 . Thus
(n) 4
lim P1,3 = U1,3∗ · π3 = (0.487179)( ) = 0.278388
n→∞ 7
64
Winter 2018 STAT 333 Course Notes 22 MARCH 6, 2018
Why?
(n)
lim P1,3 = lim P (Xn = 3 | X0 = 1)
n→∞ n→∞
lim {P (Xn = 3, XT = 2 | X0 = 1) + P (Xn = 3, XT = 3 | X0 = 1)}
n→∞
P (Xn = 3, XT = 2) = 0 since state 2 is absorbing, we have
lim P (Xn = 3, XT = 3 | X0 = 1)
n→∞
lim P (Xn = 3 | XT = 3∗ , X0 = 1)P (XT = 3∗ | X0 = 1)
n→∞
lim P3n−T
∗ ,3 U1,3∗
n→∞
n
lim P3,3 U1,3∗
n→∞
U1,3∗ π̇3
where
1 0 0
A = 0 0.7 0.3
0 0.4 0.6
So we have
Q2 QR + RA
n
2 (n) Q ?
P = ⇒P =
0 A2 0 An
(we solve for the ? quadrant).
Note that An is just A but with the lower right 4 elements as a separate matrix to the matrix power of n. Thus if
we take the limit as n → ∞ we get our limiting probability matrix (for the lower right 4 elements)
π1 π2
π3 π4
w0 = (I − Q)−1 e0
65
Winter 2018 STAT 333 Course Notes 22 MARCH 6, 2018
Looking at this particular TPM, given that the DTMC initially begins in state 0∗ , each transition will return to
state 0∗ with probability 12 or become absorbed into one of the two absorbing states with probability 13 + 16 = 12 .
Thus
1 1
T | (X0 = 0∗ ) ∼ GEO( ) ⇒ E[T | X0 = 0∗ ] = 1 = 2
2 2
22.7 Example 3.13 (continued) solution (average number of visits prior to absorption Si,l )
Consider the DTMC with TPM
0 1 2 3
0 0.4 0.3 0.2 0.1
1 0.1 0.3 0.3 0.3
P =
0
2 0 1 0
3 0 0 0 1
Given X0 = 1, what is the average number of visits to state 0 prior to absoprtion? Also what is the probability that
the DTMC ever makes a visit to state 0?
66
Winter 2018 STAT 333 Course Notes 23 TUTORIAL 8
23 Tutorial 8
23.1 Transforming problem into absorption problem
Recall the DTMC {Xn , n ∈ N} from Tutorial 7 with state space S = {0, 1, 2, . . .}. For each i ∈ S we had
α 2+i−α
Pi,i+1 = and Pi,0 =
2+i 2+i
resulting in the TPM
0 1 2 3 4 ...
2−α α
0 2 2 0 0 0 ...
3−α α
1
3 0 3 0 0 ...
4−α α
2
4 0 0 4 0 ...
P =
5−α α ..
3
5 0 0 0 5
.
6−α ..
4
6 0 0 0 0 .
.. .. .. ..
.. .. ..
. . . . . . .
In part (7) we determined the number of transitions to reach state 2, conditional on X0 = 0 (letting 0 ≤ α ≤ 2).
Show that we can solve this expected value using absorbing DTMC results.
Solution. We can transform our DTMC to an equivalent sub-DTMC with absorbing state 2 and TPM
0 1 2
2−α α
0 2 2 0
3−α α
P = 1
3 0 3
2 0 0 1
This sub-DTMC behaves the same up until the first visit to 2 which is all that we are concerned with. Thus the
expected number of transitions to 2 starting from state 0 is equivalent to the mean absorption time for state 0 or
w0 . That is
2−α α 2
w0 = 1 + Q0,0 w0 + Q0,1 w1 ⇒ w0 = 1 + w0 + w1 ⇒ w0 = + w1
2 2 α
3−α
w1 = 1 + Q1,0 w0 = 1 + w0
3
Thus we have
2 3−α 3 2+α 3(2 + α)
w0 = +1+ w0 ⇒ w0 = =
α 3 α α α2
as desired.
67
Winter 2018 STAT 333 Course Notes 24 MARCH 13, 2018
Solution. Note that the DTMC is ergodic and irreducible, thus the BLT applies here.
P (Xj = min{X1 , . . . , Xn }) = . . .
(n − 1)-fold intersection of events (no Xj < Xj term)
= P (Xj < X1 , Xj < X2 , . . . , X\
j < Xj , . . . , Xj < Xn )
Z ∞
= P (Xj < X1 , Xj < X2 , . . . , Xj < Xn | Xj = x)λj e−λj x dx
0
since Xj and {Xi }ni=1,i6=j are independent, we have
Z ∞
= P (X1 > x, X2 > x, . . . , Xn > x)λj e−λj x dx
0
since {Xi }ni=1,i6=j are independent, we have
Z ∞
= P (X1 > x)P (X2 > x) . . . P (Xn > x)λj e−λj x dx
Z0 ∞
= e−λ1 x · e−λ2 x · . . . · e−λn x λj e−λj x dx
0
Z ∞ n
λj X P
= Pn ( λi )e−( λi )x dx
i=1 λi 0 i=1
λj
= Pn
i=1 λi
68
Winter 2018 STAT 333 Course Notes 25 MARCH 15, 2018
Thus we have
P (X > y + z, X > y) P (X > y + z)
P (X > y + z | X > y) = =
P (X > y) P (X > y)
If X is memoryless, then P (X > y + z | X > y) = P (X > z).
The result immediately follows.
Backwards direction:
Conversely, if P (X > y + z) = P (X > y)P (X > z) ∀y, z ≥ 0, note that by conditional probability
1. What is the probability that the time until the very first switch breakdown exceeds 6 years?
Solution. We simply want to calculate P (X1 < X2 ). We showed in Example 2.11 that this is
λ1 1/10 1
P (X1 < X2 ) = = =
λ1 + λ2 1/10 + 1/5 3
3. If switch 3 is known to have lasted 2 years, what is the probability it will last at most 3 more years?
69
Winter 2018 STAT 333 Course Notes 26 MARCH 20, 2018
4. Consider only switches 1 and 2, what is the expected amount of time until they have both suffered a breakdown?
Thus by total probability and total expectations (we don’t have to worry about X1 = X2 since exponential is
continuous and P (X = c) = 0).
Proof. We will prove this by showing that their MGFs are equivalent (i.e. the MGF of the Poisson process is that
of P OI(λt)).
For t ≥ 0, let φt (u) = E[euN (t) ] the MGF of N (t) (where the MGF is parameterized by u).
70
Winter 2018 STAT 333 Course Notes 26 MARCH 20, 2018
For h ≥ 0, consider
0 ≤ P (N (h) = j) ≤ P (N (h) ≥ 2)
P (N (h) = j) P (N (h) ≥ 2)
⇒0 ≤ ≤
h h
P (N (h) = j) P (N (h) ≥ 2)
⇒0 ≤ lim ≤ lim Let h → 0
h→0 h h→0 h
P (N (h) = j)
⇒0 ≤ lim ≤0 P (N (h) = j) ∈ o(h)
h→0 h
71
Winter 2018 STAT 333 Course Notes 26 MARCH 20, 2018
We recognize this as the mgf of a P OI(λt) r.v. By the uniqueness property of MGFs, N (t) ∼ P OI(λt).
Proof. We begin by considering T1 (first arrival time) for t ≥ 0. Note that the tail probability of T1 is
We recognize this as the tail probability of an EXP (λ) r.v. thus T1 ∼ EXP (λ).
Next for s > 0 and t ≥ 0 consider
P (T2 > t | T1 = s)
=P (T2 > t | N (w) = 0 ∀w ∈ [0, s) and N (s) = 1)
=P (no events occur in (s, s + t] | N (w) = 0 ∀w ∈ [0, s) and N (s) = 1)
=P (N (s + t) − N (s) = 0 | N (w) = 0 ∀w ∈ [0, s) and N (s) = 1)
since conditional interval [0, s] does not overlap (s, s + t] by independent increments
=P (N (s + t) − N (s) = 0)
=P (N (t) = 0) by stationary increments
=e−λt
Note that e−λt is independent of s, thus T1 and T2 are independent r.v’s so P (T2 > t | T1 = s) = P (T2 > t) = e−λt
thus T2 ∼ EXP (λ). Carrying this out inductively leads to the desired result.
72
Winter 2018 STAT 333 Course Notes 27 MARCH 22, 2018
1. What is the probability that exactly 5 claims occur in the time interval (3.2, 5] (measured in years)?
Solution. Let N (t) be the number of claims arriving to the company in the interval [0, t].
Since {N (t), t ≥ 0} is a Poisson process with λ = 3.8, we want to find
2. What is the probability that the time between the 2nd and 4th claims is between 2 and 5 months?
Solution. Let T be the time between the 2nd and 4th claims, so T = T3 + T4 where T3 , T4 are independent
EXP (3.8) random variables representing the arrival times of the 3rd and 4th claims.
We know T ∼ Erlang(2, 3.8) which means
2−1
−3.8t
X (3.8t)j
P (T > t) = e = e−3.8t (1 + 3.8t)
j!
j=0
for t ≥ 0.
We wish to calculate (converted from months to years)
1 5 1 5
P ( < T ) = P (T > ) − P (T > ) ≈ 0.3367
6 12 6 12
3. If exactly 12 claims have occurred within the first 5 years, how many claims on average occurred within the
first 3.5 years?
Solution. We want to calculate E[N (3.5) | N (5) = 12]. Recall for s < t we have N (s) | (N (t) = n) ∼
Bin(n, st ), thus N (3.5) | (N (5) = 12) ∼ BIN (12, 3.5/5) so E[N (3.5) | N (5) = 12] = 12(3.5/5) = 42/5 = 8.4.
Remark 27.1. Without conditioning, N (3.5) ∼ P OI(3.8 · 3.5) so E[N (3.5)] = (3.8)(3.5) = 13.3 6= 8.4.
So conditioning on N (5) does indeed affect the mean of N (3.5).
4. At another competing insurance company, suppose fire damage claims arrive according to a Poisson process at
rate 2.9 claims per year. What is the probability that 3 claims arrive to this company before 2 claims arrive
to the first company? Assume insurance comapnies operate independently of each other.
Solution. Let N1 (t) denote the number of claims arriving to the 1st company by time t and N2 (t) denote
the number of claims arriving at the 2nd company.
We are assuming {N1 (t), t ≥ 0} (i.e. Poisson process at rate λ1 = 3.8) and {N2 (t), t ≥ 0} (i.e. Poisson process
at rate λ2 = 2.9) are independent processes.
In general
m−1
X n j
n+j−1 λ1 λ2
P (Sn(1) < (2)
Sm ) =
n−1 λ1 + λ2 λ1 + λ2
j=0
73
Winter 2018 STAT 333 Course Notes 28 MARCH 27, 2018
≈ 0.2191
(we don’t need to take the complement, but for clarity we did).
Solution. Let Nc (t) bbe the number of commercial claims by time t. Likewise Nb (t) and Nr (t) denote the number
of business and residential claims by time t, respectively.
It follows that (recall λ = 3.8 for the whole process)
P (Nc (4) < 5, Nb (4) < 5, Nr (4) < 5) = P (Nc (4) < 5) · P (Nb (4) < 5) · P (Nr (4) < 5) independence
4
! 4 ! 4 !
X e−2.28 (2.28)i X e−3.8 (3.8)i X e−9.12 (9.12)i
=
i! i! i!
i=0 i=0 i=0
= (0.91857)(0.66784)(0.05105)
≈ 0.0313
28.2 Theorem 4.5 (conditional distribution of first arrival time given N (t) = 1 is uniform)
Theorem 28.1. Suppose that {N (t), t ≥ 0} is a Poisson process at rate λ. Given N (t) = 1, the conditional
distribution of the first arrival time is uniformly distributed on [0, t]. That is S1 | (N (t) = 1) ∼ U (0, t).
Proof. In order to identify the conditional distribution S1 | (N (t) = 1), we consider the cdf of S1 | (N (t) = 1) which
74
Winter 2018 STAT 333 Course Notes 28 MARCH 27, 2018
we will denote
28.3 Theorem 4.6 (conditional joint distribution of n arrival times is the n order statistics
with U (0, t))
Theorem 28.2. Let {N (t), t ≥ 0} be a Poisson process at rate λ. Given N (t) = n, the conditional joint distribution
of the n arrival times is identical to the joint distribution of the n order statistics from the U (0, t) distribution.
That is
(S1 , S2 , . . . , Sn ) | (N (t) = n) ∼ (Y(1) , Y(2) , . . . , Y(n) )
where {Yi }ni=1 is an iid sequence of U (0, t) random variables.
75
Winter 2018 STAT 333 Course Notes 29 MARCH 29, 2018
Solution. Let N (t) count the number of customers arriving to the station by time t where N (t) ∼ P OI(λt).
Letting Si denote the arrival time of the ith customer to the station we have that Wi = t − Si represent the waiting
time of the ith customer.
The total waiting time of all customers is
N
X
W = (t) = Wi = t − Si
i=1
Remark 29.1. We cannot use the result of the random sum of random variables where E[W ] = E[N (t)]E[Wi ]
since two assumptions are violated here (1) N (t) and Wi are not independent and Wi ’s are not iid.
Note that
N (t)
X
E[W ] = E (t − Si )
i=1
∞ N (t)
X X
= E (t − Si ) | N (t) = n P (N (t) = n)
n=0 i=1
∞ n
" #
X X
= E (t − Si ) | N (t) = n P (N (t) = n) W = 0 if N (t) = 0
n=1 i=1
∞ n
" #
X X
= E nt − Si | N (t) = n P (N (t) = n)
n=1 i=1
∞
( " n #)
X X
= nt − E Si | N (t) = n P (N (t) = n)
n=1 i=1
By theorem 4.6, note that (S1 , . . . , Sn ) | N (t) = n ∼ (Y(1) , . . . , Y(n) ) where (Y(1) , . . . , Y(n) ) are the n order statistics
from U (0, t) distribution.
76
Winter 2018 STAT 333 Course Notes 29 MARCH 29, 2018
Thus
∞ n
( " #)
X X
E[W ] = nt − E Y(i) P (N (t) = n)
n=1 i=1
∞
( " n #)
X X
= nt − E Yi P (N (t) = n) summing over all Y(i) anyways
n=1 i=1
∞ n
( )
X X
= nt − E[Yi ] P (N (t) = n)
n=1 i=1
∞ n
( )
X t X
= nt − P (N (t) = n)
2
n=1 i=1
∞
X nt
= nt − P (N (t) = n)
2
n=1
∞
t X
= nP (N (t) = n)
2
n=0
t
= E[N (t)]
2
λt2
=
2
Note that E[Y(i) ] 6= 2t since it’s not just any Yi but the ith order statistics which depends on i, so we must do the
conversion in line 2.
29.2 Example 4.5 solution (pdf and joint probability of arrival times)
Satellites are launched at times according to a Poisson process at rate 3 per year.
During the past year, it was observed only two satellites were launched. What is the joint probability that the first
of these two satellites was launched in the first 5 months and the second satellite was launched prior to the last 2
months of the year?
Solution. Let {N (t), t ≥ 0} be the Poisson process at rate λ = 3 governing satellite launches. We are interested in
calculating
5 5
P (S1 ≤ , S2 ≤ | N (1) = 2)
12 6
Given N (1) = 2, we use Theorem 4.6 to obtain the conditional joint pdf of (S1 , S2 ) | (N (1) = 2) ∼ (Y(1) , Y(2) ) where
{Yi }2i=1 are iid U (0, 1).
Recall we have for the 2 order statistics pdf at time 1
2!
g(s1 , s2 ) = =2
12
for 0 < s1 < s2 < 1. We use this conditional joint pdf and integrate it over the follow region
77
Winter 2018 STAT 333 Course Notes 29 MARCH 29, 2018
Figure 29.1: The support of our pdf is the top left triangle in the diagram. We want to integrate over the shaded
region.
So
Z 5/12 Z 5/6
5 5
P (S1 ≤ , S2 ≤ | N (t) = 2) = 2 ds2 ds1
12 6 0 s1
Z 5/12 5/6
=2 (s2 ) ds1
0 s1
Z 5/12
5
=2 ( − s1 ) ds1
0 6
5s1 s21 5/12
=2 −
6 2 0
25
=
48
≈ 0.5208
Solution. Clearly X(t) ∈ N for all t ≥ 0. Moreover, by the way a Poisson process is constructed, we have
Ti ∼ EXP (vi = λ), i ∈ N.
The corresponding TPM of the embedded Markov chain looks like
0 1 2 3 4 ...
0 0 1 0 0 0 ...
1
0 0 1 0 0 ...
P = 2
0 0 0 1 0 ...
3
0 0 0 0 1 ...
.. .. .. .. .. .. ..
. . . . . . .
78