Consider this three-state transition matrix.

$$P=\left[\begin{array}{ccc}0& 1& 0\\ 0& 0& 1\\ 1& 0& 0\end{array}\right].$$

Create the irreducible and periodic Markov chain that is characterized by the transition matrix *P*.

At time *t* = 1,..., *T*, `mc`

is forced to move to another state deterministically.

Determine the stationary distribution of the Markov chain and whether it is ergodic.

xFix = *1×3*
0.3333 0.3333 0.3333

`mc`

is irreducible and not ergodic. As a result, `mc`

has a stationary distribution, but it is not a limiting distribution for all initial distributions.

Show why `xFix`

is not a limiting distribution for all initial distributions.

The initial distribution is reached again after several steps, which implies that the subsequent state distributions cycle through the same sets of distributions indefinitely. Therefore, `mc`

does not have a limiting distribution.

Create a lazy version of the Markov chain `mc`

.

lc =
dtmc with properties:
P: [3x3 double]
StateNames: ["1" "2" "3"]
NumStates: 3

ans = *3×3*
0.5000 0.5000 0
0 0.5000 0.5000
0.5000 0 0.5000

`lc`

is a `dtmc`

object. At time *t* = 1,..., *T*, `lc`

"flips a fair coin". It remains in its current state if the "coin shows heads" and transitions to another state if the "coin shows tails".

Determine the stationary distribution of the lazy chain and whether it is ergodic.

lcxFix = *1×3*
0.3333 0.3333 0.3333

`lc`

and `mc`

have the same stationary distributions, but only `lc`

is ergodic. Therefore, the limiting distribution of `lc`

exists and is equal to its stationary distribution.