Discrete-time Markov chains, transition matrices, stationary distributions, and hitting times.
Markov chains model systems that evolve randomly over time, where the future depends only on the present state — not the past. This topic covers the formal definition, transition matrices, state classification, stationary distributions, and first step analysis — the main computational tool for hitting times and absorption probabilities. Markov chains appear directly in quant interviews through random walk problems, gambler's ruin, and expected hitting time questions.
A sequence of random variables taking values in a countable state space is a Markov chain if it satisfies the Markov property: for all and all states :
The future is conditionally independent of the past given the present.
The Markov property says the current state is a sufficient statistic for predicting the future. All relevant history is encoded in the current state — this is what makes Markov chains tractable.
A Markov chain is time-homogeneous if the transition probabilities do not depend on :
The transition matrix is the matrix with entries :
The -step transition probability satisfies:
Chapman-Kolmogorov is the key computational tool: to find the probability of being in state after steps starting from , simply compute . This is efficient via matrix diagonalization when has distinct eigenvalues.
The probability of following a specific path is:
For a 3-state chain starting in state 1, the probability of the path is .
Let be the to state . Then:
In finite state spaces, all recurrent states are positive recurrent — null recurrence only arises in infinite chains (e.g. symmetric random walk on ).
A state is absorbing if (once entered, never left). A chain is an absorbing Markov chain if it has at least one absorbing state and from every non-absorbing state it is possible to reach an absorbing state.
For an absorbing chain, partition the states into transient states and absorbing states . The transition matrix takes the canonical form:
is the the chain visits transient state before absorption, starting from transient state .
A probability distribution is a stationary distribution (invariant measure) if:
To find : solve the linear system with . For a 2-state chain with , the solution is , .
A Markov chain with stationary distribution satisfies detailed balance if:
If a distribution satisfies detailed balance with respect to , then is a stationary distribution of the chain.
Detailed balance is easier to verify than directly — it is a pairwise condition. It is the foundation of MCMC algorithms (Metropolis-Hastings): the proposal is designed so that detailed balance holds, guaranteeing is the stationary distribution.
For an irreducible, positive recurrent chain with stationary distribution , for any bounded function :
For an ergodic (irreducible + aperiodic) chain with stationary distribution :
Aperiodicity is essential for convergence to stationarity. A periodic chain (e.g. period 2) oscillates and does not converge — it alternates between two limits. Adding a self-loop breaks periodicity.
First step analysis (analyse de premier pas) sets up recursive equations by conditioning on the first transition . For any quantity depending on the starting state :
Let be a set of absorbing states and . Then is the minimal non-negative solution to:
Gambler's Ruin: player has dollars, bets 1 dollar at each step, wins with probability , loses with probability . States and are absorbing. Let . First step analysis gives with , :
Let and where . Then is the minimal non-negative solution to:
Expected return time: for an irreducible chain, the expected return time to state starting from is .
First step analysis always produces a linear system — never try to sum an infinite series directly. The pattern is always: boundary conditions first, then write the recursive equation for interior states, then solve the system. For 2–3 state problems, the system is or and solvable by hand in an interview.
| Property | Definition | Key implication |
|---|---|---|
| Accessible: | Reachability | |
| Communicating: |
| Concept | Formula |
|---|---|
| Markov property |
The numbers are called transition probabilities.
In particular, the -step transition matrix is simply the -th power of .
where is the matrix of transitions among transient states, is the matrix of transitions from transient to absorbing states, and is the identity on absorbing states.
i.e. if , then for all .
A chain satisfying detailed balance is called reversible.
equivalently as .
where is the immediate reward/cost at state . This gives a linear system solved simultaneously for all starting states.
Random walk on with reflecting barriers: starting from state , the expected hitting time to state satisfies with , giving (solved recursively).
| and |
| Equivalence class |
| Irreducible | All states communicate | Unique stationary dist. |
| Aperiodic |
| Ergodic | Irreducible + aperiodic | Converges to |
| Recurrent | Returns infinitely often |
| Transient | Eventually leaves forever |
| Positive recurrent |
| Absorbing | Special recurrent state |
| -step transition |
| Chapman-Kolmogorov |
| Path probability |
| Stationary distribution | , |
| Detailed balance |
| Expected return time |
| Fundamental matrix |
| Absorption probability FSA | (boundary: ) |
| Expected hitting time FSA | (boundary: ) |
| 2-state stationary dist. | , |