The future depends only on the present — never on the whole past. Write the transitions as a matrix P, one row per state, each row a probability distribution. Push any starting distribution through it again and again and it forgets where it began, settling onto a single fixed vector π with πP = π. Down the center: a matrix goes in, power iteration runs, the stationary distribution comes out. The blue team builds and defends it; the red team tries to break it.
source A. A. Markov, Extension of the law of large numbers to quantities depending on each other (Izv. Fiz.-Mat. Obshch. Kazan, 2nd ser., 15, 1906). AMBER: an archive.org search returned no verified standalone scan of the 1906 Kazan bulletin; an English translation is reprinted in the appendix of Meyn & Tweedie / Seneta's tricentenary history. Rendered, not quoted.
A distribution π is a row vector; one step of the chain is a matrix multiply on the right: π′ = πP, so π′ⱼ = Σᵢ πᵢ Pᵢⱼ. Because every row of P sums to 1, total mass is conserved — π stays a distribution forever.
Iterate. For an irreducible, aperiodic (ergodic) chain the sequence π, πP, πP², … converges to the unique stationary vector where πP = π — the leading left eigenvector, eigenvalue 1. The rate is set by the second-largest eigenvalue |λ₂|; error shrinks like |λ₂|ᵏ.
Live for the current matrix — the fixed-point residual ‖πP − π‖₁:
Independence was probability's silent assumption. Markov's 1906 move — keep the law of large numbers but let each trial lean on the one before — is the premise every later sphere consumes:
PageRank is π for the web's link matrix — the stationary distribution of a random surfer. MCMC runs the arrow backwards: design P so its π is the distribution you want to sample, then walk. The n-gram language model is a Markov chain over tokens — P(next | current). Each sphere is the next one's premise.
The blue team's live check: recompute π for the current matrix and confirm the two invariants — every built row sums to 1, and the fixed point holds (‖πP − π‖₁ < 1e-6). If red skips normalization, this is where it shows.
A chain over 3 states is a square grid of non-negative weights. Entry row i, col j is the tendency to go from state i to state j. Each row is normalized to sum to 1 — that is what turns raw counts into a probability distribution and makes P a stochastic matrix.
Edit any cell (raw weights, e.g. observed counts); pick the number of states. Zeros are fine; a zero row is treated as uniform. This grid is exactly what feeds the panel below.
Normalized P (each row a distribution):
Power iteration from the uniform start — watch the row vector settle onto π.
Stationary distribution π (computed, not stored):
Change any weight — π is recomputed by iterating πP on the spot, never looked up.
What the machine produces, proven: the long-run fraction of time the chain spends in each state, independent of where it started. It satisfies πP = π and Σπ = 1 — both checked live below. For a 2-state chain P = [[1−a, a],[b, 1−b]] the closed form is π = [b/(a+b), a/(a+b)], which the engine reproduces to 1e-6.
The blue team's witness (left) confirms these invariants live; the red team (right) tries to make them false.
Build a periodic chain in the panel and the witness honestly refuses to certify convergence — it goes red, because there is no fixed point to reach. "Stationary distribution" is a promise that holds only for ergodic chains; the engine does not pretend otherwise.
"Every Markov chain has a unique stationary distribution." Cut. Only irreducible + aperiodic chains do. Reducible → many; periodic → power iteration oscillates and never lands.
"Markov invented chains to model language (Eugene Onegin)." Cut. The 1906 paper is about the law of large numbers for dependent variables; the vowel/consonant count of Pushkin's Onegin came 1913 — an application, not the origin.
"π is just the starting distribution run forward." Kept, corrected. π is the fixed point: the one input that comes back unchanged. Every other start converges toward it.
The red team's move: skip the row-normalization. Rows keep their raw weights, no longer sum to 1, P stops being stochastic — mass is no longer conserved, so πP grows without bound and π stops summing to 1. The blue team's witness (window 7) is watching.
Skip normalization and the iterates blow up — Σπ leaves 1, the witness recomputes, disagrees, and turns red. Nothing is faked; the attack is real and it is caught.