Markov Chains
Modeling memoryless state transitions across discrete time steps using transition probability matrices.
What is a Markov Chain?
A Markov Chain is a mathematical model for a system that transitions between discrete states over time steps
Its defining characteristic is the Markov Property (Memorylessness):
The probability of transitioning to future state depends EXCLUSIVELY on the current state , completely ignoring past history:
PAST STATES (X_0, X_1 ... X_t-1) ──► [ CURRENT STATE X_t ] ──► FUTURE STATE X_t+1
(Completely Ignored!) (Determines Next Step!)
The Transition Probability Matrix ()
For a system with discrete states :
The probabilities of moving from state to state are stored in an Transition Matrix :
TO STATE:
Sunny Rainy
FROM Sunny ┌ 0.8 0.2 ┐ Sum of each row MUST equal 1.0!
STATE: Rainy └ 0.4 0.6 ┘
Given an initial state probability vector :
- State distribution after 1 step:
- State distribution after steps:
Stationary Distribution ()
As step count , many Markov Chains reach a stable equilibrium called the Stationary Distribution :
Once reached, taking additional transition steps does not change state probabilities!
┌──────────────────────────┬──────────────────────────┐
│ 1. IRREDUCIBLE │ 2. APERIODIC │
├──────────────────────────┼──────────────────────────┤
│ It is possible to reach │ Transitions do not loop │
│ EVERY state from EVERY │ in fixed deterministic │
│ state in finite steps. │ numerical cycles. │
└──────────────────────────┴──────────────────────────┘
An Ergodic Markov Chain (both Irreducible and Aperiodic) is guaranteed to converge to a unique, stable stationary distribution regardless of initial state .
Applications in Machine Learning
- Google PageRank: Models a random web surfer clicking links. PageRank scores equal the stationary distribution probabilities of pages in the web graph Markov Chain.
- Hidden Markov Models (HMMs): Sequence labeling for speech recognition and POS tagging.
- MCMC Sampling: Generating samples from complex posterior distributions by constructing Markov Chains whose stationary state matches target distributions.
Say this out loud
A Markov Chain is a memoryless stochastic model where future states depend exclusively on the current state. Governed by a Transition Matrix P, an ergodic Markov Chain (irreducible and aperiodic) converges over time to a unique stationary distribution pi where pi = pi * P.
Followups to expect
- What is a Absorbing Markov Chain? A chain containing states that cannot be left once entered (), useful for modeling customer churn or survival analysis death events.
- What is Detailed Balance? A condition stating that probability flux between any state pair and is equal, ensuring a symmetric stationary distribution in MCMC sampling.
Check yourself
What core property defines a first order Markov Chain process?