What if you could build a model to predict the future, but with one major catch: you are only allowed to know what is happening *right now*? You get no information about the past-no history, no trends, no context. It sounds limiting, but this very idea is the foundation of one of the most powerful tools in statistics and economics: the Markov chain. At its heart, a Markov chain is a ‘memoryless’ process. It’s a way of modeling a sequence of random events where the probability of the next event happening depends only on the state of the present moment.
This concept, formally known as the Markov property, is what makes these models so elegant. A Markov chain is a stochastic process, meaning it describes a system that evolves randomly over time, moving from one state to another. Think about the weather. If we model the weather as a Markov chain, to predict the chance of rain tomorrow, we *only* look at whether it is raining today. We don’t care if it has been raining for the last seven days straight, or if this is the first drop of rain after a month-long drought. The future is conditionally independent of the past, given the present. In this post, we’ll explore this fascinating idea, see how it’s captured in a simple matrix, look at its most famous example, and learn how to use it to predict the future not just one step at a time, but many steps ahead.
Table of Contents
What does ‘memoryless’ actually mean?
The ‘memoryless’ property is the single most important concept in understanding Markov chains. It can feel a bit counter-intuitive at first because, in our daily lives, history *always* matters. But in many systems, this simplification is incredibly effective. Let’s use a simple analogy: a board game.
Imagine you are playing a game and you land on a square that says “Go to Jail.” Your next action (trying to roll doubles to get out) depends *only* on your current state: “In Jail.” The model doesn’t care how you got there. It doesn’t matter if you landed on it directly, were sent there by a “Chance” card, or had an unlucky roll. The past sequence of events is irrelevant to your future probabilities. Your current state, “In Jail,” contains all the information needed to predict your next move.
Let’s contrast this with a game like Blackjack. In Blackjack, the past *deeply* matters. If you know that four Aces have already been played, your probability of getting an Ace next is zero. That is *not* a Markov process. A Markov process is like drawing a card from a full deck, looking at it, and then *putting it back* (shuffling each time). The probability of drawing an Ace is always 4/52, no matter what you drew before.
A simple model: The ‘working’ or ‘broken’ machine
Let’s build a simple Markov chain. Imagine you are responsible for a critical machine at a factory. This machine has two possible states: ‘Working’ or ‘Broken’.
You observe it over several months and gather some data:
- If the machine is ‘Working’ today: There is a 90% chance it will still be ‘Working’ tomorrow, and a 10% chance it will be ‘Broken’ tomorrow.
- If the machine is ‘Broken’ today: The repair team has a 60% chance of fixing it by tomorrow (making it ‘Working’), and a 40% chance it will remain ‘Broken’.
This is a complete Markov chain. Notice the memoryless property: the probability of the machine breaking tomorrow (10%) doesn’t change if the machine has been working for 100 days straight or if it was just fixed yesterday. All that matters is its current state: ‘Working’.
Homogeneous chains: When the rules don’t change
Our machine example has another special property: the probabilities aren’t changing over time. The 90% reliability and the 60% repair rate are the same on Monday as they are on Friday. When the rules of the system remain constant, we call this a homogeneous Markov chain. The transition probabilities are ‘stationary’ or ‘time-invariant’. This is a huge advantage, as it means we don’t have to create a new set of rules for every single day.
We can capture all the rules for our system in a simple, powerful tool called a transition probability matrix. This is just a grid that neatly organizes all the ‘if-then’ probabilities. We’ll label the rows as the ‘From’ state and the columns as the ‘To’ state.
For our machine example, the matrix (let’s call it P) would look like this:
P = [ (From Working) , (From Broken) ]
To Working: [ 0.90 , 0.60 ]
To Broken: [ 0.10 , 0.40 ]
(Note: Matrices are often written with ‘From’ as rows and ‘To’ as columns. The layout above is just one way to visualize it. The key is consistency.)
Let’s use the standard row-as-from convention:
P =
[To: Working] [To: Broken]
[From: Working] [ 0.90 0.10 ]
[From: Broken] [ 0.60 0.40 ]
[Image: A 2x2 grid visualizing the transition probability matrix for the Working/Broken machine example, showing arrows from 'Working' to 'Working' (0.9), 'Working' to 'Broken' (0.1), etc.]
This little matrix is the entire ‘engine’ of our model. Notice a critical rule: each row must sum to 1. This makes perfect sense. If the machine is ‘Working’ today (Row 1), it *must* be either ‘Working’ or ‘Broken’ tomorrow. The probabilities for all possible outcomes must add up to 100% (0.9 + 0.1 = 1.0). This matrix is the key to unlocking predictions.
The classic example: A random walk
Perhaps the most famous and fundamental example of a Markov chain is the random walk. This model is the bedrock for countless theories in physics (describing the motion of particles) and finance (describing the movement of stock prices).
Imagine a person standing on a very long line of numbers (the integers). Let’s say they start at position 0. At each ‘step’ (or unit of time), they flip a fair coin.
- If it’s Heads, they take one step to the right (to position +1).
- If it’s Tails, they take one step to the left (to position -1).
This is a Markov chain. Why? Because to figure out their position at the next step, you only need to know two things: their *current* position and the result of the coin flip. It makes absolutely no difference *how* they arrived at position 0. Did they just come from -1? Or did they go on a wild journey to +50, then all the way back to 0? The model doesn’t care. The past path is irrelevant.
The ‘state’ in this model is the person’s position on the number line (… -2, -1, 0, 1, 2 …). The transition probabilities (assuming a fair coin) are:
- Probability of moving from state i to state i + 1 is 0.5.
- Probability of moving from state i to state i – 1 is 0.5.
This simple ‘drunken sailor’s walk’ model is surprisingly powerful. In economics, the Random Walk Theory suggests that stock market prices evolve in a way that resembles a random walk, meaning past price movements cannot be used to predict future price movements. This is a cornerstone of the efficient-market hypothesis.
Looking ahead: The Chapman-Kolmogorov equations
So far, our transition matrix (P) is great for telling us what happens *one step* into the future. If our machine is ‘Working’ today, we know there’s a 10% chance it’s ‘Broken’ *tomorrow*. But what about the day after tomorrow? Or next week? How do we calculate multi-step probabilities?
We could try to map it out manually. For example, the probability of going from ‘Working’ to ‘Broken’ in *two* days:
- Path 1: Working -> Working -> Broken
- Probability = P(Working -> Working) * P(Working -> Broken) = 0.9 * 0.1 = 0.09
- Path 2: Working -> Broken -> Broken
- Probability = P(Working -> Broken) * P(Broken -> Broken) = 0.1 * 0.4 = 0.04
The total probability is the sum of all possible paths: 0.09 + 0.04 = 0.13, or 13%.
This is manageable for two steps, but it would be a nightmare for 30 steps. This is where the Chapman-Kolmogorov equations provide the formal framework. These equations state that to find the probability of going from state *i* to state *j* in *n* steps, you must sum up the probabilities of all possible intermediate paths. It’s a way of relating joint probability distributions across different points in time.
While the equations themselves look complex, they lead to a result of incredible mathematical beauty and simplicity. If our one-step transition matrix is P, the matrix for all *two-step* transitions is simply P multiplied by itself, or P².
Let’s check our manual calculation:
P² = P * P =
[ 0.90 , 0.10 ] * [ 0.90 , 0.10 ] = [ (0.9*0.9 + 0.1*0.6) , (0.9*0.1 + 0.1*0.4) ] = [ 0.87 , 0.13 ]
[ 0.60 , 0.40 ] [ 0.60 , 0.40 ] [ (0.6*0.9 + 0.4*0.6) , (0.6*0.1 + 0.4*0.4) ] [ 0.78 , 0.22 ]
Look at the top-right entry: 0.13. This is the probability of going from ‘Working’ (Row 1) to ‘Broken’ (Column 2) in exactly two steps. It matches our manual calculation perfectly!
This is the true power of the Chapman-Kolmogorov equations. They give us a method to compute long-term probabilities. Want to know the probability of the machine being ‘Broken’ 30 days from now, given it’s ‘Working’ today? You don’t need to trace millions of paths. You just calculate the matrix P³⁰ and look up the answer. From a simple, memoryless assumption, we’ve built a powerful forecasting engine.
What do you think? Now that you understand the ‘memoryless’ property, can you think of any real-world systems that would be a *bad* fit for a Markov chain-where history and the sequence of past events are absolutely essential for making a prediction?
References
- https://brilliant.org/wiki/markov-chains/
- https://www.probabilitycourse.com/chapter11/11_1_2_basic_concepts_of_markov_chains.php
- https://www.investopedia.com/terms/m/markov-chain.asp
- https://ocw.mit.edu/courses/6-041-probabilistic-systems-analysis-and-applied-probability-fall-2010/resources/mit6_041f10_lec19/
Leave a Reply