Stationary distributions of Markov chains
The question
Can you choose the switch probabilities so the chance of being at A never settles?
Start at A and build the transition matrix yourself.
- 1 SeeBuild a chain and test it.
- 2 TryPredict a limit, then change the matrix.
- 3 ProveBuild the convergence argument.
- 4 ApplySolve for probabilities and eigenvalues.
Before you start · 3 quick checks on probability, matrix products, and eigenvectors
Two ideas before you start
2 ideasRead a row from the current state
The bars compare the chances of ending the next step at A and B, given the current state.
Select a starting state to read its row. One entry gives the chance of staying, and the other gives the chance of switching.
Exact definition
A transition matrix \(P\) has entry \(P_{ij}\) equal to the probability of moving to state \(j\) in one step when the current state is \(i\). Its entries are nonnegative and each row sums to one. We use a finite set of states and discrete steps. The current state determines the next-step probabilities, and the same matrix applies at each step.
List the probabilities of the current state in a row vector \(p\). The next distribution is \(pP\). Its entry for a destination \(j\) sums the incoming probability \(p_iP_{ij}\) over the possible origins \(i\).
Compare a distribution before and after a step
The bars compare the probability at A before and after one step in the same example chain.
Try both mixes. When the probability at A is unchanged, the probability at B is unchanged too.
Exact definition
A distribution \(\pi\) is stationary for \(P\) if \(\pi P=\pi\). It is a row of nonnegative entries whose sum is one. If you initialize the chain with \(\pi\), its distribution is \(\pi\) at every later step. An individual walker can still move.
This equation makes \(\pi\) a left eigenvector of \(P\) for eigenvalue \(1\). Equivalently, the column \(\pi^{\mathsf T}\) is a right eigenvector of \(P^{\mathsf T}\).
Notation for the two-state chain
Use \(a\) for the chance of a move from A to B and \(b\) for the chance of a move from B to A. Both lie in the closed interval from zero to one. In the matrix below, rows and columns are ordered A, B.
\[P=\begin{pmatrix}1-a&a\\ b&1-b\end{pmatrix}.\]Write \(x_n\) for the chance of being at A after \(n\) steps. The row distribution is \((x_n,1-x_n)\). Starting at A means all the initial mass is at A. You can also start with a mixture, such as a population of walkers assigned to different initial states.
Build a chain that never settles from A
- Set the chance of switching from each state. The table fills in the chances of staying.
- Press Test this matrix. The goal is for the sequence of probabilities at A to have no limit, starting at A.
- Try another matrix. Check whether both states can reach each other and compare the paths from A and B.
When there is a unique stationary distribution, \(r\) is the factor that multiplies the signed gap between the probability at A and its stationary value at each step.
Predict a limit, then change the matrix
Check your prediction to open the explorer.
- Move either switch probability to change the chain. Use the step control to inspect the solid and dashed paths.
- Match each goal. Advancing restores the explorer's initial matrix and selects the final plotted step.
When there is a unique stationary distribution, the dotted line shows its A component. The same line can appear even when the paths fail to settle. The value of \(r\) measures how the signed gap from that line changes per step. The proof below derives it.
What does the chain forget?
When both plotted paths approach the same point, any mixture of those starting distributions approaches it too. At each step the mixture gives the same weighted average of the two paths, with weights set by the initial distribution. A small gap between the paths over the plotted window is evidence about those steps. It takes an argument about all later steps to establish a limit.
These curves track probabilities at a fixed time across possible histories. They say where a walker may be at that time. They give neither a single walker's route nor a count of its visits.
Why the two-state probabilities settle
Use the fixed two-state matrix from Start, with \(0\le a,b\le 1\). Assume \(0\lt a+b\lt2\). Let \(x_0\) be any starting probability at A. There is a unique stationary distribution \(\pi=(x_*,1-x_*)\), where \(x_*=b/(a+b)\). The distributions from every start converge to \(\pi\).
- Choose the true statement at each step. The proof starts from the one-step update.
To be at A next, the walker can stay at A or move in from B. Adding those two contributions gives
\[\begin{aligned} x_{n+1} &= (1-a)x_n \\ &\quad + b(1-x_n). \end{aligned}\]The two boundary cases excluded by the theorem can be checked directly. When \(a+b=0\), both moves have chance zero. The matrix is the identity, so every initial distribution is stationary and stays where it started. When \(a+b=2\), both moves have chance one. The update is \(x_{n+1}=1-x_n\). The equal split is stationary and every other start alternates between distinct values. The return times to either state are the positive even steps, so this chain has period two.
Reachability and period for larger chains
A chain is irreducible if every state can reach every other along a path of positive probability. In an irreducible chain, the period is the greatest common divisor of the possible positive return times to a state. It is the same for all states. Period one is called aperiodic. The finite irreducible, aperiodic convergence theorem gives a unique stationary distribution and convergence to it from every start. The proof builder establishes the specific two-state theorem above.
Irreducibility and aperiodicity together are sufficient for this convergence, but irreducibility is not necessary. The explorer also covers a reducible example with a common limit. When there is a positive chance to move from A to B and no chance to move back, B absorbs the chain. A walker that starts at A is still there only if it stayed at every step, and that chance shrinks to zero, so both starts approach B.
See the two left eigenvectors
Right multiplication by \(P\) fixes \(\pi\). It multiplies the row \((1,-1)\) by \(r=1-a-b\). This second row has sum zero. It changes the mass in the two entries by equal and opposite amounts when added with a coefficient. The stationary row has sum one. Whenever \(a+b\gt0\), the two rows form a basis with distinct eigenvalues, and the stationary direction has just one row whose entries sum to one.
The initial row can be written as the stationary row plus \((x_0-x_*)(1,-1)\). Applying \(P\) repeatedly preserves the first term and scales the second by \(r^n\). This is the same power calculation as in diagonalization, written with row eigenvectors.
Solve for stationary shares and limits
Enter a number in each box. Enter probabilities as decimals. Each problem lists the accepted absolute error and has hints and a worked solution.
Further reading
- J. R. Norris, Markov Chains, on invariant distributions and convergence to equilibrium.
- D. A. Levin and Y. Peres, Markov Chains and Mixing Times, with contributions by E. L. Wilmer.