Part IB — Markov Chains
Based on lectures by G. R. Grimmett
Notes taken by Dexter Chua
Michaelmas 2015
These notes are not endorsed by the lecturers, and I have modified them (often
significantly) after lectures. They are nowhere near accurate representations of what
was actually lectured, and in particular, all errors are almost surely mine.
Discrete-time chains
Definition and basic properties, the transition matrix. Calculation of
n
-step transition
probabilities. Communicating classes, closed classes, absorption, irreducibility. Calcu-
lation of hitting probabilities and mean hitting times; survival probability for birth
and death chains. Stopping times and statement of the strong Markov property. [5]
Recurrence and transience; equivalence of transience and summability of
n
-step transi-
tion probabilities; equivalence of recurrence and certainty of return. Recurrence as a
class property, relation with closed classes. Simple random walks in dimensions one,
two and three. [3]
Invariant distributions, statement of existence and uniqueness up to constant multiples.
Mean return time, positive recurrence; equivalence of positive recurrence and the
existence of an invariant distribution. Convergence to equilibrium for irreducible,
p ositive recurrent, aperiodic chains *and proof by coupling*. Long-run proportion of
time spent in a given state. [3]
Time reversal, detailed balance, reversibility, random walk on a graph. [1]
Contents
0 Introduction
1 Markov chains
1.1 The Markov property
1.2 Transition probability
2 Classification of chains and states
2.1 Communicating classes
2.2 Recurrence or transience
2.3 Hitting probabilities
2.4 The strong Markov property and applications
2.5 Further classification of states
3 Long-run behaviour
3.1 Invariant distributions
3.2 Convergence to equilibrium
4 Time reversal
0 Introduction
So far, in IA Probability, we have always dealt with one random variable, or
numerous independent variables, and we were able to handle them. However, in
real life, things often are dependent, and things become much more difficult.
In general, there are many ways in which variables can be dependent. Their
dependence can be very complicated, or very simple. If we are just told two
variables are dependent, we have no idea what we can do with them.
This is similar to our study of functions. We can develop theories about
continuous functions, increasing functions, or differentiable functions, but if we
are just given a random function without assuming anything about it, there
really isn’t much we can do.
Hence, in this course, we are just going to study a particular kind of dependent
variables, known as Markov chains. In fact, in IA Probability, we have already
encountered some of these. One prominent example is the random walk, in
which the next position depends on the previous position. This gives us some
dependent random variables, but they are dependent in a very simple way.
In reality, a random walk is too simple of a model to describe the world. We
need something more general, and these are Markov chains. These, by definition,
are random distributions that satisfy the Markov assumption. This assumption,
intuitively, says that the future depends only upon the current state, and not
how we got to the current state. It turns out that just given this assumption,
we can prove a lot about these chains.
1 Markov chains
1.1 The Markov property
We start with the definition of a Markov chain.
Definition (Markov chain). Let
X
= (
X
0
, X
1
, ···
) be a sequence of random
variables taking values in some set
S
, the state space. We assume that
S
is
countable (which could be finite).
We say
X
has the Markov property if for all
n ≥
0
, i
0
, ··· , i
n+1
∈ S
, we have
P(X
n+1
= i
n+1
| X
0
= i
0
, ··· , X
n
= i
n
) = P(X
n+1
= i
n+1
| X
n
= i
n
).
If X has the Markov property, we call it a Markov chain.
We say that a Markov chain
X
is homogeneous if the conditional probabilities
P(X
n+1
= j | X
n
= i) do not depend on n.
All our chains
X
will be Markov and homogeneous unless otherwise specified.
Since the state space
S
is countable, we usually label the states by integers
i ∈ N.
Example.
(i) A random walk is a Markov chain.
(ii) The branching process is a Markov chain.
In general, to fully specify a (homogeneous) Markov chain, we will need two
items:
(i)
The initial distribution
λ
i
=
P
(
X
0
=
i
). We can write this as a vector
λ = (λ
i
: i ∈ S).
(ii)
The transition probabilities
p
i,j
=
P
(
X
n+1
=
j | X
n
=
i
). We can write
this as a matrix P = (p
i,j
)
i,j∈S
.
We will start by proving a few properties of
λ
and
P
. These let us know
whether an arbitrary pair of vector and matrix (
λ, P
) actually specifies a Markov
chain.
Proposition.
(i) λ is a distribution, i.e. λ
i
≥ 0,
P
i
λ
i
= 1.
(ii) P is a stochastic matrix, i.e. p
i,j
≥ 0 and
P
j
p
i,j
= 1 for all i.
Proof.
(i) Obvious since λ is a probability distribution.
(ii) p
i,j
≥ 0 since p
ij
is a probability. We also have
X
j
p
i,j
=
X
j
P(X
1
= j | X
0
= i) = 1
since P(X
1
= · | X
0
= i) is a probability distribution function.
Note that we only require the row sum to be 1, and the column sum need
not be.
We will prove another seemingly obvious fact.
Theorem. Let
λ
be a distribution (on
S
) and
P
a stochastic matrix. The
sequence
X
= (
X
0
, X
1
, ···
) is a Markov chain with initial distribution
λ
and
transition matrix P iff
P(X
0
= i
0
, X
1
= i
1
, ··· , X
n
= i
n
) = λ
i
0
p
i
0
,i
1
p
i
1
,i
2
···p
i
n−1
,i
n
(∗)
for all n, i
0
, ··· , i
n
Proof. Let A
k
be the event X
k
= i
k
. Then we can write (∗) as
P(A
0
∩ A
1
∩ ···∩ A
n
) = λ
i
0
p
i
0
,i
1
p
i
1
,i
2
···p
i
n−1
,i
n
. (∗)
We first assume that X is a Markov chain. We prove (∗) by induction on n.
When n = 0, (∗) says P(A
0
) = λ
i
0
. This is true by definition of λ.
Assume that it is true for all n < N . Then
P(A
0
∩ A
1
∩ ··· ∩ A
N
) = P(A
0
, ··· , A
N−1
)P(A
0
, ··· , A
N
| A
0
, ··· , A
N−1
)
= λ
i
0
p
i
0
,i
1
···p
i
N −2
,i
N −1
P(A
N
| A
0
, ··· , A
N−1
)
= λ
i
0
p
i
0
,i
1
···p
i
N −2
,i
N −1
P(A
N
| A
N−1
)
= λ
i
0
p
i
0
,i
1
···p
i
N −2
,i
N −1
p
i
N −1
,i
N
.
So it is true for N as well. Hence we are done by induction.
Conversely, suppose that (
∗
) holds. Then for
n
= 0, we have
P
(
X
0
=
i
0
) =
λ
i
0
.
Otherwise,
P(X
n
= i
n
| X
0
= i
0
, ··· , X
n−1
= i
n−1
) = P(A
n
| A
0
∩ ··· ∩ A
n−1
)
=
P(A
0
∩ ··· ∩ A
n
)
P(A
0
∩ ··· ∩ A
n−1
)
= p
i
n−1
,i
n
,
which is independent of i
0
, ··· , i
n−2
. So this is Markov.
Often, we do not use the Markov property directly. Instead, we use the
following:
Theorem (Extended Markov property). Let
X
be a Markov chain. For
n ≥
0,
any
H
given in terms of the past
{X
i
:
i < n}
, and any
F
given in terms of the
future {X
i
: i > n}, we have
P(F | X
n
= i, H) = P(F | X
n
= i).
To prove this, we need to stitch together many instances of the Markov
property. Actual proof is omitted.
1.2 Transition probability
Recall that we can specify the dynamics of a Markov chain by the one-step
transition probability,
p
i,j
= P(X
n+1
= j | X
n
= i).
However, we don’t always want to take 1 step. We might want to take 2 steps, 3
steps, or, in general, n steps. Hence, we define
Definition (
n
-step transition probability). The
n
-step transition probability
from i to j is
p
i,j
(n) = P(X
n
= j | X
0
= i).
How do we compute these probabilities? The idea is to break this down into
smaller parts. We want to express
p
i,j
(
m
+
n
) in terms of
n
-step and
m
-step
transition probabilities. Then we can iteratively break down an arbitrary
p
i,j
(
n
)
into expressions involving the one-step transition probabilities only.
To compute
p
i,j
(
m
+
n
), we can think of this as a two-step process. We first
go from
i
to some unknown point
k
in
m
steps, and then travel from
k
to
j
in
n
more steps. To find the probability to get from
i
to
j
, we consider all possible
routes from i to j, and sum up all the probability of the paths. We have
p
ij
(m + n) = P(X
m+n
| X
0
= i)
=
X
k
P(X
m+n
= j | X
m
= k, X
0
= i)P(X
m
= k | X
0
= i)
=
X
k
P(X
m+n
= j | X
m
= k)P(X
m
= k | X
0
= i)
=
X
k
p
i,k
(m)p
k,j
(n).
Thus we get
Theorem (Chapman-Kolmogorov equation).
p
i,j
(m + n) =
X
k∈S
p
i,k
(m)p
k,j
(n).
This formula is suspiciously familiar. It is just matrix multiplication!
Notation. Write P (m) = (p
i,j
(m))
i,j∈S
.
Then we have
P (m + n) = P (m)P (n)
In particular, we have
P (n) = P (1)P (n − 1) = ··· = P (1)
n
= P
n
.
This allows us to easily compute the
n
-step transition probability by matrix
multiplication.
Example. Let S = {1, 2}, with
P =
1 − α α
β 1 − β
We assume 0 < α, β < 1. We want to find the n-step transition probability.
We can achieve this via diagonalization. We can write P as
P = U
−1
κ
1
0
0 κ
2
U,
where the κ
i
are eigenvalues of P , and U is composed of the eigenvectors.
To find the eigenvalues, we calculate
det(P − λI) = (1 − α − λ)(1 − β − λ) − αβ = 0.
We solve this to obtain
κ
1
= 1, κ
2
= 1 − α −β.
Usually, the next thing to do would be to find the eigenvectors to obtain
U
.
However, here we can cheat a bit and not do that. Using the diagonalization of
P , we have
P
n
= U
−1
κ
n
1
0
0 κ
n
2
U.
We can now attempt to compute p
1,2
. We know that it must be of the form
p
1,2
= Aκ
n
1
+ Bκ
n
2
= A + B(1 −α − β)
n
where
A
and
B
are constants coming from
U
and
U
−1
. However, we know well
that
p
1,2
(0) = 0, p
12
(1) = α.
So we obtain
A + B = 0
A + B(1 −α − β) = α.
This is something we can solve, and obtain
p
1,2
(n) =
α
α + β
(1 − (1 − α −β)
n
) = 1 − p
1,1
(n).
How about
p
2,1
and
p
2,2
? Well we don’t need additional work. We can obtain
these simply by interchanging α and β. So we obtain
P
n
=
1
α + β
β + α(1 − α − β)
n
α −α(1 −α −β)
n
β − β(1 − β − α)
n
α + β(1 − β − α)
n
What happens as n → ∞? We can take the limit and obtain
P
n
→
1
α + β
β α
β α
We see that the two rows are the same. This means that as time goes on, where
we end up does not depend on where we started. We will later (near the end of
the course) see that this is generally true for most Markov chains.
Alternatively, we can solve this by a difference equation. The recurrence
relation is given by
p
1,1
(n + 1) = p
1,1
(n)(1 − α) + p
1,2
(n)β.
Writing in terms of p
11
only, we have
p
1,1
(n + 1) = p
1,1
(n)(1 − α) + (1 −p
1,1
(n))β.
We can solve this as we have done in IA Differential Equations.
We saw that the Chapman-Kolmogorov equation can be concisely stated as
a rule about matrix multiplication. In general, many statements about Markov
chains can be formulated in the language of linear algebra naturally.
For example, let
X
0
have distribution
λ
. What is the distribution of
X
1
? By
definition, it is
P(X
1
= j) =
X
i
P(X
1
= j | X
0
= i)P(X
0
= i) =
X
i
λ
i
p
i,j
.
Hence this has a distribution
λP
, where
λ
is treated as a row vector. Similarly,
X
n
has the distribution λP
n
.
In fact, historically, Markov chains was initially developed as a branch of
linear algebra, and a lot of the proofs were just linear algebra manipulations.
However, nowadays, we often look at it as a branch of probability theory instead,
and this is what we will do in this course. So don’t be scared if you hate linear
algebra.
2 Classification of chains and states
2.1 Communicating classes
Suppose we have a Markov chain
X
over some state space
S
. While we would
usually expect the different states in
S
to be mutually interacting, it is possible
that we have a state
i ∈ S
that can never be reached, or we might get stuck in
some state
j ∈ S
and can never leave. These are usually less interesting. Hence
we would like to rule out these scenarios, and focus on what we call irreducible
chains, where we can freely move between different states.
We start with an some elementary definitions.
Definition (Leading to and communicate). Suppose we have two states
i, j ∈ S
.
We write
i → j
(
i
leads to
j
) if there is some
n ≥
0 such that
p
i,j
(
n
)
>
0, i.e.
it is possible for us to get from
i
to
j
(in multiple steps). Note that we allow
n = 0. So we always have i → i.
We write i ↔ j if i → j and j → i. If i ↔ j, we say i and j communicate.
Proposition. ↔ is an equivalence relation.
Proof.
(i) Reflexive: we have i ↔ i since p
i,i
(0) = 1.
(ii) Symmetric: trivial by definition.
(iii)
Transitive: suppose
i → j
and
j → k
. Since
i → j
, there is some
m >
0
such that
p
i,j
(
m
)
>
0. Since
j → k
, there is some
n
such that
p
j,k
(
n
)
>
0.
Then p
i,k
(m + n) =
P
r
p
i,r
(m)p
rk
(n) ≥ p
i,j
(m)p
j,k
(n) > 0. So i → k.
Similarly, if
j → i
and
k → j
, then
k → i
. So
i ↔ j
and
j ↔ k
implies
that i ↔ k.
So we have an equivalence relation, and we know what to do with equivalence
relations. We form equivalence classes!
Definition (Communicating classes). The equivalence classes of
↔
are commu-
nicating classes.
We have to be careful with these communicating classes. Different commu-
nicating classes are not completely isolated. Within a communicating class
A
,
of course we can move between any two vertices. However, it is also possible
that we can escape from a class
A
to a different class
B
. It is just that after
going to
B
, we cannot return to class
A
. From
B
, we might be able to get to
another space
C
. We can jump around all the time, but (if there are finitely
many communicating classes) eventually we have to stop when we have visited
every class. Then we are bound to stay in that class.
Since we are eventually going to be stuck in that class anyway, often, we can
just consider this final communicating class and ignore the others. So wlog we
can assume that the chain only has one communicating class.
Definition (Irreducible chain). A Markov chain is irreducible if there is a unique
communication class.
From now on, we will mostly care about irreducible chains only.
More generally, we call a subset closed if we cannot escape from it.
Definition (Closed). A subset C ⊆ S is closed if p
i,j
= 0 for all i ∈ C, j ∈ C.
Proposition. A subset C is closed iff “i ∈ C, i → j implies j ∈ C”.
Proof.
Assume
C
is closed. Let
i ∈ C, i → j
. Since
i → j
, there is some
m
such
that p
i,j
(m) > 0. Expanding the Chapman-Kolmogorov equation, we have
p
i,j
(m) =
X
i
1
,··· ,i
m−1
p
i,i
1
p
i
1
,i
2
, ··· , p
i
m−1
,j
> 0.
So there is some route
i, i
1
, ··· , i
m−1
, j
such that
p
i,i
1
, p
i
1
,i
2
, ··· , p
i
m−1
,j
>
0.
Since
p
i,i
1
>
0, we have
i
1
∈ C
. Since
p
i
1
,i
2
>
0, we have
i
2
∈ C
. By induction,
we get that j ∈ C.
To prove the other direction, assume that “
i ∈ C, i → j
implies
j ∈ C
”. So
for any i ∈ C, j ∈ C, then i → j. So in particular p
i,j
= 0.
Example. Consider S = {1, 2, 3, 4, 5, 6} with transition matrix
P =
1
2
1
2
0 0 0 0
0 0 1 0 0 0
1
3
0 0
1
3
1
3
0
0 0 0
1
2
1
2
0
0 0 0 0 0 1
0 0 0 0 1 0
1
2
3
4
5 6
We see that the communicating classes are {1, 2, 3}, {4}, {5, 6}, where {5, 6} is
closed.
2.2 Recurrence or transience
The major focus of this chapter is recurrence and transience. This was something
that came up when we discussed random walks in IA Probability — given a
random walk, say starting at 0, what is the probability that we will return to
0 later on? Recurrence and transience is a qualitative way of answering this
question. As we mentioned, we will mostly focus on irreducible chains. So by
definition there is always a non-zero probability of returning to 0. Hence the
question we want to ask is whether we are going to return to 0 with certainty, i.e.
with probability 1. If we are bound to return, then we say the state is recurrent.
Otherwise, we say it is transient.
It should be clear that this notion is usually interesting only for an infinite
state space. If we have an infinite state space, we might get transience because we
are very likely to drift away to a place far, far away and never return. However,
in a finite state space, this can’t happen. Transience can occur only if we get
stuck in a place and can’t leave, i.e. we are not in an irreducible state space.
These are not interesting.
Notation. For convenience, we will introduce some notations. We write
P
i
(A) = P(A | X
0
= i),
and
E
i
(Z) = E(Z | X
0
= i).
Suppose we start from
i
, and randomly wander around. Eventually, we may
or may not get to
j
. If we do, there is a time at which we first reach
j
. We call
this the first passage time.
Definition (First passage time and probability). The first passage time of
j ∈ S
starting from i is
T
j
= min{n ≥ 1 : X
n
= j}.
Note that this implicitly depends on
i
. Here we require
n ≥
1. Otherwise
T
i
would always be 0.
The first passage probability is
f
ij
(n) = P
i
(T
j
= n).
Definition (Recurrent state). A state i ∈ S is recurrent (or persistent) if
P
i
(T
i
< ∞) = 1,
i.e. we will eventually get back to the state. Otherwise, we call the state transient.
Note that transient does not mean we don’t get back. It’s just that we are
not sure that we will get back. We can show that if a state is recurrent, then
the probability that we return to i infinitely many times is also 1.
Our current objective is to show the following characterization of recurrence.
Theorem. i is recurrent iff
P
n
p
i,i
(n) = ∞.
The technique to prove this would be to use generating functions. We need to
first decide what sequence to work with. For any fixed
i, j
, consider the sequence
p
ij
(n) as a sequence in n. Then we define
P
i,j
(s) =
∞
X
n=0
p
i,j
(n)s
n
.
We also define
F
i,j
(S) =
∞
X
n=0
f
i,j
(n)s
n
,
where
f
i,j
is our first passage probability. For the sake of clarity, we make it
explicit that p
i,j
(0) = δ
i,j
, and f
i,j
(0) = 0.
Our proof would be heavily based on the result below:
Theorem.
P
i,j
(s) = δ
i,j
+ F
i,j
(s)P
j,j
(s),
for −1 < s ≤ 1.
Proof. Using the law of total probability
p
i,j
(n) =
n
X
m=1
P
i
(X
n
= j | T
j
= m)P
i
(T
j
= m)
Using the Markov property, we can write this as
=
n
X
m=1
P(X
n
= j | X
m
= j)P
i
(T
j
= m)
=
n
X
m=1
p
j,j
(n − m)f
i,j
(m).
We can multiply through by s
n
and sum over all n to obtain
∞
X
n=1
p
i,j
(n)s
n
=
∞
X
n=1
n
X
m=1
p
j,j
(n − m)s
n−m
f
i,j
(m)s
m
.
The left hand side is almost the generating function
P
i,j
(
s
), except that we
are missing an
n
= 0 term, which is
p
i,j
(0) =
δ
i,j
. The right hand side is the
“convolution” of the power series P
j,j
(s) and F
i,j
(s), which we can write as the
product P
j,j
(s)F
i,j
(s). So
P
i,j
(s) − δ
i,j
= P
j,j
(s)F
i,j
(s).
Before we actually prove our theorem, we need one helpful result from
Analysis that allows us to deal with power series nicely.
Lemma (Abel’s lemma). Let
u
1
, u
2
, ···
be real numbers such that
U
(
s
) =
P
n
u
n
s
n
converges for 0 < s < 1. Then
lim
s→1
−
U(s) =
X
n
u
n
.
Proof is an exercise in analysis, which happens to be on the first example
sheet of Analysis II.
We now prove the theorem we initially wanted to show
Theorem. i is recurrent iff
P
n
p
ii
(n) = ∞.
Proof. Using j = i in the above formula, for 0 < s < 1, we have
P
i,i
(s) =
1
1 − F
i,i
(s)
.
Here we need to be careful that we are not dividing by 0. This would be a
problem if F
ii
(s) = 1. By definition, we have
F
i,i
(s) =
∞
X
n=1
f
i,i
(n)s
n
.
Also, by definition of f
ii
, we have
F
i,i
(1) =
X
n
f
i,i
(n) = P(ever returning to i) ≤ 1.
So for
|s| <
1,
F
i,i
(
s
)
<
1. So we are not dividing by zero. Now we use our
original equation
P
i,i
(s) =
1
1 − F
i,i
(s)
,
and take the limit as
s →
1. By Abel’s lemma, we know that the left hand side
is
lim
s→1
P
i,i
(s) = P
i,i
(1) =
X
n
p
i,i
(n).
The other side is
lim
s→1
1
1 − F
i,i
(s)
=
1
1 −
P
f
i,i
(n)
.
Hence we have
X
n
p
i,i
(n) =
1
1 −
P
f
i,i
(n)
.
Since
P
f
i,i
(
n
) is the probability of ever returning, the probability of ever
returning is 1 if and only if
P
n
p
i,i
(n) = ∞.
Using this result, we can check if a state is recurrent. However, a Markov
chain has many states, and it would be tedious to check every state individually.
Thus we have the following helpful result.
Theorem. Let C be a communicating class. Then
(i) Either every state in C is recurrent, or every state is transient.
(ii) If C contains a recurrent state, then C is closed.
Proof.
(i)
Let
i ↔ j
and
i
=
j
. Then by definition of communicating, there is some
m
such that
p
i,j
(
m
) =
α >
0, and some
n
such that
p
j,i
(
n
) =
β >
0. So
for each k, we have
p
i,i
(m + k + n) ≥ p
i,j
(m)p
j,j
(k)p
j,i
(n) = αβp
j,j
(k).
So if
P
k
p
j,j
(
k
) =
∞
, then
P
r
p
i,i
(
r
) =
∞
. So
j
recurrent implies
i
recurrent. Similarly, i recurrent implies j recurrent.
(ii)
If
C
is not closed, then there is a non-zero probability that we leave the
class and never get back. So the states are not recurrent.
Note that there is a profound difference between a finite state space and an
infinite state space. A finite state space can be represented by a finite matrix,
and we are all very familiar with a finite matrices. We can use everything we
know about finite matrices from IA Vectors and Matrices. However, infinite
matrices are weirder.
For example, any finite transition matrix
P
has an eigenvalue of 1. This
is since the row sums of a transition matrix is always 1. So if we multiply
P
by e = (1
,
1
, ··· ,
1), then we get e again. However, this is not true for infinite
matrices, since we usually don’t usually allow arbitrary infinite vectors. To
avoid getting infinitely large numbers when multiplying vectors and matrices, we
usually restrict our focus to vectors x such that
P
x
2
i
is finite. In this case the
vector e is not allowed, and the transition matrix need not have eigenvalue 1.
Another thing about a finite state space is that probability “cannot escape”.
Each step of a Markov chain gives a probability distribution on the state space,
and we can imagine the progression of the chain as a flow of probabilities around
the state space. If we have a finite state space, then all the probability flow must
be contained within our finite state space. However, if we have an infinite state
space, then probabilities can just drift away to infinity.
More concretely, we get the following result about finite state spaces.
Theorem. In a finite state space,
(i) There exists at least one recurrent state.
(ii) If the chain is irreducible, every state is recurrent.
Proof.
(ii) follows immediately from (i) since if a chain is irreducible, either all
states are transient or all states are recurrent. So we just have to prove (i).
We first fix an arbitrary i. Recall that
P
i,j
(s) = δ
i,j
+ P
j,j
(s)F
i,j
(s).
If
j
is transient, then
P
n
p
j,j
(
n
) =
P
j,j
(1)
< ∞
. Also,
F
i,j
(1) is the probability
of ever reaching
j
from
i
, and is hence finite as well. So we have
P
i,j
(1)
< ∞
.
By Abel’s lemma, P
i,j
(1) is given by
P
i,j
(1) =
X
n
p
i,j
(n).
Since this is finite, we must have p
i,j
(n) → 0.
Since we know that
X
j∈S
p
i,j
(n) = 1,
if every state is transient, then since the sum is finite, we know
P
p
i,j
(
n
)
→
0
as n → ∞. This is a contradiction. So we must have a recurrent state.
Theorem (P´olya’s theorem). Consider
Z
d
=
{
(
x
1
, x
2
, ··· , x
d
) :
x
i
∈ Z}
. This
generates a graph with
x
adjacent to
y
if
|x −y|
= 1, where
| · |
is the Euclidean
norm.
d = 1
d = 2
Consider a random walk in
Z
d
. At each step, it moves to a neighbour, each
chosen with equal probability, i.e.
P(X
n+1
= j | X
n
= i) =
(
1
2d
|j − i| = 1
0 otherwise
This is an irreducible chain, since it is possible to get from one point to any
other point. So the points are either all recurrent or all transient.
The theorem says this is recurrent iff d = 1 or 2.
Intuitively, this makes sense that we get recurrence only for low dimensions,
since if we have more dimensions, then it is easier to get lost.
Proof.
We will start with the case
d
= 1. We want to show that
P
p
0,0
(
n
) =
∞
.
Then we know the origin is recurrent. However, we can simplify this a bit. It is
impossible to get back to the origin in an odd number of steps. So we can instead
consider
P
p
0,0
(2
n
). However, we can write down this expression immediately.
To return to the origin after 2
n
steps, we need to have made
n
steps to the left,
and n steps to the right, in any order. So we have
p
0,0
(2n) = P(n steps left, n steps right) =
2n
n
1
2
2n
.
To show if this converges, it is not helpful to work with these binomial coefficients
and factorials. So we use Stirling’s formula
n
!
≃
√
2πn
n
e
n
. If we plug this in,
we get
p
0,0
(2n) ∼
1
√
πn
.
This tends to 0, but really slowly, and even more slowly than the harmonic series.
So we have
P
p
0,0
(2n) = ∞.
In the
d
= 2 case, suppose after 2
n
steps, I have taken
r
steps right,
ℓ
steps
left,
u
steps up and
d
steps down. We must have
r
+
ℓ
+
u
+
d
= 2
n
, and we need
r
=
ℓ, u
=
d
to return the origin. So we let
r
=
ℓ
=
m, u
=
d
=
n −m
. So we get
p
0,0
(2n) =
1
4
2n
n
X
m=0
2n
m, m, n − m, n − m
=
1
4
2n
n
X
m=0
(2n)!
(m!)
2
((n − m)!)
2
=
1
4
2n
2n
n
n
X
m=0
n!
m!(n − m)!
2
=
1
4
2n
2n
n
n
X
m=0
n
m
n
n − m
We now use a well-known identity (proved in IA Numbers and Sets) to obtain
=
1
4
2n
2n
n
2n
n
=
"
2n
n
1
2
2n
#
2
∼
1
πn
.
So the sum diverges. So this is recurrent. Note that the two-dimensional
probability turns out to be the square of the one-dimensional probability. This
is not a coincidence, and we will explain this after the proof. However, this does
not extend to higher dimensions.
In the d = 3 case, we have
p
0,0
(2n) =
1
6
2n
X
i+j+k=n
(2n)!
(i!j!k!)
2
.
This time, there is no neat combinatorial formula. Since we want to show this is
summable, we can try to bound this from above. We have
p
0,0
(2n) =
1
6
2n
2n
n
X
n!
i!j!k!
2
=
1
2
2n
2n
n
X
n!
3
n
i!j!k!
2
Why do we write it like this? We are going to use the identity
X
i+j+k=n
n!
3
n
i!j!k!
=
1. Where does this come from? Suppose we have three urns, and throw
n
balls
into it. Then the probability of getting
i
balls in the first,
j
in the second and
k
in the third is exactly
n!
3
n
i!j!k!
. Summing over all possible combinations of
i
,
j
and
k
gives the total probability of getting in any configuration, which is 1. So
we can bound this by
≤
1
2
2n
2n
n
max
n!
3
n
i!j!k!
X
n!
3
n
i!j!k!
=
1
2
2n
2n
n
max
n!
3
n
i!j!k!
To find the maximum, we can replace the factorial by the gamma function and
use Lagrange multipliers. However, we would just argue that the maximum can
be achieved when i, j and k are as close to each other as possible. So we get
≤
1
2
2n
2n
n
n!
3
n
1
⌊n/3⌋!
3
≤ Cn
−3/2
for some constant
C
using Stirling’s formula. So
P
p
0,0
(2
n
)
< ∞
and the chain
is transient. We can prove similarly for higher dimensions.
Let’s get back to why the two dimensional probability is the square of the one-
dimensional probability. This square might remind us of independence. However,
it is obviously not true that horizontal movement and vertical movement are
independent — if we go sideways in one step, then we cannot move vertically.
So we need something more sophisticated.
We write
X
n
= (
A
n
, B
n
). What we do is that we try to rotate our space.
We are going to record our coordinates in a pair of axis that is rotated by 45
◦
.
A
B
(A
n
, B
n
)
V
U
U
n
/
√
2
V
n
/
√
2
We can define the new coordinates as
U
n
= A
n
− B
n
V
n
= A
n
+ B
n
In each step, either
A
n
or
B
n
change by one step. So
U
n
and
V
n
both change by
1. Moreover, they are independent. So we have
p
0,0
(2n) = P(A
n
= B
n
= 0)
= P(U
n
= V
n
= 0)
= P(U
n
= 0)P(V
n
= 0)
=
"
2n
n
1
2
2n
#
2
.
2.3 Hitting probabilities
Recurrence and transience tells us if we are going to return to the original
state with (almost) certainty. Often, we would like to know something more
qualitative. What is the actual probability of returning to the state
i
? If we
return, what is the expected duration of returning?
We can formulate this in a more general setting. Let
S
be our state space,
and let
A ⊆ S
. We want to know how likely and how long it takes for us to
reach
A
. For example, if we are in a casino, we want to win, say, a million, and
don’t want to go bankrupt. So we would like to know the probability of reaching
A = {1 million} and A = {0}.
Definition (Hitting time). The hitting time of
A ⊆ S
is the random variable
H
A
=
min{n ≥
0 :
X
n
∈ A}
. In particular, if we start in
A
, then
H
A
= 0. We
also have
h
A
i
= P
i
(H
A
< ∞) = P
i
(ever reach A).
To determine hitting times, we mostly rely on the following result:
Theorem. The vector (h
A
i
: i ∈ S) satisfies
h
A
i
=
(
1 i ∈ A
P
j∈S
p
i,j
h
A
j
i ∈ A
,
and is minimal in that for any non-negative solution (
x
i
:
i ∈ S
) to these
equations, we have h
A
i
≤ x
i
for all i.
It is easy to show that
h
A
i
satisfies the formula given, but it takes some more
work to show that
h
A
i
is the minimal. Recall, however, that we have proved a
similar result for random walks in IA probability, and the proof is more-or-less
the same.
Proof. By definition, h
A
i
= 1 if i ∈ A. Otherwise, we have
h
A
i
= P
i
(H
A
< ∞) =
X
j∈S
P
i
(H
A
< ∞ | X
1
= j)p
i,j
=
X
j∈S
h
A
j
p
i,j
.
So h
A
i
is indeed a solution to the equations.
To show that
h
A
i
is the minimal solution, suppose
x
= (
x
i
:
i ∈ S
) is a
non-negative solution, i.e.
x
i
=
(
1 i ∈ A
P
j∈S
p
i,j
x
j
A i ∈ A
,
If i ∈ A, we have h
A
i
= x
i
= 1. Otherwise, we can write
x
i
=
X
j
p
i,j
x
j
=
X
j∈A
p
i,j
x
j
+
X
j∈A
p
i,j
x
j
=
X
j∈A
p
i,j
+
X
j∈A
p
i,j
x
j
≥
X
j∈A
p
i,j
= P
i
(H
A
= 1).
By iterating this process, we can write
x
i
=
X
j∈A
p
i,j
+
X
j∈A
p
i,j
X
k
p
i,k
x
k
!
=
X
j∈A
p
i,j
+
X
j∈A
p
i,j
X
k∈A
p
i,k
x
k
+
X
k∈A
p
i,k
x
k
≥ P
i
(H
A
= 1) +
X
j∈A,k∈A
p
i,j
p
j,k
= P
i
(H
A
= 1) + P
i
(H
A
= 2)
= P
i
(H
A
≤ 2).
By induction, we obtain
x
i
≥ P
i
(H
A
≤ n)
for all n. Taking the limit as n → ∞, we get
x
i
≥ P
i
(H
A
≤ ∞) = h
A
i
.
So h
A
i
is minimal.
The next question we want to ask is how long it will take for us to hit
A
.
We want to find
E
i
(
H
A
) =
k
A
i
. Note that we have to be careful — if there is a
chance that we never hit
A
, then
H
A
could be infinite, and
E
i
(
H
A
) =
∞
. This
occurs if
h
A
i
<
1. So often we are only interested in the case where
h
A
i
= 1 (note
that h
A
i
= 1 does not imply that k
A
i
< ∞. It is merely a necessary condition).
We get a similar result characterizing the expected hitting time.
Theorem. (k
A
i
: i ∈ S) is the minimal non-negative solution to
k
A
i
=
(
0 i ∈ A
1 +
P
j
p
i,j
k
A
j
i ∈ A.
Note that we have this “1+” since when we move from
i
to
j
, one step has
already passed.
The proof is almost the same as the proof we had above.
Proof. The proof that (k
A
i
) satisfies the equations is the same as before.
Now let (y
i
: i ∈ S) be a non-negative solution. We show that y
i
≥ k
A
i
.
If i ∈ A, we get y
i
= k
A
i
= 0. Otherwise, suppose i ∈ A. Then we have
y
i
= 1 +
X
j
p
i,j
y
j
= 1 +
X
j∈A
p
i,j
y
j
+
X
j∈A
p
i,j
y
j
= 1 +
X
j∈A
p
i,j
y
j
= 1 +
X
j∈A
p
i,j
1 +
X
k∈A
p
j,k
y
k
≥ 1 +
X
j∈A
p
i,j
= P
i
(H
A
≥ 1) + P
i
(H
A
≥ 2).
By induction, we know that
y
i
≥ P
i
(H
A
≥ 1) + ··· + P
i
(H
A
≥ n)
for all n. Let n → ∞. Then we get
y
i
≥
X
m≥1
P
i
(H
A
≥ m) =
X
m≥1
mP
i
(H
A
= m) = k
A
i
.
Example (Gambler’s ruin). This time, we will consider a random walk on
N
.
In each step, we either move to the right with probability
p
, or to the left with
probability
q
= 1
− p
. What is the probability of ever hitting 0 from a given
initial point? In other words, we want to find h
i
= h
{0}
i
.
We know h
i
is the minimal solution to
h
i
=
(
1 i = 0
qh
i−1
+ ph
i+1
i = 0.
What are the solutions to these equations? We can view this as a difference
equation
ph
i+1
− h
i
+ qh
i−1
= 0, i ≥ 1.
with the boundary condition that
h
0
= 1. We all know how to solve difference
equations, so let’s just jump to the solution.
If p = q, i.e. p =
1
2
, then the solution has the form
h
i
= A + B
q
p
i
for
i ≥
0. If
p < q
, then for large
i
,
q
p
i
is very large and blows up. However,
since
h
i
is a probability, it can never blow up. So we must have
B
= 0. So
h
i
is
constant. Since h
0
= 1, we have h
i
= 1 for all i. So we always get to 0.
If p > q, since h
0
= 1, we have A + B = 1. So
h
i
=
q
p
i
+ A
1 −
q
p
i
!
.
This is in fact a solution for all A. So we want to find the smallest solution.
As
i → ∞
, we get
h
i
→ A
. Since
h
i
≥
0, we know that
A ≥
0. Subject to this
constraint, the minimum is attained when
A
= 0 (since (
q/p
)
i
and (1
−
(
q/p
)
i
)
are both positive). So we have
h
i
=
q
p
i
.
There is another way to solve this. We can give ourselves a ceiling, i.e. we also
stop when we hit
k >
0, i.e.
h
k
= 1. We now have two boundary conditions
and can find a unique solution. Then we take the limit as
k → ∞
. This is the
approach taken in IA Probability.
Here if p = q, then by the same arguments, we get h
i
= 1 for all i.
Example (Birth-death chain). Let (
p
i
:
i ≥
1) be an arbitrary sequence such
that
p
i
∈
(0
,
1). We let
q
i
= 1
− p
i
. We let
N
be our state space and define the
transition probabilities to be
p
i,i+1
= p
i
, p
i,i−1
= q
i
.
This is a more general case of the random walk — in the random walk we have
a constant p
i
sequence.
This is a general model for population growth, where the change in population
depends on what the current population is. Here each “step” does not correspond
to some unit time, since births and deaths occur rather randomly. Instead, we
just make a “step” whenever some birth or death occurs, regardless of what time
they occur.
Here, if we have no people left, then it is impossible for us to reproduce and
get more population. So we have
p
0,0
= 1.
We say 0 is absorbing in that {0} is closed. We let h
i
= h
{0}
i
. We know that
h
0
= 1, p
i
h
i+1
− h
i
+ q
i
h
i−1
= 0, i ≥ 1.
This is no longer a difference equation, since the coefficients depends on the
index i. To solve this, we need magic. We rewrite this as
p
i
h
i+1
− h
i
+ q
i
h
i−1
= p
i
h
i+1
− (p
i
+ q
i
)h
i
+ q
i
h
i−1
= p
i
(h
i+1
− h
i
) − q
i
(h
i
− h
i−1
).
We let
u
i
=
h
i−1
− h
i
(picking
h
i
− h
i−1
might seem more natural, but this
definition makes u
i
positive). Then our equation becomes
u
i+1
=
q
i
p
i
u
i
.
We can iterate this to become
u
i+1
=
q
i
p
i
q
i−1
p
i−1
···
q
1
p
1
u
1
.
We let
γ
i
=
q
1
q
2
···q
i
p
1
p
2
···p
i
.
Then we get
u
i+1
=
γ
i
u
1
. For convenience, we let
γ
0
= 1. Now we want to
retrieve our
h
i
. We can do this by summing the equation
u
i
=
h
i−1
− h
i
. So we
get
h
0
− h
i
= u
1
+ u
2
+ ··· + u
i
.
Using the fact that h
0
= 1, we get
h
i
= 1 − u
1
(γ
0
+ γ
1
+ ··· + γ
i−1
).
Here we have a parameter
u
1
, and we need to find out what this is. Our theorem
tells us the value of u
1
minimizes h
i
. This all depends on the value of
S =
∞
X
i=0
γ
i
.
By the law of excluded middle,
S
either diverges or converges. If
S
=
∞
, then
we must have
u
1
= 0. Otherwise,
h
i
blows up for large
i
, but we know that
0
≤ h
i
≤
1. If
S
is finite, then
u
1
can be non-zero. We know that the
γ
i
are
all positive. So to minimize
h
i
, we need to maximize
u
1
. We cannot make
u
1
arbitrarily large, since this will make
h
i
negative. To find the maximum possible
value of
u
1
, we take the limit as
i → ∞
. Then we know that the maximum value
of u
1
satisfies
0 = 1 − u
1
S.
In other words, u
1
= 1/S. So we have
h
i
=
P
∞
k=i
γ
k
P
∞
k=0
γ
k
.
2.4 The strong Markov property and applications
We are going to state the strong Markov property and see applications of it.
Before this, we should know what the weak Markov property is. We have, in fact,
already seen the weak Markov property. It’s just that we called it the “Markov
property’ instead.
In probability, we often have “strong” and “weak” versions of things. For
example, we have the strong and weak law of large numbers. The difference is
that the weak versions are expressed in terms of probabilities, while the strong
versions are expressed in terms of random variables.
Initially, when people first started developing probability theory, they just
talked about probability distributions like the Poisson distribution or the normal
distribution. However, later it turned out it is often nicer to talk about random
variables instead. After messing with random variables, we can just take ex-
pectations or evaluate probabilities to get the corresponding statement about
probability distributions. Hence usually the “strong” versions imply the “weak”
version, but not the other way round.
In this case, recall that we defined the Markov property in terms of the
probabilities at some fixed time. We have some fixed time
t
, and we want to
know the probabilities of events after
t
in terms of what happened before
t
.
In the strong Markov property, we will allow
t
to be a random variable, and
say something slightly more involved. However, we will not allow
T
to be any
random variable, but just some nice ones.
Definition (Stopping time). Let
X
be a Markov chain. A random variable
T
(which is a function Ω
→ N ∪ {∞}
) is a stopping time for the chain
X
= (
X
n
) if
for n ≥ 0, the event {T = n} is given in terms of X
0
, ··· , X
n
.
For example, suppose we are in a casino and gambling. We let
X
n
be the
amount of money we have at time
n
. Then we can set our stopping time as “the
time when we have $10 left”. This is a stopping time, in the sense that we can
use this as a guide to when to stop — it is certainly possible to set yourself a
guide that you should leave the casino when you have $10 left. However, it does
not make sense to say “I will leave if the next game will make me bankrupt”,
since there is no way to tell if the next game will make you bankrupt (it certainly
will not if you win the game!). Hence this is not a stopping time.
Example. The hitting time
H
A
is a stopping time. This is since
{H
A
=
n}
=
{X
i
∈ A for i < n}∩ {X
n
∈ A}
. We also know that
H
A
+ 1 is a stopping time
since it only depends in
X
i
for
i ≤ n −
1. However,
H
A
−
1 is not a stopping
time since it depends on X
n+1
.
We can now state the strong Markov property, which is expressed in a rather
complicated manner but can be useful at times.
Theorem (Strong Markov property). Let
X
be a Markov chain with transition
matrix
P
, and let
T
be a stopping time for
X
. Given
T < ∞
and
X
T
=
i
, the
chain (
X
T +k
:
k ≥
0) is a Markov chain with transition matrix
P
with initial
distribution X
T +0
= i, and this Markov chain is independent of X
0
, ··· , X
T
.
Proof is omitted.
Example (Gambler’s ruin). Again, this is the Markov chain taking values on
the non-negative integers, moving to the right with probability
p
and left with
probability
q
= 1
− p
. 0 is an absorbing state, since we have no money left to
bet if we are broke.
Instead of computing the probability of hitting zero, we want to find the
time it takes to get to 0, i.e.
H = inf{n ≥ 0 : X
n
= 0}.
Note that the infimum of the empty set is +
∞
, i.e. if we never hit zero, we say
it takes infinite time. What is the distribution of
H
? We define the generating
function
G
i
(s) = E
i
(s
H
) =
∞
X
n=0
s
n
P
i
(H = n), |s| < 1.
Note that we need the requirement that
|s| <
1, since it is possible that
H
is
infinite, and we would not want to think whether the sum converges when
s
= 1.
However, we know that it does for |s| < 1.
We have
G
1
(s) = E
1
(s
H
) = pE
1
(s
H
| X
1
= 2) + qE
1
(s
H
| X
1
= 0).
How can we simplify this? The second term is easy, since if
X
1
= 0, then we
must have
H
= 1. So
E
1
(
s
H
| X
1
= 0) =
s
. The first term is more tricky. We
are now at 2. To get to 0, we need to pass through 1. So the time needed to get
to 0 is the time to get from 2 to 1 (say
H
′
), plus the time to get from 1 to 0
(say
H
′′
). We know that
H
′
and
H
′′
have the same distribution as
H
, and by
the strong Markov property, they are independent. So
G
1
= pE
1
(s
H
′
+H
′′
+1
) + qs = psG
2
1
+ qs. (∗)
Solving this, we get two solutions
G
1
(s) =
1 ±
p
1 − 4pqs
2
2ps
.
We have to be careful here. This result says that for each value of
s
,
G
1
(
s
) is
either
1+
√
1−4pqs
2
2ps
or
1−
√
1−4pqs
2
2ps
. It does not say that there is some consistent
choice of + or − that works for everything.
However, we know that if we suddenly change the sign, then
G
1
(
s
) will be
discontinuous at that point, but
G
1
, being a power series, has to be continuous.
So the solution must be either + for all s, or − for all s.
To determine the sign, we can look at what happens when
s
= 0. We see
that the numerator becomes 1
±
1, while the denominator is 0. We know that
G
converges at s = 0. Hence the numerator must be 0. So we must pick −, i.e.
G
1
(s) =
1 −
p
1 − 4pqs
2
2ps
.
We can find P
1
(H = k) by expanding the Taylor series.
What is the probability of ever hitting 0? This is
P
1
(H < ∞) =
∞
X
n=1
P
1
(H = n) = lim
s→1
G
1
(s) =
1 −
√
1 − 4pq
2p
.
We can rewrite this using the fact that
q
= 1
− p
. So 1
−
4
pq
= 1
−
4
p
(1
− p
) =
(1 − 2p)
2
= |q − p|
2
. So we can write
P
1
(H < ∞) =
1 − |p − q|
2p
=
(
1 p ≤ q
q
p
p > q
.
Using this, we can also find
µ
=
E
1
(
H
). Firstly, if
p > q
, then it is possible
that
H
=
∞
. So
µ
=
∞
. If
p ≤ q
, we can find
µ
by differentiating
G
1
(
s
) and
evaluating at
s
= 1. Doing this directly would result it horrible and messy
algebra, which we want to avoid. Instead, we can differentiate (∗) and obtain
G
′
1
= pG
2
1
+ ps2G
1
G
′
1
+ q.
We can rewrite this as
G
′
1
(s) =
pG(s)
2
+ q
1 − 2psG(s)
.
By Abel’s lemma, we have
µ = lim
s→1
G
′
(s) =
(
∞ p =
1
2
1
p−q
p <
1
2
.
2.5 Further classification of states
So far, we have classified chains in say, irreducible and reducible chains. We
have also seen that states can be recurrent or transient. By definition, a state
is recurrent if the probability of returning to it is 1. However, we can further
classify recurrent states. Even if a state is recurrent, it is possible that the
expected time of returning is infinite. So while we will eventually return to the
original state, this is likely to take a long, long time. The opposite behaviour is
also possible — the original state might be very attracting, and we are likely to
return quickly. It turns out this distinction can affect the long-term behaviour
of the chain.
First we have the following proposition, which tells us that if a state is
recurrent, then we are expected to return to it infinitely many times.
Theorem. Suppose
X
0
=
i
. Let
V
i
=
|{n ≥
1 :
X
n
=
i}|
. Let
f
i,i
=
P
i
(
T
i
< ∞
).
Then
P
i
(V
i
= r) = f
r
i,i
(1 − f
i,i
),
since we have to return
r
times, each with probability
f
i,i
, and then never return.
Hence, if
f
i,i
= 1, then
P
i
(
V
i
=
r
) = 0 for all
r
. So
P
i
(
V
i
=
∞
) = 1.
Otherwise,
P
i
(
V
i
=
r
) is a genuine geometric distribution, and we get
P
i
(
V
i
<
∞) = 1.
Proof. Exercise, using the strong Markov property.
Definition (Mean recurrence time). Let
T
i
be the returning time to a state
i
.
Then the mean recurrence time of i is
µ
i
= E
i
(T
i
) =
(
∞ i transient
P
∞
n=1
nf
i,i
(n) i recurrent
Definition (Null and positive state). If
i
is recurrent, we call
i
a null state if
µ
i
= ∞. Otherwise i is non-null or positive.
This is mostly all we care about. However, there is still one more technical
consideration. Recall that in the random walk starting from the origin, we can
only return to the origin after an even number of steps. This causes problems for
a lot of our future results. For example, we will later look at the “convergence”
of Markov chains. If we are very likely to return to 0 after an even number of
steps, but is impossible for an odd number of steps, we don’t get convergence.
Hence we would like to prevent this from happening.
Definition (Period). The period of a state i is d
i
= gcd{n ≥ 1 : p
i,i
(n) > 0}.
A state is aperiodic if d
i
= 1.
In general, we like aperiodic states. This is not a very severe restriction. For
example, in the random walk, we can get rid of periodicity by saying there is a
very small chance of staying at the same spot in each step. We can make this
chance is so small that we can ignore its existence for most practical purposes,
but will help us get rid of the technical problem of periodicity.
Definition (Ergodic state). A state
i
is ergodic if it is aperiodic and positive
recurrent.
These are the really nice states.
Recall that recurrence is a class property — if two states are in the same
communicating class, then they are either both recurrent, or both transient. Is
this true for the properties above as well? The answer is yes.
Theorem. If i ↔ j are communicating, then
(i) d
i
= d
j
.
(ii) i is recurrent iff j is recurrent.
(iii) i is positive recurrent iff j is positive recurrent.
(iv) i is ergodic iff j is ergodic.
Proof.
(i)
Assume
i ↔ j
. Then there are
m, n ≥
1 with
p
i,j
(
m
)
, p
j,i
(
n
)
>
0. By the
Chapman-Kolmogorov equation, we know that
p
i,i
(m + r + n) ≥ p
i,j
(m)p
j,j
(r)p
j,i
(n) ≥ αp
j,j
(r),
where
α
=
p
i,j
(
m
)
p
j,i
(
n
)
>
0. Now let
D
j
=
{r ≥
1 :
p
j,j
(
r
)
>
0
}
. Then
by definition, d
j
= gcd D
j
.
We have just shown that if
r ∈ D
j
, then we have
m
+
r
+
n ∈ D
i
. We
also know that
n
+
m ∈ D
i
, since
p
i,i
(
n
+
m
)
≥ p
i,j
(
n
)
p
ji
(
m
)
>
0. Hence
for any
r ∈ D
j
, we know that
d
i
| m
+
r
+
n
, and also
d
i
| m
+
n
. So
d
i
| r
. Hence
gcd D
i
| gcd D
j
. By symmetry,
gcd D
j
| gcd D
i
as well. So
gcd D
i
= gcd D
j
.
(ii) Proved before.
(iii) This is deferred to a later time.
(iv) Follows directly from (i), (ii) and (iii) by definition.
We also have the following proposition we will use later on:
Proposition. If the chain is irreducible and j ∈ S is recurrent, then
P(X
n
= j for some n ≥ 1) = 1,
regardless of the distribution of X
0
.
Note that this is not just the definition of recurrence, since recurrence says
that if we start at
i
, then we will return to
i
. Here we are saying wherever we
start, we will eventually visit i.
Proof. Let
f
i,j
= P
i
(X
n
= j for some n ≥ 1).
Since
j → i
, there exists a least integer
m ≥
1 with
p
j,i
(
m
)
>
0. Since
m
is least,
we know that
p
j,i
(m) = P
j
(X
m
= i, X
r
= j for r < m).
This is since we cannot visit
j
in the path, or else we can truncate our path and
get a shorter path from j to i. Then
p
j,i
(m)(1 − f
i,j
) ≤ 1 − f
j,j
.
This is since the left hand side is the probability that we first go from
j
to
i
in
m
steps, and then never go from
i
to
j
again; while the right is just the probability
of never returning to
j
starting from
j
; and we know that it is easier to just not
get back to
j
than to go to
i
in exactly
m
steps and never returning to
j
. Hence
if f
j,j
= 1, then f
i,j
= 1.
Now let λ
k
= P(X
0
= k) be our initial distribution. Then
P(X
n
= j for some n ≥ 1) =
X
i
λ
i
P
i
(X
n
= j for some n ≥ 1) = 1.
3 Long-run behaviour
3.1 Invariant distributions
We want to look at what happens in the long run. Recall that at the very
beginning of the course, we calculated the transition probabilities of the two-
state Markov chain, and saw that in the long run, as
n → ∞
, the probability
distribution of the
X
n
will “converge” to some particular distribution. Moreover,
this limit does not depend on where we started. We’d like to see if this is true
for all Markov chains.
First of all, we want to make it clear what we mean by the chain “converging”
to something. When we are dealing with real sequences
x
n
, we have a precise
definition of what it means for
x
n
→ x
. How can we define the convergence of a
sequence of random variables
X
n
? These are not proper numbers, so we cannot
just apply our usual definitions.
For the purposes of our investigation of Markov chains here, it turns out
that the right way to think about convergence is to look at the probability mass
function. For each k ∈ S, we ask if P(X
n
= k) converges to anything.
In most cases,
P
(
X
n
=
k
) converges to something. Hence, this is not an
interesting question to ask. What we would really want to know is whether the
limit is a probability mass function. It is, for example, possible that
P
(
X
n
=
k) → 0 for all k, and the result is not a distribution.
From Analysis, we know there are, in general, two ways to prove something
converges — we either “guess” a limit and then prove it does indeed converge to
that limit, or we prove the sequence is Cauchy. It would be rather silly to prove
that these probabilities form a Cauchy sequence, so we will attempt to guess the
limit. The limit will be known as an invariant distribution, for reasons that will
become obvious shortly.
The main focus of this section is to study the existence and properties of
invariant distributions, and we will provide sufficient conditions for convergence
to occur in the next.
Recall that if we have a starting state
λ
, then the distribution of the
n
th
step is given by λP
n
. We have the following trivial identity:
λP
n+1
= (λP
n
)P.
If the distribution converges, then we have
λP
n
→ π
for some
π
, and also
λP
n+1
→ π. Hence the limit π satisfies
πP = π.
We call these invariant distributions.
Definition (Invariant distriubtion). Let
X
j
be a Markov chain with transition
probabilities
P
. The distribution
π
= (
π
k
:
k ∈ S
) is an invariant distribution if
(i) π
k
≥ 0,
P
k
π
k
= 1.
(ii) π = πP .
The first condition just ensures that this is a genuine distribution.
An invariant distribution is also known as an invariant measure, equilibrium
distribution or steady-state distribution.
Theorem. Consider an irreducible Markov chain. Then
(i) There exists an invariant distribution if some state is positive recurrent.
(ii)
If there is an invariant distribution
π
, then every state is positive recurrent,
and
π
i
=
1
µ
i
for
i ∈ S
, where
µ
i
is the mean recurrence time of
i
. In particular,
π
is
unique.
Note how we worded the first statement. Recall that we once stated that if
one state is positive recurrent, then all states are positive recurrent, and then
said we would defer the proof for later on. This is where we actually prove it.
In (i), we show that if some state is positive recurrent, then it has an invariant
distribution. Then (ii) tells us if there is an invariant distribution, then all states
are positive recurrent. Hence one state being positive recurrent implies all states
being positive recurrent.
Now where did the formula for
π
come from? We can first think what
π
i
should be. By definition, we should know that for large
m
,
P
(
X
m
=
i
)
∼ π
i
.
This means that if we go on to really late in time, we would expect to visit the
state
i π
i
of the time. On the other hand, the mean recurrence time tells us that
we are expected to (re)-visit
i
every
µ
i
steps. So it makes sense that
π
i
= 1
/µ
i
.
To put this on a more solid ground and actually prove it, we would like to
look at some time intervals. For example, we might ask how many times we will
hit
i
in 100 steps. This is not a good thing to do, because we are not given where
we are starting, and this probability can depend a lot on where the starting
point is.
It turns out the natural thing to do is not to use a fixed time interval, but
use a random time interval. In particular, we fix a state
k
, and look at the time
interval between two consecutive visits of k.
We start by letting
X
0
=
k
. Let
W
i
denote the number of visits to
i
before
the next visit to k. Formally, we have
W
i
=
∞
X
m=1
1(X
m
= i, m ≤ T
k
),
where
T
k
is the recurrence time of
m
and 1 is the indicator function. In particular,
W
i
= 1 for i = k (if T
k
is finite). We can also write this as
W
i
=
T
k
X
m=1
1(X
m
= i).
This is a random variable. So we can look at its expectation. We define
ρ
i
= E
k
(W
i
).
We will show that this ρ is almost our π
i
, up to a constant.
Proposition. For an irreducible recurrent chain and
k ∈ S
,
ρ
= (
ρ
i
:
i ∈ S
)
defined as above by
ρ
i
= E
k
(W
i
), W
i
=
∞
X
m=1
1(X
m
= i, T
k
≥ m),
we have
(i) ρ
k
= 1
(ii)
P
i
ρ
i
= µ
k
(iii) ρ = ρP
(iv) 0 < ρ
i
< ∞ for all i ∈ S.
Proof.
(i) This follows from definition of ρ
i
, since for m < T
k
, X
m
= k.
(ii)
Note that
P
i
W
i
=
T
k
, since in each step we hit exactly one thing. We
have
X
i
ρ
i
=
X
i
E
k
(W
i
)
= E
k
X
i
W
i
!
= E
k
(T
k
)
= µ
k
.
Note that we secretly swapped the sum and expectation, which is in general
bad because both are potentially infinite sums. However, there is a theorem
(bounded convergence) that tells us this is okay whenever the summands
are non-negative, which is left as an Analysis exercise.
(iii) We have
ρ
j
= E
k
(W
j
)
= E
k
X
m≥1
1(X
m
= j, T
k
≥ m)
=
X
m≥1
P
k
(X
m
= j, T
k
≥ m)
=
X
m≥1
X
i∈S
P
k
(X
m
= j | X
m−1
= i, T
k
≥ m)P
k
(X
m−1
= i, T
k
≥ m)
We now use the Markov property. Note that
T
k
≥ m
means
X
1
, ··· , X
m−1
are all not
k
. The Markov property thus tells us the condition
T
k
≥ m
is
useless. So we are left with
=
X
m≥1
X
i∈S
P
k
(X
m
= j | X
m−1
= i)P
k
(X
m−1
= i, T
k
≥ m)
=
X
m≥1
X
i∈S
p
i,j
P
k
(X
m−1
= i, T
k
≥ m)
=
X
i∈S
p
i,j
X
m≥1
P
k
(X
m−1
= i, T
k
≥ m)
The last term looks really
ρ
i
, but the indices are slightly off. We shall have
faith in ourselves, and show that this is indeed equal to ρ
i
.
First we let r = m − 1, and get
X
m≥1
P
k
(X
m−1
= i, T
k
≥ m) =
∞
X
r=0
P
k
(X
r
= i, T
k
≥ r + 1).
Of course this does not fix the problem. We will look at the different
possible cases. First, if
i
=
k
, then the
r
= 0 term is 1 since
T
k
≥
1 is
always true by definition and
X
0
=
k
, also by construction. On the other
hand, the other terms are all zero since it is impossible for the return time
to be greater or equal to
r
+ 1 if we are at
k
at time
r
. So the sum is 1,
which is ρ
k
.
In the case where
i
=
k
, first note that when
r
= 0 we know that
X
0
=
k
=
i
. So the term is zero. For
r ≥
1, we know that if
X
r
=
i
and
T
k
≥ r
, then we must also have
T
k
≥ r
+ 1, since it is impossible
for the return time to
k
to be exactly
r
if we are not at
k
at time
r
. So
P
k
(X
r
= i, T
k
≥ r + 1) = P
k
(X
r
= i, T
k
≥ r). So indeed we have
X
m≥0
P
k
(X
m−1
= i, T
k
≥ m) = ρ
i
.
Hence we get
ρ
j
=
X
i∈S
p
ij
ρ
i
.
So done.
(iv)
To show that 0
< ρ
i
< ∞
, first fix our
i
, and note that
ρ
k
= 1. We know
that
ρ
=
ρP
=
ρP
n
for
n ≥
1. So by expanding the matrix sum, we know
that for any m, n,
ρ
i
≥ ρ
k
p
k,i
(n)
ρ
k
≥ ρ
i
p
i,k
(m)
By irreducibility, we now choose
m, n
such that
p
i,k
(
m
)
, p
k,i
(
n
)
>
0. So
we have
ρ
k
p
k,i
(n) ≤ ρ
i
≤
ρ
k
p
i,k
(m)
Since ρ
k
= 1, the result follows.
Now we can prove our initial theorem.
Theorem. Consider an irreducible Markov chain. Then
(i)
There exists an invariant distribution if and only if some state is positive
recurrent.
(ii)
If there is an invariant distribution
π
, then every state is positive recurrent,
and
π
i
=
1
µ
i
for
i ∈ S
, where
µ
i
is the mean recurrence time of
i
. In particular,
π
is
unique.
Proof.
(i) Let k be a positive recurrent state. Then
π
i
=
ρ
i
µ
k
satisfies π
i
≥ 0 with
P
i
π
i
= 1, and is an invariant distribution.
(ii)
Let
π
be an invariant distribution. We first show that all entries are
non-zero. For all n, we have
π = πP
n
.
Hence for all i, j ∈ S, n ∈ N, we have
π
i
≥ π
j
p
j,i
(n). (∗)
Since
P
π
1
= 1, there is some k such that π
k
> 0.
By (∗) with j = k, we know that
π
i
≥ π
k
p
k,i
(n) > 0
for some n, by irreducibility. So π
i
> 0 for all i.
Now we show that all states are positive recurrent. So we need to rule out
the cases of transience and null recurrence.
So assume all states are transient. So
p
j,i
(
n
)
→
0 for all
i, j ∈ S
,
n ∈ N
.
However, we know that
π
i
=
X
j
π
j
p
j,i
(n).
If our state space is finite, then since
p
j,i
(
n
)
→
0, the sum tends to 0,
and we reach a contradiction, since
π
i
is non-zero. If we have a countably
infinite set, we have to be more careful. We have a huge state space
S
,
and we don’t know how to work with it. So we approximate it by a finite
F , and split S into F and S \ F . So we get
0 ≤
X
j
π
j
p
j,i
(n)
=
X
j∈F
π
j
p
j,i
(n) +
X
j∈F
π
j
p
j,i
(n)
≤
X
j∈F
p
j,i
(n) +
X
j∈F
π
j
→
X
j∈F
π
j
as we take the limit
n → ∞
. We now want to take the limit as
F → S
.
We know that
P
j∈S
π
i
= 1. So as we put more and more things into
F
,
P
j∈F
π
i
→
0. So
P
π
j
p
j,i
(
n
)
→
0. So we get the desired contradiction.
Hence we know that all states are recurrent.
To rule out the case of null recurrence, recall that in the previous discussion,
we said that we “should” have
π
i
µ
i
= 1. So we attempt to prove this.
Then this would imply that µ
i
is finite since π
i
> 0.
By definition µ
i
= E
i
(T
i
), and we have the general formula
E(N) =
X
n
P(N ≥ n).
So we get
π
i
µ
i
=
∞
X
n=1
π
i
P
i
(T
i
≥ n).
Note that
P
i
is a probability conditional on starting at
i
. So to work with
the expression
π
i
P
i
(
T
i
≥ n
), it is helpful to let
π
i
be the probability of
starting at i. So suppose X
0
has distribution π. Then
π
i
µ
i
=
∞
X
n=1
P(T
i
≥ n, X
0
= i).
Let’s work out what the terms are. What is the first term? It is
P(T
i
≥ 1, X
0
= i) = P(X
0
= i) = π
i
,
since we know that we always have T
i
≥ 1 by definition.
For other
n ≥
2, we want to compute
P
(
T
i
≥ n, X
0
=
i
). This is the
probability of starting at
i
, and then not return to
i
in the next
n −
1 steps.
So we have
P(T
i
≥ n, X
0
= i) = P(X
0
= i, X
m
= i for 1 ≤ m ≤ n − 1)
Note that all the expressions on the right look rather similar, except that
the first term is =
i
while the others are
=
i
. We can make them look
more similar by writing
P(T
i
≥ n, X
0
= i) = P(X
m
= i for 1 ≤ m ≤ n − 1)
− P(X
m
= i for 0 ≤ m ≤ n − 1)
What can we do now? The trick here is to use invariance. Since we started
with an invariant distribution, we always live in an invariant distribution.
Looking at the time interval 1
≤ m ≤ n −
1 is the same as looking at
0
≤ m ≤ n −
2). In other words, the sequence (
X
0
, ··· , X
n−2
) has the
same distribution as (X
1
, ··· , X
n−1
). So we can write the expression as
P(T
i
≥ n, X
0
= i) = a
n−2
− a
n−1
,
where
a
r
= P(X
m
= i for 0 ≤ i ≤ r).
Now we are summing differences, and when we sum differences everything
cancels term by term. Then we have
π
i
µ
i
= π
i
+ (a
0
− a
1
) + (a
1
− a
2
) + ···
Note that we cannot do the cancellation directly, since this is an infinite
sum, and infinity behaves weirdly. We have to look at a finite truncation,
do the cancellation, and take the limit. So we have
π
i
µ
i
= lim
N→∞
[π
i
+ (a
0
− a
1
) + (a
1
− a
2
) + ··· + (a
N−2
− a
N−1
)]
= lim
N→∞
[π
i
+ a
0
− a
N−1
]
= π
i
+ a
0
− lim
N→∞
a
N
.
What is each term?
π
i
is the probability that
X
0
=
i
, and
a
0
is the
probability that
X
0
=
i
. So we know that
π
i
+
a
0
= 1. What about
lim a
N
? We know that
lim
N→∞
a
N
= P(X
m
= i for all m).
Since the state is recurrent, the probability of never visiting i is 0. So we
get
π
i
µ
i
= 1.
Since
π
i
>
0, we get
µ
i
=
1
π
i
< ∞
for all
i
. Hence we have positive
recurrence. We have also proved the formula we wanted.
3.2 Convergence to equilibrium
So far, we have discussed that if a chain converged, then it must converge to an
invariant distribution. We then proved that the chain has a (unique) invariant
distribution if and only if it is positive recurrent.
Now, we want to understand when convergence actually occurs.
Theorem. Consider a Markov chain that is irreducible, positive recurrent and
aperiodic. Then
p
i,k
(n) → π
k
as n → ∞, where π is the unique invariant distribution.
We will prove this by “coupling”. The idea of coupling is that here we have
two sets of probabilities, and we want to prove some relations between them. The
first step is to move our attention to random variables, by considering random
variables that give rise to these probability distribution. In other words, we look
at the Markov chains themselves instead of the probabilities. In general, random
variables are nicer to work with, since they are functions, not discrete, unrelated
numbers.
However, we have a problem since we get two random variables, but they are
completely unrelated. This is bad. So we will need to do some “coupling” to
correlate the two random variables together.
Proof.
(non-examinable) The idea of the proof is to show that for any
i, j, k ∈ S
,
we have
p
i,k
(
n
)
→ p
j,k
(
n
) as
n → ∞
. Then we can argue that no matter where
we start, we will tend to the same distribution, and hence any distribution tends
to the same distribution as π, since π doesn’t change.
As mentioned, instead of working with probability distributions, we will work
with the chains themselves. In particular, we have two Markov chains, and we
imagine one starts at
i
and the other starts at
j
. To do so, we define the pair
Z
= (
X, Y
) of two independent chains, with
X
= (
X
n
) and
Y
= (
Y
n
) each
having the state space S and transition matrix P .
We can let
Z
= (
Z
n
), where
Z
n
= (
X
n
, Y
n
) is a Markov chain on state space
S
2
. This has transition probabilities
p
ij,kℓ
= p
i,k
p
j,ℓ
by independence of the chains. We would like to apply theorems to
Z
, so we
need to make sure it has nice properties. First, we want to check that
Z
is
irreducible. We have
p
ij,kℓ
(n) = p
i,k
(n)p
j,ℓ
(n).
We want this to be strictly positive for some
n
. We know that there is
m
such
that
p
i,k
(
m
)
>
0, and some
r
such that
p
j,ℓ
(
r
)
>
0. However, what we need is
an
n
that makes them simultaneously positive. We can indeed find such an
n
,
based on the assumption that we have aperiodic chains and waffling something
about number theory.
Now we want to show positive recurrence. We know that
X
, and hence
Y
is positive recurrent. By our previous theorem, there is a unique invariant
distribution π for P. It is then easy to check that Z has invariant distribution
ν = (ν
ij
: ij ∈ S
2
)
given by
ν
i,j
= π
i
π
j
.
This works because X and Y are independent. So Z is also positive recurrent.
So Z is nice.
The next step is to couple the two chains together. The idea is to fix some
state
s ∈ S
, and let
T
be the earliest time at which
X
n
=
Y
n
=
s
. Because of
recurrence, we can always find such at
T
. After this time
T
,
X
and
Y
behave
under the exact same distribution.
We define
T = inf{n : Z
n
= (X
n
, Y
n
) = (s, s)}.
We have
p
i,k
(n) = P
i
(X
n
= k)
= P
ij
(X
n
= k)
= P
ij
(X
n
= k, T ≤ n) + P
ij
(X
n
= k, T > n)
Note that if
T ≤ n
, then at time
T
,
X
T
=
Y
T
. Thus the evolution of
X
and
Y
after time T is equal. So this is equal to
= P
ij
(Y
n
= k, T ≤ n) + P
ij
(X
n
= k, T > n)
≤ P
ij
(Y
n
= k) + P
ij
(T > n)
= p
j,k
(n) + P
ij
(T > n).
Hence we know that
|p
i,k
(n) − p
j,k
(n)| ≤ P
ij
(T > n).
As n → ∞, we know that P
ij
(T > n) → 0 since Z is recurrent. So
|p
i,k
(n) − p
j,k
(n)| → 0
With this result, we can prove what we want. First, by the invariance of
π
, we
have
π = πP
n
for all n. So we can write
π
k
=
X
j
π
j
p
j,k
(n).
Hence we have
|π
k
− p
i,k
(n)| =
X
j
π
j
(p
j,k
(n) − p
i,k
(n))
≤
X
j
π
j
|p
j,k
(n) − p
i,k
|.
We know that each individual
|p
j,k
(
n
)
− p
i,k
(
n
)
|
tends to zero. So by bounded
convergence, we know
π
k
− p
i,k
(n) → 0.
So done.
What happens when we have a null recurrent case? We would still be able to
prove the result about
p
i,k
(
n
)
→ p
j,k
(
n
), since
T
is finite by recurrence. However,
we do not have a π to make the last step.
Recall that we motivated our definition of
π
i
as the proportion of time we
spend in state i. Can we prove that this is indeed the case?
More concretely, we let
V
i
(n) = |{m ≤ n : X
m
= i}|.
We thus want to know what happens to
V
i
(
n
)
/n
as
n → ∞
. We think this
should tend to π
i
.
Note that technically, this is not a well-formed question, since we don’t exactly
know how convergence of random variables should be defined. Nevertheless, we
can give an informal proof of this result.
The idea is to look at the average time between successive visits. We assume
X
0
=
i
. We let
T
m
be the time of
m
th return to
i
. In particular,
T
0
= 0. We
define
U
m
=
T
m
− T
m−1
. All of these are iid by the strong Markov property,
and has mean µ
i
by definition of µ
i
.
Hence, by the law of large numbers,
1
m
T
m
=
1
m
m
X
r=1
U
r
∼ E[U
1
] = µ
i
. (∗)
We now want to look at
V
i
. If we stare at them hard enough, we see that
V
i
(
n
)
≤ k
if and only if
T
k
≤ n
. We can write an equivalent statement by letting
k
be a real number. We denote
⌈x⌉
as the least integer greater than
x
. Then we
have
V
i
(n) ≤ x ⇔ T
⌈x⌉
≤ n.
Putting a funny value of x in, we get
V
i
(n)
n
≤
A
µ
i
⇔
1
n
T
⌈An/µ
i
⌉
≤ 1.
However, using (∗), we know that
T
An/µ
i
An/µ
i
→ µ
i
.
Multiply both sides by A/µ
i
to get
A
µ
i
T
An/µ
i
An/µ
i
=
T
An/µ
i
n
→
Aµ
i
µ
i
= A.
So if
A <
1, the event
1
n
T
An/µ
i
≤
1 occurs with almost probability 1. Otherwise,
it happens with probability 0. So in some sense,
V
i
(n)
n
→
1
µ
i
= π
i
.
4 Time reversal
Physicists have a hard time dealing with time reversal. They cannot find a
decent explanation for why we can move in all directions in space, but can only
move forward in time. Some physicists mumble something about entropy and
pretend they understand the problem of time reversal, but they don’t. However,
in the world of Markov chain, time reversal is something we understand well.
Suppose we have a Markov chain
X
= (
X
0
, ··· , X
N
). We define a new
Markov chain by
Y
k
=
X
N−k
. Then
Y
= (
X
N
, X
N−1
, ··· , X
0
). When is this a
Markov chain? It turns out this is the case if
X
0
has the invariant distribution.
Theorem. Let X be positive recurrent, irreducible with invariant distribution
π. Suppose that X
0
has distribution π. Then Y defined by
Y
k
= X
N−k
is a Markov chain with transition matrix
ˆ
P = (ˆp
i,j
: i, j ∈ S), where
ˆp
i,j
=
π
j
π
i
p
j,i
.
Also π is invariant for
ˆ
P .
Most of the results here should not be surprising, apart from the fact that
Y is Markov. Since Y is just X reversed, the transition matrix of Y is just the
transpose of the transition matrix of
X
, with some factors to get the normalization
right. Also, it is not surprising that
π
is invariant for
ˆ
P
, since each
X
i
, and
hence Y
i
has distribution π by assumption.
Proof.
First we show that
ˆp
is a stochastic matrix. We clearly have
ˆp
i,j
≥
0. We
also have that for each i, we have
X
j
ˆp
i,j
=
1
π
i
X
j
π
j
p
j,i
=
1
π
i
π
i
= 1,
using the fact that π = πP .
We now show π is invariant for
ˆ
P : We have
X
i
π
i
ˆp
i,j
=
X
i
π
j
p
j,i
= π
j
since P is a stochastic matrix and
P
i
p
ji
= 1.
Note that our formula for ˆp
i,j
gives
π
i
ˆp
i,j
= p
j,i
π
j
.
Now we have to show that Y is a Markov chain. We have
P(Y
0
= i
0
, ··· , Y
k
= i
k
) = P(X
N−k
= i
k
, X
N−k+1
= i
k−1
, ··· , X
N
= i
0
)
= π
i
k
p
i
k
,i
k−1
p
i
k−1
,p
k−2
···p
i
1
,i
0
= (π
i
k
p
i
k
,i
k−1
)p
i
k−1
,p
k−2
···p
i
1
,i
0
= ˆp
i
k−1
i
k
(π
i
k−1
p
i
k−1
,p
k−2
) ···p
i
1
,i
0
= ···
= π
i
0
ˆp
i
0
,i
ˆp
i
1
,i
2
··· ˆp
i
k−1
,i
k
.
So Y is a Markov chain.
Just because the reverse of a chain is a Markov chain does not mean it is
“reversible”. In physics, we say a process is reversible only if the dynamics of
moving forwards in time is the same as the dynamics of moving backwards in
time. Hence we have the following definition.
Definition (Reversible chain). An irreducible Markov chain
X
= (
X
0
, ··· , X
N
)
in its invariant distribution
π
is reversible if its reversal has the same transition
probabilities as does X, ie
π
i
p
i,j
= π
j
p
j,i
for all i, j ∈ S.
This equation is known as the detailed balance equation. In general, if
λ
is a
distribution that satisfies
λ
i
p
i,j
= λ
j
p
j,i
,
we say (P, λ) is in detailed balance.
Note that most chains are not reversible, just like most functions are not
continuous. However, if we know reversibility, then we have one powerful piece
of information. The nice thing about this is that it is very easy to check if the
above holds — we just have to compute π, and check the equation directly.
In fact, there is an even easier check. We don’t have to start by finding
π
,
but just some λ that is in detailed balance.
Proposition. Let
P
be the transition matrix of an irreducible Markov chain
X
.
Suppose (
P, λ
) is in detailed balance. Then
λ
is the unique invariant distribution
and the chain is reversible (when X
0
has distribution λ).
This is a much better criterion. To find π, we need to solve
π
i
=
X
j
π
j
p
j,i
,
and this has a big scary sum on the right. However, to find the
λ
, we just need
to solve
λ
i
p
i,j
= λ
j
p
j,i
,
and there is no sum involved. So this is indeed a helpful result.
Proof.
It suffices to show that
λ
is invariant. Then it is automatically unique
and the chain is by definition reversible. This is easy to check. We have
X
j
λ
j
p
j,i
=
X
j
λ
i
p
i,j
= λ
i
X
j
p
i,j
= λ
i
.
So λ is invariant.
This gives a really quick route to computing invariant distributions.
Example (Birth-death chain with immigration). Recall our birth-death chain,
where at each state
i >
0, we move to
i
+ 1 with probability
p
i
and to
i −
1 with
probability q
i
= 1 − p
i
. When we are at 0, we are dead and no longer change.
We wouldn’t be able to apply our previous result to this scenario, since 0
is an absorbing equation, and this chain is obviously not irreducible, let alone
positive recurrent. Hence we make a slight modification to our scenario — if
we have population 0, we allow ourselves to have a probability
p
0
of having an
immigrant and get to 1, or probability q
0
= 1 − p
0
that we stay at 0.
This is sort of a “physical” process, so it would not be surprising if this is
reversible. So we can try to find a solution to the detailed balance equation. If
it works, we would have solved it quickly. If not, we have just wasted a minute
or two. We need to solve
λ
i
p
i,j
= λ
j
p
j,i
.
Note that this is automatically satisfied if
j
and
i
differ by at least 2, since both
sides are zero. So we only look at the case where
j
=
i
+ 1 (the case
j
=
i −
1 is
the same thing with the slides flipped). So the only equation we have to satisfy
is
λ
i
p
i
= λ
i+1
q
i+1
for all i. This is just a recursive formula for λ
i
, and we can solve to get
λ
i
=
p
i−1
q
i
λ
i−1
= ··· =
p
i−1
q
i
p
i−2
q
i−1
···
p
0
q
1
λ
0
.
We can call the term in the brackets
ρ
i
=
p
i−1
q
i
p
i−2
q
i−1
···
p
0
q
1
.
For λ
i
to be a distribution, we need
1 =
X
i
λ
i
= λ
0
X
i
ρ
i
.
Thus if
X
ρ
i
< ∞,
then we can pick
λ
0
=
1
P
ρ
i
and λ is a distribution. Hence this is the unique invariant distribution.
If it diverges, the method fails, and we need to use our more traditional
methods to check recurrence and transience.
Example (Random walk on a finite graph). A graph is a collection of points
with edges between them. For example, the following is a graph:
More precisely, a graph is a pair
G
= (
V, E
), where
E
contains distinct unordered
pairs of distinct vertices (u, v), drawn as edges from u to v.
Note that the restriction of distinct pairs and distinct vertices are there to
prevent loops and parallel edges, and the fact that the pairs are unordered means
our edges don’t have orientations.
A graph
G
is connected if for all
u, v ∈ V
, there exists a path along the edges
from u to v.
Let
G
= (
V, E
) be a connected graph with
|V | ≤ ∞
. Let
X
= (
X
n
) be a
random walk on G. Here we live on the vertices, and on each step, we move to
one an adjacent vertex. More precisely, if
X
n
=
x
, then
X
n+1
is chosen uniformly
at random from the set of neighbours of
x
, i.e. the set
{y ∈ V
: (
x, y
)
∈ E}
,
independently of the past. This is a Markov chain.
For example, our previous simple symmetric random walks on
Z
or
Z
d
are
random walks on graphs (despite the graphs not being finite). Our transition
probabilities are
p
i,j
=
(
0 j is not a neighbour of i
1
d
i
j is a neighbour of i
,
where d
i
is the number of neighbours of i, commonly known as the degree of i.
By connectivity, the Markov chain is irreducible. Since it is finite, it is
recurrent, and in fact positive recurrent.
This process is a rather “physical” process, and again we would expect it to
be reversible. So let’s try to solve the detailed balance equation
λ
i
p
i,j
= λ
j
p
j,i
.
If
j
is not a neighbour of
i
, then both sides are zero, and it is trivially balanced.
Otherwise, the equation becomes
λ
i
1
d
i
= λ
j
1
d
j
.
The solution is obvious. Take
λ
i
=
d
i
. In fact we can multiply by any constant
c, and λ
i
= cd
i
for any c. So we pick our c such that this is a distribution, i.e.
1 =
X
i
λ
i
= c
X
i
d
i
.
We now note that since each edge adds 1 to the degrees of each vertex on the
two ends,
P
d
i
is just twice the number of edges. So the equation gives
1 = 2c|E|.
Hence we get
c =
1
2|E|
.
Hence, our invariant distribution is
λ
i
=
d
i
2|E|
.
Let’s look at a specific scenario.
Suppose we have a knight on the chessboard. In each step, the allowed moves
are:
– Move two steps horizontally, then one step vertically;
– Move two steps vertically, then one step horizontally.
For example, if the knight is in the center of the board (red dot), then the
possible moves are indicated with blue crosses:
×
×
×
×
×
×
×
×
At each epoch of time, our erratic knight follows a legal move chosen uniformly
from the set of possible moves. Hence we have a Markov chain derived from the
chessboard. What is his invariant distribution? We can compute the number of
possible moves from each position:
2
3
3
4
4
4
44
6
6
6 6
8
8
8
8
The sum of degrees is
X
i
d
i
= 336.
So the invariant distribution at, say, the corner is
π
corner
=
2
336
.