Markov chains and stationarity
Evolve probability with a transition matrix and separate invariant distributions, recurrence, periodicity, and convergence.
On this page
The question for today
What you’ll understand
- Evolve a row probability vector using a stochastic matrix.
- Solve a finite-state stationarity equation with normalization.
- Explain why irreducibility and aperiodicity answer different questions.
A system can have memory even when its next step depends only on its present state. The present may encode the consequences of its entire past. A Markov chain makes that dependence precise and converts questions about repeated random transitions into linear algebra. The central distinction is between a distribution that stays unchanged and a distribution approached from a particular starting point. Those statements can disagree dramatically when transitions force alternating behavior or when different parts of the state space cannot communicate.
Choose a state and a matrix convention
For a time-homogeneous finite-state chain, P(i,j) is the probability that the next state is j given the current state i. Every entry is nonnegative and every row sums to one. We use row probability vectors, so an initial law evolves by multiplication on the right. The Markov property says that conditioning additionally on earlier states does not change the next-step probabilities once the current state is known. It does not assert that successive states are independent.
State selection is therefore a modeling decision. A queue length might fail to be Markov if the remaining service time matters; adding an appropriate age or residual-time variable may repair the state. A fitted transition matrix that changes with hour of day is not time homogeneous unless the clock is included in the state or the analysis explicitly allows time-dependent matrices. Checking the state description comes before applying a convenient matrix formula to observed data.
Invariance is a balance equation
A stationary distribution pi is a probability row vector satisfying pi P=pi. Starting the chain with this law leaves every later marginal unchanged. Individual sample paths still move. For two states, stationarity can be understood by balancing the probability mass flowing across their connecting edge. In a larger chain, the full balance equations allow net circulation around cycles; detailed balance on every pair is a stronger sufficient condition, not a requirement for stationarity in general.
Every finite chain has at least one stationary distribution. If the finite chain is irreducible, meaning every state can reach every other through some positive-probability path, the stationary distribution is unique and strictly positive. Reducible chains can have several stationary distributions supported on different closed classes. On infinite state spaces irreducibility alone is insufficient: positive recurrence is needed for an invariant probability distribution. A finite-state theorem should not silently become a theorem for all countable chains.
Periodicity controls convergence at fixed times
The period of a state is the greatest common divisor of its possible positive return times. In an irreducible chain all states share the same period. Aperiodic means this period is one. For a finite irreducible aperiodic chain, every initial law converges to the unique stationary distribution. Without aperiodicity, fixed-time distributions can oscillate forever. The two-state chain that switches deterministically at each step has a stationary uniform law but never forgets the parity of a deterministic starting state.
This does not make stationary analysis useless for periodic chains. In a finite irreducible chain, long-run occupation fractions and Cesàro averages of transition probabilities still identify the stationary law, even when fixed-time marginals fail to converge. The type of averaging is doing mathematical work. In simulation, saving every second observation can even hide transitions in a period-two example. Before interpreting a histogram as equilibrium, distinguish temporal averages, ensemble distributions at a fixed time, and the mixing assumptions that connect them. Even after convergence is established, a quantitative mixing-time bound is a separate question about how many transitions achieve a chosen error tolerance.
Work it through
Balancing two operating states
For , find the stationary law and the first two distributions starting in state 1.
Write . The first stationarity equation gives , hence and a=0.6. The invariant law is (0.6,0.4).
From μ₀=(1,0), one step gives μ₁=(0.8,0.2). A second step gives first component 0.8×0.8+0.2×0.3=0.70 and second component 0.8×0.2+0.2×0.7=0.30.
If aₙ is the first component, aₙ₊₁=0.5aₙ+0.3, so aₙ−0.6=0.5ⁿ(1−0.6). Both cross-state probabilities are positive, giving irreducibility, and each state has a self-loop, giving aperiodicity. The shrinking difference agrees with the convergence theorem.
The stationary law is (0.6,0.4). The initial law moves through (0.8,0.2) and (0.7,0.3), with its deviation halved at each step.
The living notebook
Explore the model
Interactive lab · probability
An invariant distribution is still a distribution
Set trials n to 1 and p to 0.4. The two exact binomial bars have masses 0.6 and 0.4, matching the stationary law in the example. Change p to see candidate distributions, then check the balance equation on paper. This lab draws independent-trial binomial probabilities; it does not apply a transition matrix, animate chain paths, or establish mixing.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forThe shape of a stationary law does not explain how a chain reaches it; transition rules and periodicity supply that information.
Pause & reason
Check your understanding
Your turn
Try it yourself
A chain has two absorbing states and no transitions between them. Find its stationary distributions and explain which theorem hypothesis fails.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The transition matrix is the identity. Multiply a general probability row vector by it.
Compare with the solution
Every law (a,1−a), with 0≤a≤1, remains unchanged, so there are infinitely many stationary distributions. The chain is reducible because one state cannot reach the other. Self-loops make each absorbing class aperiodic, demonstrating why aperiodicity alone cannot produce uniqueness across disconnected closed classes.
Keep the idea
Take it with you
- The Markov property is conditional independence of the next step from the earlier past, given a sufficient present state.
- Finite irreducibility gives a unique stationary law; aperiodicity additionally gives convergence at fixed times.
- Time averages, invariant laws, and convergence of marginal distributions are related but distinct statements.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.