Risk Modelling and Survival Analysis · Markov chains
Classification of States and Stationary Distributions in Markov Chains
Updated 11 October 2026 · Fact-checked
Classifying states means grouping them into communicating classes, then deciding whether each class is recurrent or transient and finding its period. A stationary distribution π is a probability vector that satisfies π = πP. Solve the equations together with Σπ = 1. Convergence to π needs an irreducible, aperiodic chain.
Understand Classification of States and Stationary Distributions
A Markov chain moves between states. The next state depends only on the current state. Classification asks how the states are connected. Once you know that, you know how the chain behaves in the long run.
State j is accessible from state i if the chain can reach j from i in some number of steps with positive probability. If i and j are accessible from each other, they communicate. Communication splits the states into communicating classes. A chain with only one class is irreducible. A class is closed if the chain cannot leave it. A closed class with one state is an absorbing state.
State i is recurrent if, starting from i, the chain returns to i with probability 1. It is transient if that probability is less than 1. Recurrence is a class property. All states in a class are either all recurrent or all transient. In a finite chain, a closed class is recurrent and a class that is not closed is transient. Every finite chain has at least one recurrent class.
The period of state i is the greatest common divisor of all n ≥ 1 with p_ii(n) > 0. If the period is 1, the state is aperiodic. Period is also a class property. A self-loop (p_ii > 0) makes a state aperiodic.
A stationary distribution π is a probability vector with π = πP. If the chain starts with distribution π, it has distribution π at every later time. A limiting distribution is what p_ij(n) tends to as n grows. For a finite, irreducible chain, the stationary distribution exists and is unique. If the chain is also aperiodic, p_ij(n) → π_j for every i. A periodic chain still has a stationary distribution but no limit. A reducible chain may have several stationary distributions, or the limit may depend on the starting state.
Key rules to remember
- Stationary distribution equations
- π = πP, that is π_j = Σ_i π_i p_ij, with Σ_j π_j = 1 and π_j ≥ 0
- One balance equation is redundant, so drop one and use Σπ = 1 instead.
- Period of a state
- d(i) = gcd{ n ≥ 1 : p_ii(n) > 0 }
- If d(i) = 1 the state is aperiodic. Any state with p_ii > 0 is aperiodic.
- Communication
- i ↔ j if i → j and j → i
- Communicating classes partition the state space.
- Recurrence and transience
- Recurrent: P(return to i | start at i) = 1. Transient: P(return) < 1
- In a finite chain, closed class means recurrent. A class that is not closed is transient.
- Mean recurrence time
- m_i = 1 ÷ π_i
- Applies to an irreducible chain with a stationary distribution. It is the expected number of steps to return to i. A recurrent state is positive recurrent if this expected return time is finite. In a finite chain every recurrent state is positive recurrent.
- Convergence condition
- Finite, irreducible and aperiodic ⇒ p_ij(n) → π_j for all i, j
- Without aperiodicity the limit may not exist.
- Detailed balance (check for reversibility)
- π_i p_ij = π_j p_ji for all i, j
- If this holds with Σπ = 1, then π is stationary. Detailed balance is sufficient but not necessary for π to be stationary; a stationary distribution need not satisfy detailed balance.
How to solve Classification of States and Stationary Distributions questions
Use this order for any question on classifying states or finding long-run behaviour. Draw the transition diagram first, because most marks for classification come from reading it correctly.
- 1Write the transition matrix and draw the diagram. Show only arrows where p_ij > 0.
- 2Find the communicating classes. Check for each class whether any arrow leaves it. If none does, the class is closed.
- 3Label each class. In a finite chain, a closed class is recurrent and a non-closed class is transient. State whether the chain is irreducible.
- 4Find the period of each class. Look for a self-loop, or list the return lengths and take their gcd.
- 5For a stationary distribution, write π_j = Σ π_i p_ij for each state. Drop one equation, solve in terms of one unknown, then use Σπ = 1 to normalise.
- 6Check your answer by substituting it into one equation you did not use, and check that the probabilities sum to 1.
- 7State the long-run result. If the chain is finite, irreducible and aperiodic, p_ij(n) → π_j. If it is periodic or reducible, say why there is no single limit.
- 8Answer any follow-up, such as the mean return time 1 ÷ π_i or the long-run proportion of time in a state.
Quickest way: Fast route to π for a small chain
When to use it: Use this for 2-state or 3-state irreducible chains in the written paper or in multiple-choice questions.
- Look for zeros in the matrix. If the chain only moves up or down one state, it is a birth-death chain, so try detailed balance: π_i p_ij = π_j p_ji.
- Otherwise set one π equal to a variable x, for example π_1 = x. Use the balance equations to express the others in terms of x.
- Add them up, set the sum to 1, and solve for x.
- For 2 states with p_12 = a and p_21 = b, use π = (b ÷ (a + b), a ÷ (a + b)).
- In multiple-choice questions, test the options. Check that the entries sum to 1 and that πP = π for one coordinate.
Common mistakes in Classification of States and Stationary Distributions
Calling a class recurrent just because it is a class, or calling every state in a reducible chain recurrent.
Students forget to check whether the class is closed.
Fix: Look for any arrow leaving the class. If there is one, the class is transient in a finite chain.
Claiming a chain is aperiodic because it is irreducible.
The two properties are mixed up.
Fix: Check the period separately. A chain that alternates between two groups of states has period 2, even though it is irreducible.
Saying a stationary distribution exists, so p_ij(n) must converge to it.
Stationary and limiting distributions are treated as the same thing.
Fix: Convergence needs aperiodicity as well as irreducibility. A periodic chain has π but its n-step probabilities keep cycling.
Solving π = πP using columns instead of rows, or using Pπ.
The vector is treated as a column.
Fix: Treat π as a row vector. The equation for π_j uses column j of P: π_j = Σ_i π_i p_ij.
Forgetting to normalise, so the answer does not sum to 1.
The balance equations only give ratios.
Fix: Always finish with Σπ = 1 and check the sum.
Finding the period from p_ii(1) alone, or taking the smallest return time instead of the gcd.
Students stop at the first return length.
Fix: List several return lengths, for example 2, 4, 6, and take the gcd of all of them.
Worked examples
Example 1
A Markov chain on states 1, 2, 3 has transition matrix with rows: state 1: (0.5, 0.5, 0); state 2: (0.25, 0.5, 0.25); state 3: (0, 0.5, 0.5). (a) Classify the chain. (b) Find the stationary distribution. (c) Find the mean recurrence time of state 2.
Show the solution
- (a) From 1 you can go to 2, from 2 to 3, from 3 to 2 and from 2 to 1. All states communicate, so the chain is irreducible with one class, which is closed and finite, hence recurrent.
- Every state has p_ii > 0, so each state has period 1. The chain is aperiodic.
- (b) Balance equation for state 1: π_1 = 0.5π_1 + 0.25π_2, so 0.5π_1 = 0.25π_2 and π_2 = 2π_1.
- Balance equation for state 3: π_3 = 0.25π_2 + 0.5π_3, so 0.5π_3 = 0.25π_2 and π_3 = 0.5π_2 = π_1.
- Normalise: π_1 + 2π_1 + π_1 = 4π_1 = 1, so π_1 = 0.25, π_2 = 0.5, π_3 = 0.25.
- Check with state 2: 0.5(0.25) + 0.5(0.5) + 0.5(0.25) = 0.125 + 0.25 + 0.125 = 0.5 = π_2. This holds.
- (c) Mean recurrence time of state 2 = 1 ÷ π_2 = 1 ÷ 0.5 = 2.
Answer: The chain is irreducible, recurrent and aperiodic. π = (0.25, 0.5, 0.25). The mean recurrence time of state 2 is 2 steps. Because the chain is aperiodic, p_ij(n) tends to π_j for all i and j.
Example 2
A chain on states A, B, C, D has these transitions: A to A with 0.5 and to B with 0.5; B to A with 0.5 and to C with 0.5; C to D with probability 1; D to C with probability 1. (a) Find the communicating classes and classify each as recurrent or transient, with its period. (b) Find the stationary distribution. (c) Does p_CC(n) converge?
Show the solution
- (a) A and B communicate, since A goes to B and B goes to A. So {A, B} is a class. C and D communicate, so {C, D} is a class.
- B can move to C, but C and D can never return to A or B. So {A, B} is not closed and is transient. {C, D} is closed and finite, so it is recurrent.
- Period of {A, B}: A has a self-loop, p_AA > 0, so the period is 1.
- Period of {C, D}: a return to C takes 2, 4, 6, ... steps, so the gcd is 2. The class has period 2.
- (b) There is exactly one closed class, {C, D}, so the stationary distribution is unique. The states A and B are transient, so π_A = π_B = 0. On {C, D}: π_C = π_D, and π_C + π_D = 1, so π_C = π_D = 0.5.
- So π = (0, 0, 0.5, 0.5). Check with state C: π_C = 0.5π_B + 1 × π_D = 0.5 × 0 + 0.5 = 0.5. B moves to C with probability 0.5, but π_B = 0, so that term adds nothing. This holds.
- (c) Starting from C, p_CC(n) = 1 for even n and 0 for odd n. It alternates and does not converge.
Answer: {A, B} is transient with period 1. {C, D} is recurrent with period 2. The stationary distribution is unique, because there is only one closed class: π = (0, 0, 0.5, 0.5). p_CC(n) does not converge because the class has period 2.
Exam tips
- Draw the diagram before you answer. Examiners award marks for stating the classes and whether each is closed, so write both.
- Use the exact words: irreducible, aperiodic, positive recurrent. Give a reason for each, such as a self-loop for aperiodicity.
- When asked whether a limit exists, check irreducibility and aperiodicity, and say which condition fails if it does not hold.
- For a reducible chain, say whether the stationary distribution is unique. It is unique if there is exactly one closed recurrent class, and it fails to be unique only if there is more than one. So count the closed classes.
- In Paper B, a stationary distribution can be found in R by solving the linear system with Σπ = 1. Show the equations and check that πP gives π back.
Practice questions from Markov chains
- A Markov chain on {1,2,3} has P(1→2)=1, P(2→3)=1 and P(3→1)=1. Which statement is correct?
- A two-state chain on {1, 2} has P(1→2)=0.2 and P(2→1)=0.6. What is the stationary probability of state 1?
- A motor insurer uses a No Claims Discount system modelled as a Markov chain with states 0%, 25% and 50% discount. A policyholder with no cla…
- Which statement about the Chapman-Kolmogorov equations for a time-homogeneous discrete-time Markov chain is correct?
- A simple random walk on the integers starts at 0 with X_n = X_{n-1} + Z_n, where Z_n = +1 with probability 0.5 and -1 with probability 0.5, …
Classification of States and Stationary Distributions: frequently asked questions
How do I find the stationary distribution of a Markov chain?
Write π = πP as one equation per state, drop one redundant equation, and solve in terms of one unknown. Then use Σπ = 1 to fix the value. Check the answer in an equation you did not use.
What is the difference between recurrent and transient states?
A recurrent state is one the chain returns to with probability 1. A transient state has a positive probability of never returning. In a finite chain, closed classes are recurrent and classes the chain can leave are transient.
Is a stationary distribution the same as a limiting distribution?
No. A stationary distribution satisfies π = πP. A limiting distribution is the limit of p_ij(n). A periodic chain can have a stationary distribution without a limit. For a finite irreducible aperiodic chain, the two are the same.
How do I check periodicity?
List the numbers of steps in which you can return to a state and take their gcd. A self-loop gives period 1 straight away. Period is the same for every state in a communicating class.
Can a Markov chain have more than one stationary distribution?
Yes, if it is reducible with more than one closed recurrent class. Each closed class has its own stationary distribution, and any convex combination (weighted average) of them is also stationary. A finite chain with exactly one closed class, and an irreducible finite chain, has a unique stationary distribution.