Historical Context & Motivation
The idea that a system's future depends only on its present state — not on the path it took to arrive there — is deceptively simple, yet it underpins an enormous range of modern applications. Markov chains formalize this notion by describing sequences of random events in which the probability of each event depends solely on the state attained in the previous step. The mathematical machinery that makes these chains computationally tractable is the transition matrix, a square matrix whose entries encode every one-step probability in the system. Understanding how this framework developed helps us appreciate why it remains central to fields as diverse as genetics, economics, information retrieval, and artificial intelligence.
The central question that transition matrices answer is this: given a system that moves randomly among a finite set of states according to fixed probabilities, how can we efficiently compute the likelihood of being in any particular state after n steps, and what does the system's behavior look like in the long run? Matrix algebra transforms this potentially intractable combinatorial problem into straightforward matrix multiplication.
Core Principles & Definitions
Before diving into computations, it is essential to establish the foundational vocabulary and structural constraints that govern every finite Markov chain. These principles ensure that the transition matrix is well-defined and that the probabilistic interpretation remains consistent across all calculations.
State Space
Markov (Memoryless) Property
Transition Probabilities
Stochastic Matrix Constraint
Initial State Distribution
Visual Explanation: State Transition Diagram
The most intuitive representation of a Markov chain is a state transition diagram — a directed graph in which each node represents a state and each weighted arrow represents a transition probability. The diagram below illustrates a three-state Markov chain for a simplified weather model with states Sunny (S), Cloudy (C), and Rainy (R). Each arrow is labeled with the probability of that particular transition, and the self-loops indicate the probability that the weather remains unchanged from one day to the next.
Reading the diagram carefully, notice that from state Sunny the outgoing probabilities are 0.6 + 0.3 + 0.1 = 1.0, confirming the row-stochastic constraint. The same check holds for Cloudy (0.4 + 0.3 + 0.3 = 1.0) and Rainy (0.3 + 0.2 + 0.5 = 1.0). This graphical representation translates directly into the rows of the transition matrix that we formalize in the next section.
Mathematical Framework
We now translate the state transition diagram into the algebraic language of matrices. The power of this representation is that multi-step transition probabilities reduce to matrix powers, and long-run behavior can be extracted from the matrix's spectral properties.
For our weather example, the transition matrix is:
Classifying States & Chains
Not all Markov chains behave the same way in the long run. The classification of states determines whether a unique stationary distribution exists and whether the chain converges to it. Two properties are decisive: irreducibility (every state can be reached from every other state) and aperiodicity (the system does not cycle through states in a fixed period). A chain possessing both properties is called ergodic, and the Fundamental Theorem of Markov Chains guarantees it has a unique stationary distribution to which all initial distributions converge.
| Property | Definition | Consequence |
|---|---|---|
| Irreducible | Every state is reachable from every other state in some finite number of steps. | All states belong to a single communicating class; the chain cannot get 'trapped' in a subset. |
| Aperiodic | The greatest common divisor of all return times to any state is 1. | The chain does not cycle deterministically; Pⁿ converges as n → ∞. |
| Ergodic | The chain is both irreducible and aperiodic. | A unique stationary distribution π exists, and π⁽ⁿ⁾ → π for every initial distribution. |
| Absorbing | A state s is absorbing if pss = 1 (once entered, never left). | The chain is reducible. Probability of eventual absorption is 1 if every transient state can reach an absorbing state. |
Worked Example: Two-Step Forecast & Steady State
Suppose today is Sunny. Using the weather transition matrix from Section 3, we will (a) find the probability distribution two days from now, and (b) compute the long-run stationary distribution.
Strengths, Limitations, and Modeling Considerations
Markov chain models with finite state spaces and fixed transition matrices are remarkably versatile, but their assumptions can also be restrictive. Understanding where the model excels and where it breaks down is essential for responsible application.
| Strengths | Limitations |
|---|---|
| Compact representation: an n-state system requires only an n × n matrix, making storage and computation efficient. | The memoryless assumption may be unrealistic for systems with long-range dependencies (e.g., stock prices influenced by trends). |
| Multi-step forecasting reduces to matrix exponentiation — standard, well-optimized operations in linear algebra libraries. | Transition probabilities are assumed constant (time-homogeneous). Seasonal or evolving systems violate this. |
| Steady-state analysis provides powerful long-run insights without simulation, via eigenvalue methods. | State space must be finite (or countable) for the matrix framework; continuous state spaces require different tools (e.g., kernel density methods). |
| Easily interpretable: transition diagrams and matrices convey the model's structure transparently. | Estimating accurate transition probabilities requires substantial data; small samples can yield unreliable matrices. |
Connection to Advanced Theory
The finite, discrete-time Markov chain studied in this lesson is the entry point to a rich hierarchy of stochastic models. As you progress through probability and applied mathematics, you will encounter extensions that relax the constraints we have imposed here. The table below maps the key generalizations and indicates where the transition matrix framework either extends naturally or requires fundamentally new tools.
| Feature | This Lesson | Advanced Extension |
|---|---|---|
| Time | Discrete steps (n = 0, 1, 2, …) | Continuous-time Markov chains use a rate matrix Q and matrix exponential eQt for transition probabilities over any time interval t. |
| State space | Finite: n states, n × n matrix | Countably infinite (birth-death chains) or continuous (Markov diffusion processes governed by Fokker–Planck equations). |
| Transition rule | Fixed (time-homogeneous) matrix P | Time-inhomogeneous chains use a sequence P⁽¹⁾, P⁽²⁾, … of different matrices at each step. |
| Memory | First-order: depends on current state only | Higher-order Markov chains condition on the last k states; Hidden Markov Models (HMMs) introduce unobservable states. |
| Computational use | Direct multiplication Pⁿ for forecasts | MCMC algorithms (Metropolis–Hastings, Gibbs sampling) construct chains whose stationary distribution matches a target distribution for Bayesian inference. |
In a linear algebra course, you will see that the stationary distribution π is the left eigenvector of P corresponding to eigenvalue λ = 1. The Perron–Frobenius theorem guarantees that for a positive (ergodic) matrix, the eigenvalue 1 is dominant and simple, ensuring uniqueness of π and geometric convergence of Pⁿ. The second-largest eigenvalue modulus controls the mixing rate — how quickly the chain 'forgets' its initial state — a quantity of immense practical importance in MCMC sampling.
Practice Problems
Lesson Summary
A Markov chain models a system that transitions among a finite set of states according to fixed probabilities, with the defining memoryless (Markov) property ensuring that the next state depends only on the current one. All one-step transition probabilities are organized into a row-stochastic transition matrix P, where each entry pij is non-negative and each row sums to 1. The state distribution after n steps is computed via π⁽ⁿ⁾ = π⁽⁰⁾Pⁿ, reducing multi-step forecasting to matrix multiplication.
When a chain is ergodic (both irreducible and aperiodic), a unique stationary distribution π exists, satisfying π = πP with Σπᵢ = 1. This vector describes the long-run proportion of time spent in each state and is the left eigenvector of P for eigenvalue 1. Chains that are absorbing, periodic, or reducible require separate analysis but build on the same matrix framework, making transition matrices the indispensable tool for all finite stochastic modeling.