Stationary Distributions

Imagine a large city's residents moving between neighborhoods according to fixed probabilistic rules each year. Does the fraction of the population living in each neighborhood eventually stop changing? This holds regardless of how the population started out. This question — whether a random process settles into a stable long-run pattern — is exactly what the theory of stationary distributions answers for Markov Chains. A stationary distribution is a probability vector that the chain leaves unchanged. If today's location is distributed according to π\pi, tomorrow's location has the same distribution π\pi. This single algebraic equation, πP=π\pi P = \pi, turns out to control an enormous amount of qualitative behavior. It governs whether long-run time averages exist. It also determines what values they take, and how quickly an arbitrary starting distribution is forgotten. The central result of this article is often attributed to the broader Perron–Frobenius circle of ideas. This was specialized by Markov and developed rigorously in the 20th century. It says that an irreducible, positive recurrent Markov chain has a unique stationary distribution. This distribution is given explicitly by the reciprocals of mean return times. Conversely, an irreducible chain admitting a stationary distribution is automatically positive recurrent. This equivalence is the engine behind the Ergodic Theorem for Markov Chains. It also underlies Markov Chain Monte Carlo algorithms, and the PageRank algorithm that ranks web pages. This article gives the precise definition. It states and proves existence and uniqueness for irreducible positive recurrent chains. It works two fully asymmetric numerical examples. It shows exactly why irreducibility cannot be dropped. Finally, it surveys where stationary distributions appear across mathematics, physics, and computing.

Key takeaways
  • A stationary distribution π\pi solves πP=π\pi P = \pi, π≥0\pi \geq 0, ∑iπi=1\sum_i \pi_i = 1: it is a fixed point of the chain's one-step evolution on the space of probability vectors.
  • For an irreducible, positive recurrent chain, a stationary distribution exists and is unique, given by πi=1/μi\pi_i = 1/\mu_i where μi\mu_i is the mean return time to state ii.
  • Irreducibility alone is not enough: null recurrent and transient irreducible chains have no stationary distribution.
  • Existence of a stationary distribution for an irreducible chain forces positive recurrence — the implication goes both ways.
  • Aperiodicity is not needed for existence/uniqueness of π\pi, only for the convergence Pijn→πjP^n_{ij} \to \pi_j (a stronger, separate statement).
  • Key idea: stationarity is a linear fixed-point equation whose unique nonnegative normalized solution, for irreducible chains, exists exactly when the chain is positive recurrent, and equals inverse mean return time.

Where this lives today

Stationary distributions are the mathematical backbone of Markov Chain Monte Carlo (MCMC): algorithms like Metropolis–Hastings and Gibbs sampling are designed so that a target distribution (e.g., a Bayesian posterior) is exactly the stationary distribution of an engineered chain, letting simulation approximate otherwise intractable integrals. In statistical physics, the Gibbs/Boltzmann distribution of a system in thermal equilibrium is precisely the stationary distribution of the microscopic dynamics (e.g. Glauber dynamics for the Ising model), and detailed balance with respect to it encodes reversibility. In queueing theory and operations research, the stationary distribution of queue length or server-occupancy chains gives long-run performance metrics (average wait time, blocking probability) used in network and call-center design. In computer science, Google's original PageRank algorithm models a web surfer as a Markov chain on hyperlinks, and a page's importance score is its stationary probability; the same idea underlies reputation and ranking systems in social networks. In genetics, the stationary distribution of the Wright–Fisher and Moran models describes long-run allele frequency distributions under mutation-selection balance. In information theory, the entropy rate of a stationary Markov source is computed directly from π\pi and PP, and source coding theorems are stated relative to the stationary regime.

Ask the tutor: How does the stationary distribution relate to the long-run time average of a Markov chain, and how is that connection made precise by the Ergodic Theorem for Markov Chains?

DefinitionStationary Distribution

Let (Xn)n≥0(X_n)_{n \geq 0} be a Markov chain on a countable state space SS with transition matrix P=(pij)i,j∈SP = (p_{ij})_{i,j \in S}, so that

pij=Pr⁡(Xn+1=j∣Xn=i),∑j∈Spij=1 for all i.p_{ij} = \Pr(X_{n+1} = j \mid X_n = i), \qquad \sum_{j \in S} p_{ij} = 1 \text{ for all } i.

A stationary distribution (also called an invariant distribution or equilibrium distribution) is a vector π=(πi)i∈S\pi = (\pi_i)_{i \in S} such that: 1. πi≥0\pi_i \geq 0 for all i∈Si \in S, and ∑i∈Sπi=1\sum_{i \in S} \pi_i = 1 (it is a probability distribution); 2. πP=π\pi P = \pi, i.e. for every j∈Sj \in S,

πj=∑i∈Sπi pij.\pi_j = \sum_{i \in S} \pi_i \, p_{ij}.

Equivalently, if X0X_0 has distribution π\pi, then XnX_n has distribution π\pi for every n≥0n \geq 0; the law of the chain is constant in time along π\pi.

Intuition

Think of π\pi as a row vector describing "how much probability mass sits at each state." The equation πP=π\pi P = \pi says: redistribute the mass one step according to PP, and you get the same vector back. It is the discrete, probabilistic analogue of an eigenvector equation — indeed π\pi is a left eigenvector of PP with eigenvalue 11, normalized to sum to one. A second way to see π\pi is through time averages. If the chain is irreducible and positive recurrent, the long-run fraction of time spent in state jj converges (this is the content of the Ergodic Theorem for Markov Chains, foreshadowed here) to πj\pi_j, and πj\pi_j equals the reciprocal of the mean time μj\mu_j needed to return to jj having just left it. States visited often (small μj\mu_j) get large stationary mass; states visited rarely get small mass. This "inverse mean return time" formula is not just a definition — it is a theorem, proved below via a renewal argument. A third, complementary picture: run the chain for a long time from any starting distribution. Under mild extra conditions (irreducibility, positive recurrence, and aperiodicity), the distribution of XnX_n converges to π\pi regardless of where the chain started. Stationarity is the destination of this convergence, whether or not the convergence itself holds — existence and uniqueness of π\pi are genuinely weaker and more robust facts than the convergence theorem, and periodicity is irrelevant to them.

Figure
A three-state chain and its stationary vector as a fixed point of π↦πP\pi \mapsto \pi P
1 2 3 p12=0.3 p13=0.2 p23=0.5 p31=1 p11=0.5 p22=0.5 π = (π₁, π₂, π₃) solves π = πP exactly: π = (10/23, 6/23, 7/23) ≈ (0.435, 0.261, 0.304)
TheoremExistence and Uniqueness of the Stationary Distribution for Irreducible Positive Recurrent Chains

Let (Xn)(X_n) be an irreducible Markov chain on a countable state space SS with transition matrix PP. For i∈Si \in S let

μi=Ei[Ti],Ti=min⁡{n≥1:Xn=i},\mu_i = \mathbb{E}_i[T_i], \qquad T_i = \min\{n \geq 1 : X_n = i\},

be the mean return time to ii (started at ii), and say the chain is positive recurrent if μi<∞\mu_i < \infty for some (equivalently, by irreducibility, every) i∈Si \in S. Then:

(a) If the chain is positive recurrent, there exists a stationary distribution π\pi, it is unique, and it satisfies πi>0\pi_i > 0 for all i∈Si \in S, with

πi=1μifor every i∈S.\pi_i = \frac{1}{\mu_i} \qquad \text{for every } i \in S.

(b) Conversely, if the chain is irreducible and admits some stationary distribution π\pi, then the chain is positive recurrent, and π\pi is the (unique) distribution given by πi=1/μi\pi_i = 1/\mu_i as in (a).

(c) If the chain is irreducible but not positive recurrent (i.e. it is transient, or null recurrent), then no stationary distribution exists.

Proof

We argue in several steps. Throughout, irreducibility means every state communicates with every other: for all i,j∈Si,j \in S there exists n≥0n \geq 0 with pij(n)>0p_{ij}^{(n)} > 0. The proof technique is a direct renewal / occupation-measure construction, following the classical approach; we build a stationary measure from excursions out of a fixed reference state and then normalize it.

Step 1: Construction of a stationary measure via excursions. Fix a reference state k∈Sk \in S. Since the chain is irreducible, it visits kk infinitely often almost surely provided it is recurrent (this is a standard consequence of the Periodicity and Positive Recurrence theory: irreducible chains are either all-transient or all-recurrent, classified as a class). Assume first that the chain is recurrent (we will justify the positive recurrent case fully; the general dichotomy transient/null/positive is assumed known from prerequisites). For j∈Sj \in S define

γj=Ek[∑n=0Tk−11{Xn=j}],\gamma_j = \mathbb{E}_k\left[ \sum_{n=0}^{T_k - 1} \mathbf{1}\{X_n = j\} \right],

the expected number of visits to jj during one excursion from kk back to kk (started at X0=kX_0 = k, TkT_k the first return time to kk). Note γk=1\gamma_k = 1, since the excursion visits kk exactly once, at time 00 (it does not count time TkT_k itself). Claim: γ=(γj)j∈S\gamma = (\gamma_j)_{j \in S} satisfies γP=γ\gamma P = \gamma, i.e. γj=∑iγipij\gamma_j = \sum_i \gamma_i p_{ij} for all jj. By recurrence, Tk<∞T_k < \infty a.s., so we may write, using Tonelli's theorem to interchange sum and expectation (all terms nonnegative):

γj=Ek[∑n=0∞1{n<Tk,Xn=j}]=∑n=0∞Pr⁡k(Xn=j, Tk>n).\gamma_j = \mathbb{E}_k\left[\sum_{n=0}^{\infty} \mathbf{1}\{n < T_k, X_n = j\}\right] = \sum_{n=0}^{\infty} \Pr_k(X_n = j,\ T_k > n).

Now shift the index by one step. For n≥0n \geq 0,

Pr⁡k(Xn+1=j, Tk>n)=∑i∈SPr⁡k(Xn=i, Tk>n) pij,\Pr_k(X_{n+1} = j,\ T_k > n) = \sum_{i \in S} \Pr_k(X_n = i,\ T_k > n)\, p_{ij},

because {Tk>n}\{T_k > n\} is determined by X0,…,XnX_0,\dots,X_n (it is the event that the chain has not yet returned to kk by time nn), so conditioning on Xn=iX_n = i within that event and using the Markov property gives exactly the one-step transition pijp_{ij} to reach jj at time n+1n+1. Summing over n≥0n \geq 0:

∑n=0∞Pr⁡k(Xn+1=j,Tk>n)=∑ipij∑n=0∞Pr⁡k(Xn=i,Tk>n)=∑iγi pij.\sum_{n=0}^\infty \Pr_k(X_{n+1}=j, T_k>n) = \sum_i p_{ij} \sum_{n=0}^\infty \Pr_k(X_n = i, T_k > n) = \sum_i \gamma_i\, p_{ij}.

On the other hand, the left side equals ∑n=0∞Pr⁡k(Xn+1=j,Tk>n)\sum_{n=0}^\infty \Pr_k(X_{n+1} = j, T_k > n). Reindex m=n+1≥1m = n+1 \geq 1:

∑m=1∞Pr⁡k(Xm=j, Tk≥m).\sum_{m=1}^\infty \Pr_k(X_m = j,\ T_k \geq m).

Since {Tk≥m}⊃{Tk>m}\{T_k \geq m\}\supset\{T_k>m\} differ only by the single event {Tk=m}\{T_k = m\}, we split:

∑m=1∞Pr⁡k(Xm=j,Tk>m)+∑m=1∞Pr⁡k(Xm=j,Tk=m).\sum_{m=1}^\infty \Pr_k(X_m=j, T_k>m) + \sum_{m=1}^\infty \Pr_k(X_m = j, T_k = m).

The first sum is γj−Pr⁡k(X0=j,Tk>0)=γj−1{j=k}\gamma_j - \Pr_k(X_0 = j, T_k > 0)= \gamma_j - \mathbf 1\{j=k\} (the n=0n=0 term of the defining sum for γj\gamma_j is Pr⁡k(X0=j,Tk>0)=1{j=k}\Pr_k(X_0=j,T_k>0)=\mathbf1\{j=k\}, since X0=kX_0=k a.s. under Pr⁡k\Pr_k and Tk≥1T_k\ge1 always). The second sum equals Pr⁡k(XTk=j,Tk<∞)=1{j=k}\Pr_k(X_{T_k}=j, T_k<\infty) = \mathbf{1}\{j=k\} (since XTk=kX_{T_k}=k a.s. by definition of TkT_k, and Tk<∞T_k < \infty a.s. by recurrence). Adding these two contributions: γj−1{j=k}+1{j=k}=γj\gamma_j - \mathbf 1\{j = k\} + \mathbf 1\{j=k\} = \gamma_j. Hence

∑iγipij=γjfor every j∈S,\sum_i \gamma_i p_{ij} = \gamma_j \quad \text{for every } j \in S,

proving the claim: γP=γ\gamma P = \gamma.

Step 2: γ\gamma is finite and strictly positive at every state, and ∑jγj=μk\sum_j \gamma_j = \mu_k. By definition, ∑jγj=Ek[Tk]=μk\sum_j \gamma_j = \mathbb{E}_k[T_k] = \mu_k (summing the number of visits to each state over one excursion counts every one of the TkT_k steps n=0,…,Tk−1n=0,\dots,T_k-1 exactly once). If the chain is positive recurrent, μk<∞\mu_k < \infty, so ∑jγj<∞\sum_j \gamma_j < \infty; in particular each γj<∞\gamma_j < \infty. To see γj>0\gamma_j > 0 for every jj: by irreducibility there is nn with pkj(n)>0p_{kj}^{(n)} > 0, and since γPn=γ\gamma P^n = \gamma (iterating γP=γ\gamma P=\gamma), we get γj=∑iγipij(n)≥γkpkj(n)=pkj(n)>0\gamma_j = \sum_i \gamma_i p_{ij}^{(n)} \geq \gamma_k p_{kj}^{(n)} = p_{kj}^{(n)} > 0, using γk=1\gamma_k = 1.

Step 3: Normalization gives a stationary distribution, and πk=1/μk\pi_k = 1/\mu_k. Since 0<∑jγj=μk<∞0 < \sum_j \gamma_j = \mu_k < \infty, define

πj:=γjμk.\pi_j := \frac{\gamma_j}{\mu_k}.

Then πj≥0\pi_j \geq 0, ∑jπj=1\sum_j \pi_j = 1, and πP=γP/μk=γ/μk=π\pi P = \gamma P/\mu_k = \gamma/\mu_k = \pi by Step 1. So π\pi is a stationary distribution, and by construction πk=γk/μk=1/μk\pi_k = \gamma_k/\mu_k = 1/\mu_k. This proves existence, and gives the formula at the reference state kk. Since k∈Sk \in S was an arbitrary state (we may repeat the whole construction with any state as reference), this proves πi=1/μi\pi_i = 1/\mu_i for every i∈Si \in S, once we also know π\pi is unique (so that the formula obtained by choosing reference state ii agrees with the one obtained by choosing reference state kk and normalizing). We now prove uniqueness, which closes this gap.

Step 4: Uniqueness. Suppose ν\nu is any stationary distribution: ν≥0\nu \geq 0, ∑iνi=1\sum_i \nu_i = 1, νP=ν\nu P = \nu. We show νj=γj/μk\nu_j = \gamma_j / \mu_k for all jj, i.e. ν=π\nu = \pi as constructed above with reference state kk. From νP=ν\nu P = \nu we get νPn=ν\nu P^n = \nu for all n≥0n \geq 0, i.e. νj=∑iνi pij(n)\nu_j = \sum_i \nu_i\, p_{ij}^{(n)}. In particular, for any finite set F⊂SF \subset S and any nn,

νj≥∑i∈Fνi pij(n).\nu_j \geq \sum_{i \in F} \nu_i\, p_{ij}^{(n)}.

A standard identity (proved by the same first-entrance decomposition as in Step 1, applied backward from kk; this is a form of the discrete renewal/last-exit decomposition) gives, summing over n=0n=0 to N−1N-1 and letting N→∞N \to \infty, the inequality

νj≥νk γj,\nu_j \geq \nu_k \, \gamma_j,

where γj\gamma_j is exactly the expected-visits quantity from Step 1 (this is the standard "ν≥νkγ\nu \ge \nu_k \gamma" lemma for stationary measures of irreducible recurrent chains: intuitively, ν\nu restricted to excursions from kk dominates νk\nu_k times the expected excursion visit counts). Summing over all j∈Sj \in S:

1=∑jνj≥νk∑jγj=νkμk.1 = \sum_j \nu_j \geq \nu_k \sum_j \gamma_j = \nu_k \mu_k.

So νk≤1/μk\nu_k \leq 1/\mu_k. We must show equality holds, and holds coordinatewise (νj=νkγj\nu_j = \nu_k \gamma_j for every jj, not just in aggregate). Suppose for contradiction νj0>νkγj0\nu_{j_0} > \nu_k \gamma_{j_0} for some j0j_0. Summing the inequality νj≥νkγj\nu_j \ge \nu_k\gamma_j (valid for all jj) together with this strict inequality at j0j_0 gives, upon summing over j∈Sj\in S,

1=∑jνj>νk∑jγj=νkμk,1 = \sum_j \nu_j > \nu_k \sum_j \gamma_j = \nu_k \mu_k,

so νk<1/μk\nu_k < 1/\mu_k strictly. Now apply irreducibility: since νPn=ν\nu P^n = \nu for all nn and γPn=γ\gamma P^n = \gamma for all nn, the vector ν−νkγ\nu - \nu_k\gamma is entrywise ≥0\geq 0 (by the inequality above, applied with each state as the "jj"), sums to 1−νkμk>01 - \nu_k\mu_k > 0, and satisfies (ν−νkγ)P=ν−νkγ(\nu - \nu_k \gamma)P = \nu - \nu_k\gamma, so it is itself a nonnegative (non-normalized) stationary measure, call it ρ=ν−νkγ≠0\rho = \nu - \nu_k \gamma \ne 0. Since ρ≥0\rho \geq 0 and ρ≠0\rho \neq 0, some ρi0>0\rho_{i_0} > 0; by irreducibility choose nn with pi0k(n)>0p_{i_0 k}^{(n)} > 0. Then from ρ=ρPn\rho = \rho P^n,

ρk=∑iρi pik(n)≥ρi0pi0k(n)>0.\rho_k = \sum_i \rho_i\, p_{ik}^{(n)} \geq \rho_{i_0} p_{i_0 k}^{(n)} > 0.

But ρk=νk−νkγk=νk−νk⋅1=0\rho_k = \nu_k - \nu_k \gamma_k = \nu_k - \nu_k \cdot 1 = 0 (recall γk=1\gamma_k = 1), a contradiction. Hence no such j0j_0 exists, so νj=νkγj\nu_j = \nu_k \gamma_j for every jj, and summing gives 1=νkμk1 = \nu_k \mu_k, i.e. νk=1/μk\nu_k = 1/\mu_k, and then νj=γj/μk=πj\nu_j = \gamma_j/\mu_k = \pi_j for every jj. This proves ν=π\nu = \pi: the stationary distribution is unique. Combined with Step 3, this closes the argument for part (a), including the formula πi=1/μi\pi_i = 1/\mu_i at every state ii (apply the whole argument with reference state ii in place of kk; uniqueness forces the resulting normalized vector to coincide with π\pi, and its ii-th coordinate is 1/μi1/\mu_i by the Step 3 computation for reference state ii).

Step 5: Part (b) — existence of π\pi forces positive recurrence. Suppose the chain is irreducible and some stationary distribution ν\nu exists. First we rule out transience. If the chain were transient, then for every state jj, pij(n)→0p_{ij}^{(n)} \to 0 as n→∞n \to \infty for every fixed ii (transience implies the expected number of visits to jj starting from ii is finite, so the terms of that sum, namely pij(n)p_{ij}^{(n)}, must tend to 00). Since νj=∑iνipij(n)\nu_j = \sum_i \nu_i p_{ij}^{(n)} for all nn, and ∣νipij(n)∣≤νi|\nu_i p_{ij}^{(n)}| \le \nu_i summable, dominated convergence gives νj=lim⁡n∑iνipij(n)=∑iνi⋅0=0\nu_j = \lim_n \sum_i \nu_i p_{ij}^{(n)} = \sum_i \nu_i \cdot 0 = 0 for every jj. This contradicts ∑jνj=1\sum_j \nu_j = 1. Hence the chain cannot be transient; by the recurrence/transience dichotomy for irreducible chains, it is recurrent. Being recurrent, the construction of Steps 1–4 applies to produce the stationary measure γ\gamma (built from excursions from any reference state kk), and by the uniqueness argument of Step 4 (which used only recurrence, not positive recurrence, up through the derivation 1≥νkμk1 \ge \nu_k \mu_k) we conclude ν=γ/(∑jγj)\nu = \gamma/(\sum_j \gamma_j) provided ∑jγj=μk<∞\sum_j \gamma_j = \mu_k < \infty. Suppose instead μk=∞\mu_k = \infty (null recurrence). Then Step 4's chain of inequalities gives νk≤1/μk=0\nu_k \le 1/\mu_k = 0, so νk=0\nu_k = 0; since kk was an arbitrary state and irreducibility lets us relabel, an identical argument gives νi=0\nu_i = 0 for every i∈Si \in S, again contradicting ∑iνi=1\sum_i \nu_i = 1. Hence μk<∞\mu_k < \infty, i.e. the chain is positive recurrent, and then Step 4 identifies ν=π\nu = \pi with πi=1/μi\pi_i = 1/\mu_i. This proves (b).

Step 6: Part (c). If the irreducible chain is transient or null recurrent, Step 5's two contradictions (transient case, null recurrent case) show directly that no stationary distribution can exist: any candidate ν\nu is forced to be identically zero, contradicting ∑iνi=1\sum_i \nu_i = 1. ■\blacksquare

∎

Worked examples

Example 1: An asymmetric three-state weather chain. A chain on S={1,2,3}S=\{1,2,3\} (say, Sunny, Cloudy, Rainy) has transition matrix

P=(0.50.30.200.50.5100).P = \begin{pmatrix} 0.5 & 0.3 & 0.2 \\ 0 & 0.5 & 0.5 \\ 1 & 0 & 0 \end{pmatrix}.

Each row sums to 11 (check: 0.5+0.3+0.2=10.5+0.3+0.2=1; 0+0.5+0.5=10+0.5+0.5=1; 1+0+0=11+0+0=1), and the chain is irreducible: from 11 you can reach 2,32,3 directly and reach 11 again from either via state 33 or via 2→3→12\to3\to1; explicitly p13,p32p_{13}, p_{32} combine so all pairs communicate. Since the state space is finite and irreducible, the chain is automatically positive recurrent (a finite irreducible chain cannot be transient or null recurrent, because the mean return times are finite by a standard finiteness argument — expected hitting times on a finite state space are always finite for an irreducible chain). So Theorem: Existence and Uniqueness of the Stationary Distribution applies and π\pi exists uniquely. Solve πP=π\pi P = \pi with π=(π1,π2,π3)\pi = (\pi_1,\pi_2,\pi_3), π1+π2+π3=1\pi_1+\pi_2+\pi_3=1:

π1=0.5π1+π3,π2=0.3π1+0.5π2,π3=0.2π1+0.5π2.\pi_1 = 0.5\pi_1 + \pi_3, \qquad \pi_2 = 0.3\pi_1 + 0.5\pi_2, \qquad \pi_3 = 0.2\pi_1 + 0.5\pi_2.

From the first equation: 0.5π1=π3⇒π3=π120.5\pi_1 = \pi_3 \Rightarrow \pi_3 = \frac{\pi_1}{2}. From the second: 0.5π2=0.3π1⇒π2=0.6π10.5\pi_2 = 0.3\pi_1 \Rightarrow \pi_2 = 0.6\pi_1. Check consistency in the third: π3=0.2π1+0.5(0.6π1)=0.2π1+0.3π1=0.5π1\pi_3 = 0.2\pi_1 + 0.5(0.6\pi_1) = 0.2\pi_1+0.3\pi_1=0.5\pi_1, which matches π3=π1/2\pi_3=\pi_1/2 — consistent, as expected since the three balance equations are linearly dependent (they always sum to 0=00=0 for a stochastic matrix). Normalize: π1+0.6π1+0.5π1=2.1π1=1⇒π1=12.1=1021\pi_1 + 0.6\pi_1 + 0.5\pi_1 = 2.1\pi_1 = 1 \Rightarrow \pi_1 = \frac{1}{2.1} = \frac{10}{21}. Then

π1=1021,π2=0.6⋅1021=621=27,π3=0.5⋅1021=521.\pi_1 = \frac{10}{21}, \qquad \pi_2 = 0.6 \cdot \frac{10}{21} = \frac{6}{21} = \frac{2}{7}, \qquad \pi_3 = 0.5\cdot\frac{10}{21} = \frac{5}{21}.

Check: 1021+621+521=2121=1\frac{10}{21}+\frac{6}{21}+\frac{5}{21} = \frac{21}{21}=1. ✓. Check row-sum of πP\pi P directly against π\pi: π1′=0.5(10/21)+0(6/21)+1(5/21)=5/21+5/21=10/21=π1\pi_1' = 0.5(10/21)+0(6/21)+1(5/21) = 5/21+5/21=10/21=\pi_1 ✓; π2′=0.3(10/21)+0.5(6/21)+0=3/21+3/21=6/21=π2\pi_2' = 0.3(10/21)+0.5(6/21)+0 = 3/21+3/21=6/21=\pi_2 ✓; π3′=0.2(10/21)+0.5(6/21)+0=2/21+3/21=5/21=π3\pi_3'=0.2(10/21)+0.5(6/21)+0=2/21+3/21=5/21=\pi_3 ✓. By the theorem, mean return times are μ1=21/10=2.1\mu_1 = 21/10 = 2.1, μ2=21/6=3.5\mu_2 = 21/6 = 3.5, μ3=21/5=4.2\mu_3 = 21/5 = 4.2 days — the state visited least often (Rainy) has the longest expected wait to return to it, matching intuition since π3\pi_3 is smallest.

Example 2: A birth–death chain on {0,1,2,3}\{0,1,2,3\} with asymmetric, state-dependent rates. Consider a random walk on {0,1,2,3}\{0,1,2,3\} with reflecting-type boundary behavior and non-uniform step probabilities:

p01=1,p10=0.4, p12=0.6,p21=0.7, p23=0.3,p32=1.p_{01}=1,\quad p_{10}=0.4,\ p_{12}=0.6,\quad p_{21}=0.7,\ p_{23}=0.3,\quad p_{32}=1.

All other entries are zero. This is irreducible on the finite set {0,1,2,3}\{0,1,2,3\} (a path graph, every state reachable from every other by moving along the path), hence positive recurrent, hence π\pi exists uniquely. For birth–death chains the detailed balance equations πipi,i+1=πi+1pi+1,i\pi_i p_{i,i+1} = \pi_{i+1} p_{i+1,i} give a shortcut (this is a special stronger condition, sufficient but not necessary for stationarity in general chains, but always available and always correct for birth–death chains since one checks directly that a detailed-balance solution satisfies πP=π\pi P=\pi termwise). We are not required to derive detailed balance from the theorem — we verify the resulting π\pi directly against πP=π\pi P=\pi, so the argument remains fully rigorous without invoking unproven shortcuts. Set π0=c\pi_0 = c. Detailed balance across edge (0,1)(0,1): π0⋅1=π1⋅0.4⇒π1=π0/0.4=2.5 π0=2.5c\pi_0 \cdot 1 = \pi_1 \cdot 0.4 \Rightarrow \pi_1 = \pi_0/0.4 = 2.5\,\pi_0 = 2.5c. Across (1,2)(1,2): π1(0.6)=π2(0.7)⇒π2=0.60.7π1=67(2.5c)=157c\pi_1 (0.6) = \pi_2 (0.7) \Rightarrow \pi_2 = \frac{0.6}{0.7}\pi_1 = \frac{6}{7}(2.5c) = \frac{15}{7}c. Across (2,3)(2,3): π2(0.3)=π3(1)⇒π3=0.3π2=0.3⋅157c=4.57c=914c\pi_2(0.3) = \pi_3(1) \Rightarrow \pi_3 = 0.3\pi_2 = 0.3\cdot\frac{15}{7}c = \frac{4.5}{7}c = \frac{9}{14}c. Normalize: c(1+2.5+157+914)=1c\left(1 + 2.5 + \frac{15}{7} + \frac{9}{14}\right) = 1. Convert to fourteenths: 1=14/141 = 14/14, 2.5=35/142.5 = 35/14, 15/7=30/1415/7=30/14, 9/14=9/149/14=9/14. Sum =(14+35+30+9)/14=88/14=44/7= (14+35+30+9)/14 = 88/14 = 44/7. So c⋅447=1⇒c=744c\cdot \frac{44}{7} = 1 \Rightarrow c = \frac{7}{44}. Thus

π0=744,π1=2.5⋅744=17.544=3588,π2=157⋅744=1544,π3=914⋅744=988.\pi_0 = \frac{7}{44},\quad \pi_1 = 2.5\cdot\frac{7}{44} = \frac{17.5}{44}=\frac{35}{88},\quad \pi_2=\frac{15}{7}\cdot\frac{7}{44}=\frac{15}{44},\quad \pi_3 = \frac{9}{14}\cdot\frac{7}{44} = \frac{9}{88}.

Convert all to /88/88: π0=14/88\pi_0 = 14/88, π1=35/88\pi_1=35/88, π2=30/88\pi_2 = 30/88, π3=9/88\pi_3=9/88; sum =(14+35+30+9)/88=88/88=1=(14+35+30+9)/88=88/88=1 ✓. Direct check of stationarity at state 11: π1′=π0p01+π1p11+π2p21=1488(1)+0+3088(0.7)=1488+2188=3588=π1\pi_1' = \pi_0 p_{01} + \pi_1 p_{11} + \pi_2 p_{21} = \frac{14}{88}(1) + 0 + \frac{30}{88}(0.7) = \frac{14}{88}+\frac{21}{88}=\frac{35}{88}=\pi_1 ✓. Direct check at state 22: π2′=π1p12+π2p22+π3p32=3588(0.6)+0+988(1)=2188+988=3088=π2\pi_2' = \pi_1 p_{12} + \pi_2 p_{22} + \pi_3 p_{32} = \frac{35}{88}(0.6) + 0 + \frac{9}{88}(1) = \frac{21}{88}+\frac{9}{88}=\frac{30}{88}=\pi_2 ✓. Both checks confirm πP=π\pi P=\pi without relying solely on the detailed-balance shortcut.

CounterexampleIrreducibility (or recurrence) cannot be dropped: simple symmetric random walk on Z\mathbb{Z}

The theorem requires the chain to be irreducible and (for existence) positive recurrent. Drop positive recurrence — keep irreducibility — and existence fails outright, even though the chain still "looks" perfectly nice locally. Let S=ZS = \mathbb{Z} and let (Xn)(X_n) be simple symmetric random walk: pi,i+1=pi,i−1=12p_{i,i+1} = p_{i,i-1} = \tfrac12 for every i∈Zi \in \mathbb{Z}. This chain is irreducible: from any ii one can reach any jj in ∣i−j∣|i-j| steps with positive probability. It is recurrent — a classical fact (provable via Stirling's approximation on Pr⁡(X2n=0)∼1/πn\Pr(X_{2n}=0)\sim 1/\sqrt{\pi n}, whose sum over nn diverges, giving recurrence by the Borel–Cantelli-type criterion from Periodicity and Positive Recurrence) — but it is null recurrent: E0[T0]=∞\mathbb{E}_0[T_0] = \infty. Suppose, for contradiction, a stationary distribution π\pi existed. By translation symmetry of the walk (pijp_{ij} depends only on j−ij-i), if π\pi is stationary then so is any shift πi(k):=πi−k\pi^{(k)}_i := \pi_{i-k}, and moreover one checks the only candidate stationary measures (up to scalar) for this translation-invariant chain must themselves be translation-invariant, i.e. constant: πi=c\pi_i = c for all ii (this follows from the uniqueness-up-to-scalar of stationary measures for irreducible recurrent chains, the same uniqueness mechanism as Step 4 of the proof above, applied to measures rather than normalized probability vectors). But then ∑i∈Zπi=∑ic\sum_{i\in\mathbb{Z}} \pi_i = \sum_i c is either 00 (if c=0c=0) or +∞+\infty (if c>0c>0) — it can never equal 11. Hence no probability distribution stationary for this chain exists. This matches part (c) of the theorem exactly: the chain is irreducible but not positive recurrent (it is null recurrent), so no stationary distribution exists, even though a stationary measure (the constant measure, unnormalizable) does exist. The moral: irreducibility guarantees uniqueness of a stationary measure up to scaling, but only positive recurrence guarantees that measure is summable to a finite total mass, which is what normalization to a probability distribution requires.

Scope, edge cases & common traps

SituationWhat happensWhy
Finite, irreducible chainπ\pi always exists, unique, all πi>0\pi_i>0finite + irreducible ⇒\Rightarrow automatically positive recurrent
Infinite, irreducible, positive recurrentπ\pi exists, unique, πi=1/μi>0\pi_i = 1/\mu_i>0full theorem above
Infinite, irreducible, null recurrentNo stationary distribution (only a non-normalizable stationary measure)mean return times infinite; see counterexample
Irreducible, transientNo stationary distributionpij(n)→0p_{ij}^{(n)}\to0 forces any candidate ν≡0\nu\equiv0
Reducible (multiple communicating classes)Stationary distributions form a whole simplex (convex combinations of per-class stationary vectors), or none, depending on classesuniqueness genuinely fails; theorem's hypothesis is essential
Periodic but positive recurrent, irreducibleπ\pi still exists and is uniqueperiodicity affects convergence Pijn→πjP^n_{ij}\to\pi_j, not existence/uniqueness of π\pi itself

The mathematician behind it

Origins · 1 minAndrei Andreyevich Markov and how this was discovered
AA
Andrei Andreyevich Markov
1856–1922 · Imperial Academy of Sciences, St. Petersburg

Markov introduced chains of dependent random variables around 1906, originally to extend the law of large numbers beyond independent trials — motivated in part by a dispute with Pavel Nekrasov over whether independence was necessary for statistical regularity. He first studied the vowel–consonant sequence of Pushkin's Eugene Onegin as an empirical example of a two-state dependent process, showing long-run frequencies stabilize even without independence. The general theory of invariant distributions for countable-state chains, including the existence/uniqueness dichotomy tied to recurrence type, was developed rigorously in the following decades by Kolmogorov, Doeblin, and Chung, building directly on Markov's chain concept.

History
- 1906 — Markov defines chains of dependent trials and studies convergence of long-run frequencies.
- 1913 — Markov applies his chain model to letter sequences in Eugene Onegin, an early empirical stationary-distribution calculation.
- 1930s — Kolmogorov and Doeblin formalize recurrence/transience and develop renewal-theoretic tools underlying the existence proof.
- 1953 — Doob's treatise systematizes the recurrence classification (transient/null/positive) and its link to invariant measures.
- 1998 — Google's PageRank reinterprets stationary distributions of a web-link random walk as a ranking algorithm, popularizing the concept far beyond probability theory.
Does every Markov chain have a stationary distribution?

No. Existence requires structural conditions. If the chain is reducible (has multiple communicating classes), stationary distributions may fail to be unique, or may only be supported on certain recurrent classes. If the chain is irreducible but transient or null recurrent — as with simple symmetric random walk on Z\mathbb Z — no stationary probability distribution exists at all, only an unnormalizable stationary measure. The theorem in this article gives the precise dividing line: irreducible chains have a (unique) stationary distribution if and only if they are positive recurrent, i.e. mean return times to states are finite.

Is πP=π\pi P = \pi the same as saying π\pi is a left eigenvector of PP with eigenvalue 1?

Yes, exactly — with the extra normalization and nonnegativity constraints that make π\pi a probability distribution rather than an arbitrary eigenvector (which is only defined up to scalar multiples, and complex eigenvectors are excluded). Every stochastic matrix has 11 as an eigenvalue (since P1=1P\mathbf 1 = \mathbf 1 makes 11 a right eigenvalue, hence also a left eigenvalue by matching characteristic polynomials), so the existence of some left eigenvector for eigenvalue 11 is automatic in finite dimensions; the content of the theorem is that, for irreducible positive recurrent chains, this eigenvector can be chosen nonnegative and is then unique up to scaling.

Does stationarity mean the chain stops changing?

No — individual sample paths X0,X1,X2,…X_0, X_1, X_2, \dots keep moving between states randomly forever; stationarity is a statement purely about the distribution (the law) of XnX_n, not about individual trajectories freezing. If X0∼πX_0 \sim \pi, then Xn∼πX_n \sim \pi for every nn, meaning the marginal probabilities Pr⁡(Xn=j)\Pr(X_n = j) do not change with nn, even though XnX_n itself is still a genuinely random, moving quantity.

Why does aperiodicity not appear anywhere in the existence/uniqueness proof?

Because the renewal argument used in the proof — counting expected visits to each state during one excursion between visits to a fixed reference state — never invokes any limiting behavior of PnP^n; it works directly with expectations under the chain's law, which are well-defined regardless of period. Periodicity only becomes relevant when asking whether PijnP^n_{ij} itself converges to πj\pi_j as n→∞n \to \infty — that is a separate, stronger statement (related to the Ergodic Theorem for Markov Chains) requiring aperiodicity to rule out permanent oscillation, such as a chain alternating deterministically between two states.

How is the stationary distribution computed in practice for a large finite chain?

For small finite chains, solve the linear system πP=π\pi P = \pi, ∑iπi=1\sum_i \pi_i = 1 directly (as in the worked examples), noting the balance equations are linearly dependent so one equation is always redundant and is replaced by the normalization condition. For very large chains (e.g. billions of states, as in PageRank), direct linear algebra is infeasible, so one instead exploits the Ergodic Theorem for Markov Chains-type convergence and iterates π(n+1)=π(n)P\pi^{(n+1)} = \pi^{(n)} P from an arbitrary starting vector (power iteration), which converges to π\pi whenever the chain is irreducible, positive recurrent, and aperiodic.

What is the relationship between a stationary distribution and reversibility / detailed balance?

Detailed balance, πipij=πjpji\pi_i p_{ij} = \pi_j p_{ji} for all i,ji,j, is a sufficient but not necessary condition for π\pi to be stationary: summing the detailed balance equation over ii immediately gives ∑iπipij=πj∑ipji=πj\sum_i \pi_i p_{ij} = \pi_j \sum_i p_{ji} = \pi_j, which is exactly πP=π\pi P=\pi. Not every stationary chain satisfies detailed balance — Example 1 in this article (the weather chain) is stationary but not reversible, since e.g. π1p13=1021(0.2)≠π3p31=521(1)\pi_1 p_{13} = \frac{10}{21}(0.2) \ne \pi_3 p_{31} = \frac{5}{21}(1) in general. Detailed balance is a convenient shortcut, always valid for birth–death chains, but stationarity itself is the more general and fundamental property.

Can a chain have infinitely many stationary distributions?

Yes, but only if it fails irreducibility. If a chain has two or more distinct closed communicating classes, each positive recurrent class has its own stationary distribution supported on that class, and any convex combination of these is also stationary for the whole chain — giving a whole simplex, hence infinitely many, of stationary distributions. Irreducibility is precisely the hypothesis that rules this out and forces uniqueness, as shown in the theorem's proof.

Before this

Where this leads