Markov Chains: Long-Run Behaviour
This session follows a Markov chain over many steps. Where does the chain end up, how long does it take to get there, and what fraction of time does it spend in each state? Conditioning on the first step turns these questions into systems of linear equations.
Classification of states decides which long-run questions make sense. In a chain with absorbing states, we calculate absorption probabilities and expected absorption times by recursion with the law of total probability. In an irreducible and aperiodic chain, the stationary distribution is also the limiting distribution, gives the long-run proportion of time spent in each state, and determines the mean return times. Simulation checks every analytical result.
Key Concepts¶
- Communicating classes, closed classes, and absorbing states
- Transience, recurrence, periodicity, and irreducibility
- Recursion with the law of total probability
- Absorption probabilities, expected absorption times, and mean return times
- Stationary versus limiting distributions
- Long-run proportions of time and their simulation
Learning Objectives
- Classify the states of a Markov chain and identify closed classes.
- Use first-step analysis to find absorption probabilities, expected absorption times, and mean return times.
- Calculate a stationary distribution and decide when it is also a limiting distribution.
- Interpret stationary probabilities as long-run proportions and verify them by simulation.
Session Preparation:¶
Attempt the exercises from Session 8.
Syllabus and input
- Classification of states
- The law of total probability and recursion
- Stationary and limiting distributions
Session material
Exercises¶
Exercise 1 — Classification of states¶
Consider
- Draw the transition diagram.
- Identify the communicating classes.
- Classify states as transient or recurrent.
- Identify all closed classes and stationary distributions.
Answer
State 1 is an absorbing closed class. States 3 and 4 form another closed irreducible class. State 2 is transient because it can leave for either closed class and cannot be revisited from them. The stationary distributions are \((1,0,0,0)\), \((0,0,0.2,0.8)\), and every mixture \(\alpha(1,0,0,0)+(1-\alpha)(0,0,0.2,0.8)\) with \(0\le\alpha\le1\). Because there are two closed classes, \(\pi\) is not unique.
Exercise 2 — Absorption in recurrent classes¶
Consider the Markov chain in the figure below. There are two recurrent classes, \(R_1=\{1,2\}\), and \(R_2=\{5,6,7\}\).

- Assuming \(X_0=3\), find the probability that the chain gets absorbed in \(R_1\).
- Find the expected time (number of steps) until the chain gets absorbed in \(R_1\) or \(R_2\). More specifically, let \(T\) be the absorption time, i.e., the first time the chain visits a state in \(R_1\) or \(R_2\), so find \(E\left[T \mid X_0=3\right]\)
Answer
- \(a_3=\frac{5}{7}\)
- \(t_3=\frac{12}{7}\)
Exercise 3 — An absorbing release process¶
A software change moves among Review, Testing, Released, and Rejected with transition matrix
- Identify transient and absorbing states.
- Starting in Review, find the probability of eventual release.
- Find the expected number of steps until absorption.
- Verify both results by simulation.
Answer
- Review and Testing are transient; Released and Rejected are absorbing.
- \(a_{\text{Review}}=\frac{24}{37}\approx0.649\)
- \(t_{\text{Review}}=\frac{130}{37}\approx3.51\) steps
Exercise 4 — Mean return time¶
Consider the following Markov chain

Assume \(X_0=1\), and let \(R\) be the first time that the chain returns to state 1 . Find \(E\left[R \mid X_0=1\right]\).
Answer
\(\frac{8}{3}\)
Exercise 5 — Stationary and limiting distributions¶
Consider the following Markov chain

- Is this chain irreducible?
- Is this chain aperiodic?
- Find the stationary distribution for this chain.
- Is the stationary distribution a limiting distribution for the chain?
Answer
- yes
- yes
- \(\pi_1 \approx 0.457, \pi_2 \approx 0.257, \pi_3 \approx 0.286\)
- yes
Exercise 6 — The reliability chain in the long run¶
Use the Working/Failed chain from Session 8, Exercise 3.
- Find the stationary distribution.
- Interpret the stationary failure probability operationally.
- Find the mean return time to Failed and interpret it.
Answer
The stationary distribution satisfies \(0.02\pi_W=0.30\pi_F\), giving \((\pi_W,\pi_F)=(15/16,1/16)\). In the long run the component is failed one hour in 16, and the mean return time to Failed is \(1/\pi_F=16\) hours.
Exercise 7 — Web-service states¶
A service is in state Normal, Degraded, or Down. Construct a plausible transition matrix satisfying the following one-step statements: a normal service remains normal with probability 0.92; a degraded service goes down with probability 0.10; and a down service recovers to degraded with probability 0.60. Choose and justify the remaining probabilities.
- Draw the transition diagram.
- Calculate the distribution after 5 steps from Normal.
- Starting from Down, find the expected number of steps until the service is Normal again, using first-step analysis.
- Simulate 10,000 steps and compare empirical state frequencies with the stationary distribution.
Answer
Part 3 with the reference matrix \(P=\begin{pmatrix}0.92&0.08&0\\0.50&0.40&0.10\\0&0.60&0.40\end{pmatrix}\) (order Normal, Degraded, Down), where failures and recoveries pass through Degraded: \(m_D=1+0.4m_D+0.1m_X\) and \(m_X=1+0.6m_D+0.4m_X\), so \(m_D=\frac{7}{3}\) and \(m_X=4\) steps.
Exercise 8 — Long-run service availability¶
Use the transition matrix constructed in Exercise 7.
- Determine whether the chain is irreducible and aperiodic.
- Find its stationary distribution.
- Interpret the long-run proportions of time in Normal, Degraded, and Down.
- Change one transition probability to represent an improved repair process and quantify the effect on long-run availability.