Markov Chains — Transition Matrices and Stationary Distributions
A Markov chain is a stochastic process whose future evolution depends only on its present state, not its history. Its dynamics are encoded in a transition matrix whose entries are conditional probabilities, and its long-run behaviour is captured by a stationary distribution satisfying . Applies to: queueing theory, PageRank, statistical physics, genetics, MCMC sampling. Core machinery developed by Andrey Markov (1906); convergence theory matured through the 20th century.
The present screens off the past. Because the future depends on the past only through the current state, the whole evolution reduces to linear algebra: distributions are row vectors, one time step is right-multiplication by , and equilibrium is a left eigenvector of with eigenvalue . Probability theory becomes the spectral theory of a stochastic matrix.
Formal Statement
Let be a countable set (the state space). A sequence of -valued random variables is a (time-homogeneous) Markov chain if for all and all states with positive probability,
Derivation hint: this is the definitional axiom; "time-homogeneous" means the right-hand side is independent of , so a single matrix suffices. Here is the transition probability from to , and is the transition matrix. The initial distribution is the row vector with .
A matrix is row-stochastic (or simply stochastic) if
Derivation hint: each row is the conditional distribution of given , so it must be a probability vector — nonnegative and summing to one. Every transition matrix is stochastic, and conversely every stochastic matrix with a chosen initial distribution defines a Markov chain.
Write for the -step transition probability. Then
Derivation hint: iterate the Chapman–Kolmogorov equation ; the row vector of marginal probabilities evolves by right-multiplication, by the law of total probability. where is the distribution at time .
For all and all states ,
Derivation hint: condition on the intermediate state and use the Markov property to split the path at time ; this is exactly matrix multiplication .
A probability row vector (so , ) is a stationary distribution (or invariant distribution) of if
Derivation hint: require that if then ; by equation [3] this is exactly , making a left eigenvector of for eigenvalue . If , then for all : the chain is in statistical equilibrium.
- The chain is irreducible if every state can be reached from every other: for all there exists with .
- The period of state is . The chain is aperiodic if for all (in an irreducible chain the period is a common value).
- A state is recurrent if , and positive recurrent if the mean return time is finite, where .
Let be the transition matrix of an irreducible Markov chain on . 1. A stationary distribution exists iff the chain is positive recurrent; when it exists it is unique and satisfies for all . 2. (Return-time formula) , the reciprocal of the mean return time to . 3. (Convergence) If in addition the chain is aperiodic, then for every initial distribution ,
Derivation hint: aperiodicity + irreducibility + finite state space makes some power strictly positive; the Perron–Frobenius theorem then forces a simple dominant eigenvalue with all other eigenvalues strictly inside the unit disk, so converges to the rank-one projection .
Why It Holds / Derivation
We sketch the finite-state argument, the most important undergraduate case. 1. Stochasticity gives eigenvalue 1. Since each row of sums to , the all-ones column vector satisfies . Thus is an eigenvalue of (a right eigenvector). A matrix and its transpose share eigenvalues, so there exists a left eigenvector with . 2. Sign control via Perron–Frobenius. Irreducibility means (viewed as a nonnegative matrix) is irreducible in the matrix sense. The Perron–Frobenius theorem guarantees that the spectral radius equals , is a simple eigenvalue, and its left eigenvector can be taken with all entries strictly positive. 3. Normalisation. Since and is finite (finite state space), set . Then is a probability vector with , establishing existence.
∎1. Uniqueness. Perron–Frobenius makes eigenvalue simple, so its eigenspace is one-dimensional; the only probability vector in it is . Hence is unique. 2. Return-time identity. Define the expected number of visits to between consecutive visits to a fixed reference state. The renewal-reward theorem says the long-run fraction of time in state equals (expected visits to per cycle)/(expected cycle length). Choosing the cycle to be a return to itself gives one visit per cycle of mean length , so the long-run frequency is . By the ergodic theorem for Markov chains this frequency equals . Hence , and finiteness of (positive recurrence) is exactly the condition for .
∎1. Construct two coupled copies. Run a chain started from and an independent chain started from , evolving by the same . 2. Coupling time. Irreducibility + aperiodicity guarantees the joint chain is irreducible on and reaches the diagonal with probability in finite expected time . 3. Once coupled, stay coupled. After , run identically. Since for all ,
This gives total-variation convergence , proving equation [6]. Aperiodicity is essential: without it may be infinite because the two chains never align in phase.
∎A student of Pafnuty Chebyshev at St. Petersburg, Markov introduced his chains in 1906 to extend the law of large numbers and the central limit theorem to dependent random variables — refuting the then-common belief that independence was indispensable. In a celebrated 1913 study he applied the method to the sequence of vowels and consonants in Pushkin's Eugene Onegin, arguably the first quantitative analysis of text as a stochastic process. A fierce, principled man, Markov publicly resigned privileges in protest of Tsarist politics. His chains became foundational to twentieth-century probability, information theory, and computation.
Building Intuition
Think of a frog hopping among lily pads. The transition matrix tells you, from whichever pad the frog sits on right now, the odds of each next pad — and crucially the frog has no memory of how it got there. If you place a large cloud of frogs according to distribution and let them all hop once, the new cloud is ; hop again, . The stationary distribution is the special cloud shape that hops to itself — pour the frogs out in proportion and the population picture never changes, even though every individual frog keeps moving. The convergence theorem says that any starting cloud, after enough hops, relaxes to this same shape — the system forgets its initial condition. And has a beautifully concrete meaning: the busiest pads (high ) are exactly the ones the frog returns to fastest.
```svg
```
Worked Examples
Given: with
Find the stationary distribution.
Steps. 1. Write and solve :
2. The first equation gives . (The two equations are dependent — expected, since rows of are linearly dependent.) 3. Apply normalisation : , so . 4. Check via return time: steps mean return time to .
Given: States with
today is Sunny, i.e. .
Steps. 1. Two-step forecast: . Then
So . 2. Stationary distribution: solve , giving , so . Normalise: , , . 3. Interpretation: in the long run roughly of days are sunny, independent of today's weather (chain is irreducible and aperiodic — note kills periodicity). 4. Mean return time to Rain: days.
Common Misconceptions
A stationary distribution is not a fixed state. The chain does not stop at . Individual trajectories keep jumping forever; it is the probability distribution over states that is frozen. Likewise, "" is a statement about the row vector (a left eigenvector), not about (the right eigenvector , which every stochastic matrix has trivially). Confusing left and right eigenvectors is the single most common error.
Existence of does not guarantee convergence. A unique stationary distribution can exist while fails to converge — this happens for periodic chains. Convergence in equation [6] requires aperiodicity in addition to irreducibility and positive recurrence. The time-average (Cesàro mean) always converges to for irreducible positive-recurrent chains, but the instantaneous distribution may oscillate forever.
Take and the deterministic swap
This chain is irreducible and its unique stationary distribution is (check: ). But starting from we get , , — the distribution oscillates with period and never converges to . The period is , so the chain is not aperiodic and equation [6] does not apply. The Cesàro average, however, does tend to .
Take with two absorbing states and one transient:
This chain is reducible: states and are absorbing. Every mixture with satisfies , so the stationary distribution is far from unique. Irreducibility in the Fundamental Theorem is exactly what rules this out.
Connections
Markov chains sit at a crossroads of several theories. The matrix machinery is pure Linear Algebra: stationary distributions are left eigenvectors and convergence rates are governed by the second-largest eigenvalue modulus (the spectral gap). Existence and positivity flow from the Perron–Frobenius Theorem for nonnegative matrices. The convergence proof relies on Coupling of Stochastic Processes and on ergodic ideas shared with Ergodic Theory. The continuous-time analogue replaces by a generator and the equation by , leading to Continuous-Time Markov Chains and the Kolmogorov Forward and Backward Equations. When the chain satisfies the detailed balance condition it is reversible, connecting to Reversible Markov Chains and Detailed Balance and the electrical-network analogy.
Real-World Applications
Historical Development
Subtleties & Limits
For finite chains the theory is complete, but quantitative and infinite-state questions remain rich. Mixing-time estimation — how many steps until — is governed by the spectral gap, yet computing it sharply for high-dimensional chains (e.g. those used in MCMC for hard combinatorial measures) is often open and ties into complexity theory. The cutoff phenomenon, where convergence happens abruptly within a narrow window, is proven only for special families and its general characterisation is unresolved. For countably infinite chains, distinguishing positive recurrence, null recurrence, and transience requires delicate Lyapunov-function or Foster–Lyapunov criteria, and explicit stationary distributions may not exist in closed form. Non-reversible chains, which can mix faster than reversible ones, lack a comprehensive spectral theory — designing optimal non-reversible MCMC samplers is an active research frontier.
See Also
Perron–Frobenius Theorem · Random Walks on Graphs · Ergodic Theory · PageRank · Coupling of Stochastic Processes · Poisson Processes · Renewal Theory