Definition · Reachability, communication and classesState j is reachable from i, written i → j, when Pⁿ[i][j] > 0 for some n ≥ 0. States i and j communicate, written i ↔ j, when i → j and j → i.
↔ is an equivalence relation, and its classes are the communicating classes. A class C is closed, or recurrent, when no arc leads from a state of C to a state outside it, and transient otherwise. The chain is irreducible when there is exactly one class.
Reachability is computed as the transitive closure of the arc relation, so the table the lab prints is closed under composition rather than a list of single steps. A cell shows ↔ when the two states reach each other, → when only one direction works, and a dot when neither does; the ↔ cells are precisely the pairs sharing a class.
Why “no arc leaves” is the right test
Suppose one arc leads out of C and does not lead back. Each visit to its tail takes it with some fixed positive probability, so over infinitely many visits the chance of never taking it is zero. The chain therefore leaves C with probability one and, since it cannot come back, visits C finitely often: that is what transient means. If instead no arc leaves, the chain that enters C can never be anywhere else, and every state of C is visited again and again.
Nothing in that argument used a magnitude. It used only that the arc exists and that the probability of never taking a fixed positive chance infinitely often is zero. This is the single most common place to reason about the wrong thing: a reader looking at 0.001 out of a class and 0.999 inside it sees a class the chain is basically never going to leave, and the correct answer is that it leaves, every time, eventually.
Example · One state that can leave and never returnThe three-state example 1/2 1/4 1/4; 0 3/4 1/4; 0 1/2 1/2 has classes {trial} and {kept, lapsed}. The first column is zero below the diagonal, so nothing returns to trial; the lab reports it transient and colours it red, and reports {kept, lapsed} recurrent because no arc leaves it.
The chain is therefore reducible, so the convergence theorem does not apply to it. It still has a unique stationary distribution — (0, 2/3, 1/3), which mode steady computes — and the zero is not a rounding: the chain spends finitely much of its time at trial, so the long-run fraction is exactly nothing.
The period, and the gcd that computes it
Definition · PeriodThe period of state i is d(i) = gcd{n ≥ 1 : Pⁿ[i][i] > 0}, the greatest common divisor of the lengths of the closed walks from i back to itself. States in the same class have the same period, so it is a property of the class. A class with d = 1 is aperiodic.
A self-loop forces d = 1 immediately, since 1 divides everything. A three-state ring with no other arcs has closed walks of lengths 3, 6, 9, … and therefore period 3: the chain returns to where it started only at multiples of three, for ever, and no amount of waiting changes that.
The lab does not enumerate closed walks. It levels the class by breadth-first search from one of its states and takes the gcd of level(u) + 1 − level(v) over every arc u → v inside the class. Each closed walk's length is the sum of those quantities along it, so every walk length is a multiple of that gcd; and each arc lies on some closed walk, so the gcd of the walk lengths divides it. The two divide each other and are therefore equal, and one traversal has replaced an enumeration.
the 3-cycle 0 1 0 classes {1, 2, 3}, one class
0 0 1 irreducible yes
1 0 0 period 3 aperiodic no
levels from state 1 by breadth-first search: 1 → 0, 2 → 1, 3 → 2
arcs and level(u) + 1 − level(v):
1 → 2 0 + 1 − 1 = 0
2 → 3 1 + 1 − 2 = 0
3 → 1 2 + 1 − 0 = 3
gcd(0, 0, 3) = 3 and no cycle was ever written down
the three-brand chain, every entry positive:
classes 1 irreducible yes period 1 aperiodic yes
The two hypotheses, and the theorem this path does not prove
Theorem · Convergence of the powers, stated and not provedIf a finite chain is irreducible and aperiodic then Pⁿ[i][j] → πⱼ as n → ∞ for every i and j, where π is the unique solution of πP = π with Σπ = 1.
This is one of the three results the footer of this subject names as stated and not proved. What is proved here is nothing; what is computed here is both hypotheses, on whatever matrix you type, and the conclusion's π is obtained by solving a linear system in the material that follows — not as a limit.
A stated theorem whose hypotheses you can check is a different object from a stated theorem taken on trust. Both conditions are needed, and each fails on its own preset here. The three-cycle is irreducible and periodic: the powers return to the identity every third step and converge to nothing, while the linear system still has exactly one answer. The two-closed-group example is aperiodic and reducible: the powers do converge, and not to a single π, because there is no single π for them to converge to.
Example · Two closed groups, and a chain with no unique steady stateThe four-state example 1/2 1/2 0 0; 1/2 1/2 0 0; 0 0 1/3 2/3; 0 0 1/4 3/4 has two classes, {a, b} and {c, d}, and both are recurrent: no arc leaves either.
So the chain is reducible with two recurrent classes, and the balance equations have a whole family of solutions rather than one. The lab reports two recurrent classes here and says that mode steady on the same matrix refuses to print one of them as though it were the answer.