Markov Chains
Memoryless processes on discrete state spaces: transition matrices, the Chapman-Kolmogorov equations, classification of states, and convergence to a stationary distribution.
Leads to: The Markov property generalizes to Brownian motion (8.3) and diffusion pricing models.
Learning Objectives
Click a status chip to cycle: Not started → In progress → Studied → Practiced → Needs review → Mastered.
- State the Markov property and encode a chain by its transition matrix.
- Compute multi-step transition probabilities via Chapman-Kolmogorov.
- Classify states as recurrent/transient and periodic/aperiodic.
- Solve for a stationary distribution and state when the chain converges to it.
Key Vocabulary
- Markov property
- \(\Prob(X_{n+1}=j\mid X_n=i,\text{past})=\Prob(X_{n+1}=j\mid X_n=i)\): the future depends on the past only through the present.
- Transition matrix
- \(P=(p_{ij})\) with \(p_{ij}=\Prob(X_{n+1}=j\mid X_n=i)\); rows are probability vectors (stochastic matrix).
- Chapman-Kolmogorov
- \(P^{(m+n)}=P^{(m)}P^{(n)}\); \(n\)-step probabilities are matrix powers \(P^n\).
- Stationary distribution
- A row vector \(\pi\ge0\), \(\sum\pi_i=1\), with \(\pi P=\pi\); invariant under one step.
- Recurrent / transient
- A state is recurrent if the chain returns to it with probability 1, else transient.
- Irreducible / aperiodic
- Irreducible: every state reaches every other; aperiodic: gcd of return times is 1.
Intuition & Motivation
Chains, matrices, and Chapman-Kolmogorov
If \(\mu_0\) is the initial distribution (a row vector), then the distribution at time \(n\) is \(\mu_n=\mu_0 P^n\). Markov modeling reduces prediction to matrix multiplication.
Classification and long-run behaviour
States are recurrent (return probability 1) or transient (positive escape probability). A chain is irreducible if all states communicate, and aperiodic if the gcd of possible return times is 1. These properties determine convergence.
A useful shortcut: if \(\pi\) satisfies detailed balance \(\pi_i p_{ij}=\pi_j p_{ji}\) (reversibility), it is automatically stationary. This is the basis of MCMC samplers.
Interactive: simulate a chain and recover its stationary distribution
- Confusing the stationary equation \(\pi P=\pi\) (left eigenvector) with \(P\pi=\pi\); \(\pi\) multiplies \(P\) on the left as a row vector.
- Expecting convergence for a periodic chain - a chain that alternates deterministically has a stationary \(\pi\) but \(P^n\) does not converge.
- Assuming every stationary distribution is unique; uniqueness needs irreducibility.
- Reading rows and columns of \(P\) backwards - row \(i\) holds the out-probabilities from state \(i\).
- To find \(\pi\), solve \(\pi(P-I)=0\) with \(\sum\pi_i=1\), or take the left eigenvector of \(P\) for eigenvalue 1.
- Detailed balance is the fastest stationarity check and the design principle behind Metropolis-Hastings.
- The second-largest eigenvalue modulus controls the mixing rate: closer to 1 means slower convergence.
Practice this in the Euler Lab
Computational problems that exercise exactly this technique. Each opens in the Euler Lab with a Python workbench, a progressive hint ladder, and answer checking. Tier A/B run at full scale in the browser.
Warm-up:
#84 Monopoly Odds (12%, tier B)
Applied:
#315 Digital Root Clocks (18%, tier B) #978 Random Walk Skewness (25%, tier B) #280 Ant and Seeds (40%, tier C)
Challenge:
#227 The Chase (49%, tier C) #959 Asymmetric Random Walk (50%, tier C)
10 Project Euler problems in total are mapped to this lesson. Open the Euler Lab to filter them all.
Knowledge Check
Practical Exercise
A share of a stock is modeled as a chain on \(\{\text{Down},\text{Flat},\text{Up}\}\) with rows \((0.5,0.3,0.2),(0.2,0.6,0.2),(0.2,0.3,0.5)\). (a) Is it irreducible and aperiodic? (b) Set up the equations for \(\pi\). (c) By symmetry guess and verify \(\pi\).
(a) Every state reaches every other in one step (all entries positive), so it is irreducible; positive diagonal entries make it aperiodic.
(b) \(\pi P=\pi\) gives: \(\pi_D=0.5\pi_D+0.2\pi_F+0.2\pi_U\); \(\pi_F=0.3\pi_D+0.6\pi_F+0.3\pi_U\); \(\pi_U=0.2\pi_D+0.2\pi_F+0.5\pi_U\); plus \(\pi_D+\pi_F+\pi_U=1\).
(c) The matrix is symmetric under swapping Down and Up, so guess \(\pi_D=\pi_U\). The middle equation becomes \(0.4\pi_F=0.3\pi_D+0.3\pi_U=0.6\pi_D\Rightarrow\pi_F=1.5\pi_D\). Normalizing \(\pi_D+1.5\pi_D+\pi_D=1\Rightarrow\pi_D=\pi_U=2/7,\ \pi_F=3/7\). Substituting back verifies all equations.
Lesson Summary
Formula Sheet Additions
- Did I solve \(\pi P=\pi\) (left) rather than \(P\pi=\pi\)?
- Did I check aperiodicity before claiming \(P^n\) converges?
- Did I read rows of \(P\) as out-probabilities?
Retrieval Practice
Close the lesson and answer from memory before checking. This is deliberate, effortful recall - the single highest-yield study action.
A: Given the present state, the future is conditionally independent of the past: the present is a sufficient statistic.
A: Take the matrix power: \((P^n)_{ij}\), by Chapman-Kolmogorov.
A: Irreducibility (all states communicate) and aperiodicity (gcd of return times is 1), on a finite state space.
Flashcards
Click to flip. These feed the site-wide spaced-repetition queue.
Completion Checklist
- I can explain the core ideas in my own words
- I worked the derivations/examples by hand
- I completed the interactive workbench(es)
- I passed the knowledge check
Source References
This lesson synthesizes and paraphrases concepts from the sources below. No copyrighted text, problem sets, or solutions are reproduced. Return to the originals for full depth.
- Probability: Theory and Examples (Rick Durrett, 5th ed.) current - Ch. 5 - Ch. 5: Markov chains, recurrence, stationary distributions, convergence.
- Brownian Motion and Stochastic Calculus (Karatzas & Shreve, 2nd ed., GTM 113) foundational - Ch. 2 - Markov property as the discrete precursor to diffusions.