Historical Context & Motivation
Imagine you want to predict the weather tomorrow. You know that if today is sunny, there's a 70% chance tomorrow will also be sunny and a 30% chance it will rain. If today is rainy, there's a 40% chance tomorrow will be sunny and a 60% chance of more rain. This kind of thinking — predicting the future based only on the present — is exactly what a Markov chain captures. For over a century, mathematicians have used Markov chains to model everything from board games to internet search engines.
The central question that Markov chains answer is this: if a system keeps changing randomly according to fixed rules, where does it end up in the long run? That long-run destination is called the steady state, and finding it is one of the most powerful applications of linear algebra.
Core Principles & Definitions
Before diving into calculations, let's nail down the key vocabulary. A Markov chain is built from just a few simple ideas. Once you understand these building blocks, the rest of the topic clicks into place.
State
Transition Probability
Transition Matrix
Memoryless Property
Steady State
Visual Explanation — State Diagrams
The best way to see a Markov chain is with a state diagram. Each state is drawn as a circle, and arrows between circles show the transition probabilities. An arrow that loops back to the same circle means the system can stay in that state. Let's look at our weather example with two states: Sunny and Rainy.
In the diagram above, every arrow carries a number between 0 and 1. The key rule is that all arrows leaving any single state must add up to exactly 1. This makes sense — from any state, something has to happen, so the probabilities must account for every possibility.
Mathematical Framework
Now let's translate the state diagram into math. We organize the transition probabilities into a transition matrix. Each column of the matrix corresponds to a starting state, and each row corresponds to a destination state. The entries are the probabilities of moving from the column state to the row state.
We also need a state vector to describe where the system is right now. If today is definitely sunny, the state vector is:
To find the probabilities for tomorrow, we multiply the transition matrix by the current state vector. To find the day after that, we multiply again. In general, after n steps:
The steady-state vector q is the special vector that doesn't change when you multiply by P. Mathematically:
How the System Reaches Steady State
One of the most fascinating things about Markov chains is that no matter where you start, the system often settles into the same steady state. Let's watch the weather chain converge. Starting from 100% Sunny, we multiply by P over and over and track how the state vector changes.
Notice how quickly the system converges. After just a few steps, the probability of Sunny has settled near 4/7 ≈ 0.571 and Rainy near 3/7 ≈ 0.429. Even if we had started from 100% Rainy instead, we would reach the exact same steady state. This is the magic of Markov chains — the starting point doesn't matter in the long run, as long as the chain is well-behaved (meaning every state can eventually reach every other state).
Worked Example — Finding the Steady State
Let's find the exact steady-state vector for our weather Markov chain. We need to solve the equation Pq = q, where q is the steady-state vector and the entries of q add to 1.
0.7q₁ + 0.4q₂ = q₁ and 0.3q₁ + 0.6q₂ = q₂.0.7q₁ + 0.4q₂ = q₁ and subtract q₁ from both sides: −0.3q₁ + 0.4q₂ = 0. This simplifies to 0.4q₂ = 0.3q₁, or equivalently q₁ = (4/3)q₂.(4/3)q₂ + q₂ = 1. This gives (7/3)q₂ = 1, so q₂ = 3/7.0.7(4/7) + 0.4(3/7) = 4/10 + 12/70 = 4/7 ✓.Strengths, Limitations & Comparisons
Markov chains are powerful, but they're not always the right tool. Let's compare their strengths and limitations so you know when to use them and when to look for other approaches.
| Feature | Strength | Limitation |
|---|---|---|
| Simplicity | Easy to set up — just list states and probabilities. The math uses basic matrix multiplication. | Oversimplifies complex systems that have many interacting parts or continuous change. |
| Memory | The memoryless property makes computation fast — you only need the current state. | Many real systems DO depend on history. Weather depends on the past week, not just today. |
| Steady State | Predicts long-term behavior without simulating every single step. | Not all chains have a unique steady state — some cycle or have absorbing states. |
| Scalability | Works for millions of states (e.g., Google's web pages). | Larger matrices require more computational resources to solve. |
Connection to Eigenvalues & Eigenvectors
You might have noticed something interesting in our work. The steady-state equation Pq = q looks a lot like the general eigenvector equation Av = λv, with λ = 1. That's no coincidence — finding the steady state of a Markov chain is a specific case of finding eigenvectors. This table shows how the Markov chain concepts connect to broader linear algebra ideas.
| Markov Chain Concept | Linear Algebra Concept | Why It Matters |
|---|---|---|
| Transition matrix P | Square matrix A | P is a special matrix whose columns sum to 1 (called a stochastic matrix). |
| Steady-state vector q | Eigenvector for λ = 1 | The steady state is the eigenvector of P corresponding to eigenvalue 1, scaled so its entries sum to 1. |
| Convergence to steady state | Dominant eigenvalue | λ = 1 is the largest eigenvalue. Other eigenvalues are smaller, so their effects fade as n → ∞. |
| Solving (P − I)q = 0 | Null space of (A − λI) | Standard technique for finding any eigenvector — subtract λI from the matrix and find the null space. |
As you continue in linear algebra, you'll see eigenvalues and eigenvectors everywhere — in vibrating systems, population models, and data science (principal component analysis). Markov chains are one of the most intuitive entry points into this powerful framework, because the steady state has a concrete, real-world meaning that makes the abstract algebra feel tangible.
Practice Problems
Lesson Summary
A Markov chain models a system that moves between states with fixed transition probabilities, where the next state depends only on the current one (the memoryless property). These probabilities are organized in a transition matrix P, where each column sums to 1. The state vector tracks the current probability distribution, and multiplying by P advances the system one step: xₙ = P × xₙ₋₁.
The steady-state vector q satisfies Pq = q — it is the eigenvector of P with eigenvalue 1, scaled so its entries sum to 1. To find it, solve the system (P − I)q = 0 with the constraint that entries sum to 1. For well-behaved (irreducible, aperiodic) chains, the system always converges to the steady state regardless of the starting vector — a powerful result that connects probability, matrix algebra, and eigenvalue theory.