]> Introduction

## 1. Introduction

A Markov process is a random process in which the future is independent of the past, given the present. Markov processes, named for Andrei Markov are among the most important of all random processes. In a sense, they are the stochastic analogs of differential equations and recurrence relations, which are of course, among the most important deterministic processes.

### Basic Theory

#### The Markov Property

Suppose that $X X t t T$ is a random process on a probability space $Ω F$ where $X t$ is a random variable taking values in $S$ for each $t T$. We think of $X t$ as the state of a system at time $t$. The state space $S$ is usually either a countable set or a nice region of $k$ for some $k$. The time space $T$ is either  or $0$.

For $t T$, let $F t$ denote the $σ$-algebra of events generated by $X s s T s t$. Intuitively, $F t$ contains the events that can be defined in terms of $X s$ for $s t$. In other words, if we are allowed to observe the random variables $X s$ for $s t$, then we can tell whether or not a given event in $F t$ has occurred.

The random process $X$ is a Markov process if the following property (known as the Markov property) holds: For every $s T$ and $t T$ with $s t$, and for every $H F s$ and $x S$, the conditional distribution of $X t$ given $H$ and $X s x$ is the same as the conditional distribution of $X t$ just given $X s x$:

$X t A H X s x X t A X s x , A S$

In the statement of the Markov property, think of $s$ as the present time and hence $t$ is a time in the future. Thus, $x$ is the present state and $H$ is an event that has occurred in the past. If we know the present state, then any additional knowledge of events in the past is irrelevant in terms of predicting the future.

The complexity of Markov processes depends greatly on whether the time space or the state space are discrete or continuous. In this chapter, we assume both are discrete, that is we assume that $T$ and that $S$ is countable (and hence the state variables have discrete distributions). In this setting, Markov processes are known as Markov chains. The theory of Markov chains is very beautiful and very complete.

The Markov property for a Markov chain $X X 0 X 1$ can be stated as follows: for any sequence of states $x 0 x 1 x n 1 x y$,

$X n 1 y X 0 x 0 X 1 x 1 X n 1 x n 1 X n x X n 1 y X n x$

#### Stopping Times and the Strong Markov Property

Suppose that $X X 0 X 1 X 2$ is a Markov chain with state space $S$. As before, let $F n$ is the $σ$-algebra generated by $X 0 X 1 X n$ for each $n$. A random variable $T$ taking values in  is a stopping time or a Markov time for $X$ if $T n F n$ for each $n$. Intuitively, we can tell whether or not $T n$ by observing the chain up to time $n$. In some sense, a stopping time is a random time that does not require that we see into the future.

Suppose that $T$ is a stopping time for $X$. Show that for $n$,

1. $T n F n$
2. $T n F n$

The quintessential example of a stopping time is the hitting time to a nonempty set of states $A$:

$T A n 1 X n A$

where as usual, we define $min$. This random variable gives the first positive time that the chain is in $A$.

Show that $T A$ is a stopping time for $X$: $T A n X 1 A X n 1 A X n A$

The strong Markov property states that the future is independent of the past, given the present, when the present time is a stopping time. For a Markov chain, the ordinary Markov property implies the strong Markov property.

$X T 1 y X 0 x 0 X 1 x 1 X T x X T 1 y X T x$

#### Functions and Matrices

The study of Markov chains is simplified by the use of operator notation that is analogous to operations on vectors and matrices. Suppose that $U S S$ and $V S S$ and that $f S$ and $g S$. Define $U V S S$ by

$U V x z y y S U x y V y z , x y S 2$

Define $U f S$ by

$U f x y y S U x y f y , x S$

and define $f U S$ by

$f U y x x S f x U x y , y S$

Finally, we will sometimes let $f g$ denote the real number

$f g x x S f x g x$

In all of the definitions, we assume that if $S$ is infinite then the either the terms in the sums are nonnegative or the sums converge absolutely, so that the order of the terms in the sums does not matter. We will often refer to a function $U S S$ as a matrix on $S$. Indeed, if $S$ is finite, then $U$ really is a matrix in the usual sense, with rows and columns labeled by the elements of $S$. The product $U V$ is ordinary matrix multiplication; the product $U f$ is the product of the matrix $U$ and the column vector $f$; the product $f U$ is the product of the row vector $f$ and the matrix $U$; and the product $f g$ is he product of $f$ as a row vector and $g$ as a column vector, or equivalently, the inner product of the vectors $f$ and $g$.

The sum of two matrices on $S$ or two functions on $S$ is defined in the usual way, as is a real multiple of a matrix or function.

In the following exercises, suppose that $U$, $V$, and $W$ are matrices on $S$ and that $f$ and $g$ are functions on $S$. Assume also that the sums exist.

Show that the associate property holds whenever the operations makes sense. In particular,

1. $U V W U V W$
2. $U V f U V f$ and $f U V f U V$
3. $f U g f U g$,

Show that the distributive property holds whenever the operations makes sense. In particular,

1. $U V W U V U W$ and $U V W U W V W$
2. $f U V f U f V$ and $U V f U f V f$
3. $U f g U f U g$ and $f g U f U g U$

The commutative property does not hold in general. Give examples where

1. $U V V U$
2. $f U U f$

If $U$ is a matrix on $S$ we denote $U n U U U$, the $n$-fold (matrix) power of $U$ for $n$. By convention, $U 0 I$, the identity matrix on $S$, defined by

$x y 1 x y 0 x y$

If $U$ is a matrix on $S$ and $A S$, we will let $U A$ denote the restriction of $U$ to $A A$. Similarly, if $f$ is a function on $S$, then $f A$ denotes the restriction of $f$ to $A$.

#### Probability Functions and Matrices

If $f S 0$, then $f$ is a discrete probability density function (or probability mass function) on $S$ if

$x x S f x 1$

We have studied these in detail! On the other hand, if $P S S 0$, then $P$ is a transition probability matrix or stochastic matrix on $S$ if

$y y S P x y 1 , x S$

Thus, if $P$ is a transition matrix, then $y P x y$ is a probability density function on $S$ for each $x S$. In matrix terminology, the row sums are 1.

Show that if $P$ is a transition probability matrix on $S$ then $P 1 1$ where $1$ is the constant function 1 on $S$. Thus, in the language of linear algebra, $1$ is a right eigenvector of $P$, corresponding to the eigenvalue 1.

Suppose that $P$ and $Q$ are transition probability matrices on $S$ and that $f$ is a probability density function on $S$. Show that

1. $P Q$ is a transition probability matrix.
2. $P n$ is a transition probability matrix for each $n$
3. $f P$ is a probability density function.

Suppose that $f$ is the probability density function of a random variable $X$ taking values in $S$ and that $g S$. Show that $f g g X$ (assuming that the expected value exists).

A function $f$ on $S$ is said to be left-invariant for a transition probability matrix $P$ if $f P f$. In the language of linear algebra, $f$ is a left eigenvector of $P$ corresponding to the eigenvalue 1.

Show that if $f$ is left-invariant for $P$ then $f P n f$ for each $n$.

#### Basic Computations

Suppose again that $X X 0 X 1 X 2$ is a Markov chain with state space $S$. For $m$ and $m$ with $m n$, let

$P m n x y X n y X m x , x S , y S$

The matrix $P m n$ is the transition probability matrix from time $m$ to time $n$. The result in the next exercise is known as the Chapman-Kolmogorov equation, named for Sydney Chapman and Andrei Kolmogorov. It gives the basic relationship between the transition matrices.

Suppose that $k$, $m$, and $n$ are nonnegative integers with $k m n$. Use basic properties of conditional probability and the Markov property to show that

$P k m P m n P k n$.

It follows immediately that all of the transition probability matrices for $X$ can be obtained from the one-step transition probability matrices: if $m$ and $n$ are nonnegative integers with $m n$ then

$P m n P m m 1 P m 1 m 2 P n 1 n$.

Suppose that $m$ and $n$ are nonnegative integers with $m n$. Show that if $X m$ has probability density function $f m$, then $X n$ has probability density function $f n f m P m n$.

Combining the last two results, it follows that the distribution of $X 0$ (the initial distribution) and the one-step transition matrices determine the distribution of $X n$ for each $n$. Actually, these basic quantities determine the joint distributions of the process, a much stronger result.

Suppose that $X 0$ has probability density function $f 0$. Show that for any sequence of states $x 0 x 1 x n$,

$X 0 x 0 X 1 x 1 X n x n f 0 x 0 P 0 1 x 0 x 1 P n 1 n x n 1 x n$

Computations of this sort are the reason for the term chain in Markov chain.

#### Time Homogeneous Chains

A Markov chain $X X 0 X 1 X 2$ is said to be time homogeneous if the transition matrix from time $m$ to time $n$ depends only on the difference $n m$ for any nonnegative integers $m$ and $n$ with $m n$. That is,

$X n y X m x X n m y X 0 x , x S , y S$

It follows that there is a single one-step transition probability matrix $P$, given by

$P x y X n 1 y X n x , x S , y S$

and all other transition matrices can be expressed as powers of $P$. Indeed if $m n$ then $P m n P n m$, and the Chapman-Kolmogorov equation is simply the law of exponents for matrix powers. From Exercise 11, if $X m$ has probability density function $f m$ then $f n f m P n m$ is the probability density function of $X n$. In particular, if $X 0$ has probability density function $f 0$ then $f n f 0 P n$ is the probability density function of $X n$. The joint distribution in Exercise 12 above also simplifies: if $X 0$ has probability density function $f 0$, then for any sequence of states $x 0 x 1 x n$,

$X 0 x 0 X 1 x 1 X n x n f 0 x 0 P x 0 x 1 P x n 1 x n$

Suppose that $X 0$ has probability density function $f$ and that $f$ is left-invariant for $P$. Show that $X n$ has probability density function $f$ for each $n$ and hence the sequence of random variables $X$ is identically distributed (although certainly not independent in general).

In the context of the previous exercise, the probability distribution on $S$ associated with $f$ is said to be invariant or stationary for $P$ or for the Markov chain $X$. Stationary distributions turn out to be of fundamental importance in the study of the limiting behavior of Markov chains.

The assumption of time homogeneity is not as restrictive as might first appear. The following exercise shows that any Markov chain can be turned into a homogeneous chain by enlarging the state space with a time component.

Suppose that $X X 0 X 1 X 2$ is an inhomogeneous Markov chain with state space $S$, and let $Q n x y X n 1 y X n x$ denote the one-step transition probability at time $n$, for $x S$ and $y S$. Suppose that $N 0$ is a random variable taking values in , independent of $X$. Let $N n N 0 n$ and let $Y n X N n N n$ for $n$. Show that $Y Y 0 Y 1 Y 2$ is a homogeneous Markov chain on $S$ with transition probability matrix $P$ given by

$P x m y n Q m x y n m 1 0$

From now on, unless otherwise noted, the term Markov chain will mean homogeneous Markov chain.

Suppose that $X X 0 X 1 X 2$ is an Markov chain with state space $S$ and transition probability matrix $P$. For fixed $k$, show that $X 0 X k X 2 k$ is a Markov chain on $S$ with transition probability matrix $P k$.

The following exercise also uses the basic trick of enlarging the state space to turn a random process into a Markov chain.

Suppose that $X X 0 X 1 X 2$ is a random process on $S$ in which the future depends stochastically on the last two states. Specifically, suppose that for any sequence of states $x 0 x 1 x n 1 x y z$

$X n 2 z X 0 x 0 X 1 x 1 X n 1 x n 1 X n x X n 1 y X n 2 z X n x X n 1 y$

We also assume that this probability is independent of $n$, and we denote it by $Q x y z$. Let $Y n X n X n 1$ for $n$. Show that $Y Y 0 Y 1 Y 2$ is a Markov chain on $S S$ with transition probability matrix $P$ given by

$P x y w z Q x y z y w 0$

The result in the last exercise generalizes in a completely straightforward way to the case where the future of the random process depends stochastically on the last $k$ states, for some fixed $k$.

Suppose again that $X X 0 X 1 X 2$ is a Markov chain with state space $S$ and transition probability matrix $P$. The directed graph associated with $X$ has vertex set $S$ and edge set $x y S 2 P x y 0$. That is, there is a directed edge from $x$ to $y$ if and only if state $x$ leads to state $y$ in one step. Note that the graph may well have loops, since a state can certainly lead back to itself in one step.

Suppose that $A$ is a nonempty subset of $S$. Show that

$P A n x y X 1 A X 2 A X n 1 A X n y X 0 x , x y A 2$

That is, $P A n x y$ is the probability of going from state $x$ to state $y$ in $n$ steps, remaining in $A$ all the while. In graphical terms, it is the sum of products of probabilities along paths of length $n$ from $x$ to $y$ that stay inside $A$. Note that in general, $P A n x y P n A x y$.

### Examples and Applications

#### The Two-State Chain

Perhaps the simplest, non-trivial Markov chain has two states, say $S 0 1$ and the transition probability matrix given below, where $p$ and $q$ are parameters with $0 p 1$ and $0 q 1$.

$P 1 p p q 1 q$

Show that the eigenvalues of $P$ are 1 and $1 p q$.

Show that $B P B D$ where

$B 1 p 1 q and D 1 0 0 1 p q$.

Show that

$P n B D n B 1 p q q p 1 p q n p p 1 p q n q q 1 p q n p q 1 p q n$

Show that

$P n 1 p q q p q p as n$

Show that the only invariant probability density function for the chain is $f q p q p p q$.

In spite of its simplicity, the two state chain illustrates some of the basic limiting behavior and the connection with invariant distributions that we will study in general in a later section.

#### Independent Variables and Random Walks

Suppose that $X X 0 X 1 X 2$ is a sequence of independent random variables taking values in a countable set $S$, and that $X 1 X 2 X 3$ are identically distributed with (discrete) probability density function $f$.

Show that $X$ is a Markov chain on $S$ with transition probability matrix $P$ given by $P x y f y$ for $x S$ and $y S$. Show also that $f$ is invariant for $P$.

As a Markov chain, the process $X$ is not very interesting, although it is very interesting in other ways. Suppose now that $S$, the set of integers, and consider the partial sum process (or random walk) $Y$ associated with $X$:

$Y n i 0 n X i$

Show that $Y$ is a Markov chain on   with transition probability matrix $Q$ given by $P x y f y x$ for $x$ and $y$.

Consider the special case where $f 1 p$ and $f 1 1 p$, where $0 p 1$. Show that the transition probability matrix is given by

$Q x x 1 1 p , Q x x 1 p , x$

This special case is the simple random walk on . When $p 12$ we have the simple, symmetric random walk. Simple random walks are studied in more detail in the chapter on Bernoulli Trials.

#### Symmetric and Doubly Stochastic Matrices

A matrix $P$ on $S$ is doubly stochastic if it is nonnegative and if the row and columns sums are 1:

$u u S P x u 1 , u u S P u y 1 , x S , y S$

Suppose that $X$ is a Markov chain on a finite state space $S$ with doubly stochastic transition probability matrix $P$. Show that the uniform distribution on $S$ is invariant.

A matrix $P$ on $S$ is symmetric if $P x y P y x$ for all $x y S 2$.

1. Show that if $P$ is a symmetric, stochastic matrix then $P$ is doubly stochastic.
2. Give an example of a doubly stochastic matrix that is not symmetric.

#### Special Models

The Markov chains in the following exercises model important processes that are studied in separate sections. We will refer to these chains frequently.

Read the introduction to the Ehrenfest chains and work the exercises.

Read the introduction to the Bernoulli-Laplace chain and work the exercises.

Read the introduction to the reliability chains and work the exercises.

Read the introduction to the branching chain and work the exercises.

Read the introduction to the queuing chains and work the exercises.

Read the introduction to random walks on graphs and work the exercises.

Read the introduction to birth-death chains and work the exercises.