Markov Chains
Transition Matrices
Model systems that change between states over time using probability matrices and state vectors to predict long-term behavior.
What Is a Markov Chain?
A Markov chain is a mathematical model describing a system that transitions between a finite set of states. At each time step, the system moves from one state to another (or stays) with a fixed probability.
Examples include weather patterns (sunny vs. rainy), customer brand loyalty, web page navigation, and gene mutations across generations.
States and Transitions
The Transition Matrix \( P \)
We organize all transition probabilities into a square matrix called the transition matrix \( P \). Each entry \( p_{ij} \) represents the probability of moving from state \( i \) to state \( j \).
State Vectors: Where Are We Now?
A state vector \( \mathbf{s} \) is a row vector that describes the probability of being in each state at a given time. For \( n \) states, it has \( n \) entries that sum to 1.
\( \mathbf{s}_0 = \begin{bmatrix} 1 & 0 \end{bmatrix} \)
\( \mathbf{s}_0 = \begin{bmatrix} 0.5 & 0.5 \end{bmatrix} \)
The Core Rule: Multi-Step Prediction
To find the state vector after \( n \) steps, we repeatedly multiply by \( P \), or equivalently raise \( P \) to the \( n \)th power:
The Steady-State Vector
As \( n \to \infty \), many Markov chains converge to a steady-state vector \( \mathbf{q} \) that no longer changes. This vector satisfies:
To find \( \mathbf{q} \), solve the system of equations \( \mathbf{q}P = \mathbf{q} \) together with the constraint that all entries sum to 1.
Regular vs. Absorbing Chains
How to Apply Markov Chains
Example 1: Weather Prediction
Using our weather model with \( P = \begin{bmatrix} 0.7 & 0.3 \\ 0.5 & 0.5 \end{bmatrix} \) and today is sunny: \( \mathbf{s}_0 = \begin{bmatrix} 1 & 0 \end{bmatrix} \). Find the probability distribution for tomorrow.
Example 2: Two Days Ahead
What is the weather probability distribution for the day after tomorrow?
Example 3: Finding the Steady State
Find \( \mathbf{q} = \begin{bmatrix} q_1 & q_2 \end{bmatrix} \) such that \( \mathbf{q}P = \mathbf{q} \).
Larger Example: Three States
A customer chooses between Brand A, Brand B, and Brand C each month. The transition matrix is:
Common Mistakes to Avoid
Summary of Key Concepts
| Concept | Symbol | Meaning |
|---|---|---|
| State vector | \( \mathbf{s}_n \) | Probability distribution at step \( n \) |
| Transition matrix | \( P \) | Matrix of all transition probabilities |
| One-step update | \( \mathbf{s}_1 = \mathbf{s}_0 \cdot P \) | Multiply state vector by \( P \) |
| Multi-step | \( \mathbf{s}_n = \mathbf{s}_0 \cdot P^n \) | Raise \( P \) to the \( n \)th power |
| Steady state | \( \mathbf{q}P = \mathbf{q} \) | Long-run equilibrium distribution |
| Row sum rule | \( \sum_j p_{ij} = 1 \) | Each row must sum to 1 |
Question 1 of 5
Which property defines a Markov chain?
Question 2 of 5
In a valid transition matrix, each row must:
Question 3 of 5
Given \( \mathbf{s}_0 = \begin{bmatrix} 1 & 0 \end{bmatrix} \) and \( P = \begin{bmatrix} 0.8 & 0.2 \\ 0.4 & 0.6 \end{bmatrix} \), what is \( \mathbf{s}_1 \)?
Question 4 of 5
To find the state distribution after 5 steps, you compute:
Question 5 of 5
The steady-state vector \( \mathbf{q} \) satisfies which equation?