Markov Chain Part 2
Markov Chain Part 2
Noha Youssef
1 / 31
Table of Contents
Classification of States
Examples
2 / 31
Classification of States
Definition 1
(n)
A state j is accessible from state i if pij > 0 for some n ≥ 0.
Definition 2
State i and j communicate if both j is accessible from i and i is
accessible from j. Notation: i ←→ j . To communicate is an
equivalence relation:
I reflexivity: i always communicates with i.
I symmetry: if i communicates with j, then j communicates
with i (also by definition).
I transitivity: if i communicates with j and j communicates
with k, then i communicates with k
I Two states that communicate are said to belong to the same
equivalence class, and the state space S is divided into a
certain number of such classes.
3 / 31
Continued
Definition 3
A communicating class of states is closed if it is not possible to
leave that class. That is, the communicating class C is closed if
pij = 0 whenever i ∈ C and j ∈ / C.
Definition 4
A state i is said to be absorbing if the set {i} is a closed class. A
state i is absorbing if pii = 1.
4 / 31
Example 1
Consider the Markov chain below. It is assumed that when there is
an arrow from state i to state j then pij > 0. Find the equivalence
classes for this Markov chain.
Definition 5
The chain is irreducible if the state space S is a single
communicating class. i.e. all states communicate with each other.
Definition 6
A state is said to be recurrent if, any time that we leave that
state, we will return to that state in the future with probability
one. On the other hand, if the probability of returning is less than
one, the state is called transient. For any state i, we define
6 / 31
Example 2
7 / 31
Example 3
Consider the chain on states 0, 1, 2, 3 and
0.5 0.5 0 0
0.5 0.5 0 0
.
0.25 0.25 0.25 0.25
0 0 0 1
Is the chain reducible? This chain is not irreducible and it has
three classes {0, 1}, {2} and {3}.
Which states are recurrent and which are transient?
I State 0: in order to never return to 0 we need to go to state 1
and stay there forever. But the probability to stay at 1 n steps
is 0.5n which means that the probability to stay forever at 1 is
0.5∞ = 0. This implies that f0 = 1, i.e., 0 is recurrent.
I State 1: following similar logic as we did for state 0, this state
is recurrent.
I State 2: the only possibility of returning to 2 is to do so in
one step, so we have f2 = 0.25, and 2 is transient.
I State 3: it is recurrent since it is an absorbing state.
8 / 31
Definition 7
Remark: We are talking about the first return only when we talk
about a recurrent state.
Consider a discrete-time Markov chain. Let V be the total number
of visits to state i.
a) If i is a recurrent state, then P (V = ∞|X0 = i) = 1.
b) If i is a transient state, then V |X0 = i ∼ Geometric(1 − fii ).
(n)
c) recurrent if ∞
P
n=0 Pii = ∞.
(n)
d) transient if ∞
P
n=0 Pii < ∞.
9 / 31
Continued
Definition 8
A state i is periodic with
period d if d is the
smallest integer such that
(n)
pii = 0 for all n which
are not multiples of d. In
case d = 1, the state is
said to be aperiodic. If
periodic states i and j are
in the same class, then
their periods are the same.
Figure: Periodic states
10 / 31
Continued
11 / 31
Markov chains with different periods
12 / 31
Example 4
13 / 31
Example 5
For the Markov chain given above, answer the following questions:
How many classes are there? For each class, mention if it is recurrent
or transient.
Solution
There are three classes: Class 1 consists of one state, state 0, which
is a recurrent state. Class two consists of two states, states 1 and
2, both of which are transient. Finally, class three consists of one
state, state 3, which is a recurrent state. For States 0 and 3, once
you enter those states, you never leave them. We call them ab-
sorbing states.There are two absorbing states here. The process will
eventually get absorbed in one of them.
14 / 31
Example 6
15 / 31
Example 7
Consider the Markov chain with state space {1, 2, 3} and
transition matrix
0 0.4 0.6
1 0 0
1 0 0
16 / 31
Hitting Times
Definition 10
Hitting probability: hiA = P (HA < ∞|X0 = i) = P (for any n ≥
0 such that Xn ∈ A|X0 = i), i ∈ S.
17 / 31
Hitting Times
Remarks.
I The time HA to hit a given set A might be infinity (if the
chain never hits A).
I On the contrary, we say by convention that if X0 = i and
i ∈ A, then HA = 0 and hiA = 1.
I If A is an absorbing set of states (i.e. there is no way for the
chain to leave the set A once it has entered it), then the
probability hiA is called an absorption probability. A particular
case that will be of interest to us is when A is a single
absorbing state.
18 / 31
Hitting Probabilities
19 / 31
Example 8
Let set A = {1, 3} as shown The hitting probability for set A is:
I 1 starting from states 1 or 3 (We are starting in set A, so we
hit it immediately);
I 0 starting from states 4 or 5 (The set {4, 5} is a closed class,
so we can never escape out to set A)
I 0.3 starting from state 2 (We could hit A at the first step
(probability 0.3), but otherwise we move to state 4 and get
stuck in the closed class {4, 5} (probability 0.7)).
20 / 31
Continued
21 / 31
Theorem of Hitting Probabilities
22 / 31
Proof
Part 1:
Let us first prove that hiA is a solution of the system of equations.
If i ∈ A,then hiA = 1,. If i ∈
/ A, then
23 / 31
Proof
Part 2:
X X X
giA = pij gjA = pij + pij gjA
j∈S j∈A j ∈A
/
!
X X X X
= pij + pij pjk + pjk gkA
j∈A j ∈A
/ k∈A k∈A
/
= P (X1 ∈ A|X0 = i) + P (X2 ∈ A, X1 ∈
/ A|X0 = i)
XX
+ pij pjk gkA
j ∈A
/ k∈A
/
24 / 31
Proof
So finally, we obtain
25 / 31
Expected Hitting Times
26 / 31
Continued
Theorem 1
The vector of expected hitting times mA = (miA : i ∈ S) is the
minimal non-negative solution to the following equations:
P 0 for i ∈ A
miA =
1 + j ∈A/ p ij mjA for i∈
/A
27 / 31
Continued
Note that the process takes 1 step to get to state j at time 1, then
find E(TA ) from there. For i ∈
/ A then
X
miA = 1 + E(HA |X1 = j)P (X1 = j|X0 = i)
j∈S
X X
= 1+ mjA pij = 1 + pij mjA .
j∈S j ∈A
/
28 / 31
Example 1
29 / 31
Example 1
h14 0 0
h24 0.5h14 + 0.5h34 0.5 × 0 + 0.5h34
h34 = 0.5h24 + 0.5h44
=
0.5h24 + 0.5
h44 1 1
30 / 31
Example 1
b) Starting from state i = 2, we wish to find the expected time to
reach the set A = 1, 4 (the set of absorbing states).
P 0 for i ∈ {1, 4}
miA =
1 + j ∈A/ pij mjA for i∈/ {1, 4}
m1A = 0 for {1 ∈ A}
m4A = 0 for {4 ∈ A}
1
m2A = 1 + p22 m2A + p23 m3A = 1 + m3A
2
1 1 1
m3A = 1 + p32 m2A + p33 m3A = 1 + m2A = 1 + (1 + m3A ) = 2.
2 2 2
Thus
1 1
m2A = 1 + m3A = 1 + × 2 = 2.
2 2
31 / 31