Probability Meets Eigenvectors
A Markov chain hops among states with fixed probabilities. Its transition matrix has the probability of moving to state from state , so its entries are nonnegative and each column sums to . A distribution (nonnegative, entries summing to ) evolves by .
That column condition forces to be an eigenvalue (the all-ones vector is a left eigenvector), and its right eigenvector — normalized to sum to — is the steady state: the distribution the chain settles into regardless of where it started. Finding it is one homogeneous solve: . All other eigenvalues have , and the second-largest, , sets the mixing rate: the memory of the starting state decays like . For the two-state chain in the figure, and reads , so and the steady state is . The other eigenvalue is , so the memory of the start shrinks by a factor each step.
Google's original algorithm models a random web surfer: from each page, follow a random link (with occasional random jumps). The importance of a page is its share of the steady-state distribution of that Markov chain — the eigenvector of a matrix with billions of rows, computed by simply iterating (the power method) until it stops changing. A trillion-dollar company, built on this chapter.
Some states trap you (absorbing); the natural question becomes "how long until absorption?" First-step analysis: from state , one step happens, then you are somewhere new — so , a small linear system in the expected times.
A state that advances with probability and stalls otherwise contributes expected steps (the geometric distribution). Gambler's ruin, board-game durations, drug absorption, and queue lengths are all this one linear system with different numbers.
For , find (a) the steady state and (b) the second eigenvalue, and say how much of an initial imbalance survives steps.
Show the answerHide the answer
(a) Solve : the first row reads , so ; normalized to sum , the steady state is . Check by one multiplication: ✓. (b) The eigenvalues add to the trace , and one of them is , so . The deviation from the steady state is multiplied by each step, so after steps a fraction — about — of any initial imbalance remains.
Distributions Step by Step
Starting from the distribution , after steps the distribution is , and the entry is the probability of being in state after steps, having started in state . For a two-state chain with second eigenvalue and steady state ,
where is fixed by .
Each step conditions on where the chain is now: the chance of landing in is , which is row of times . Repeating times gives . For the closed form, the eigenvector of must have entries summing to (column sums of are , so preserves the total, and forces total ); in two states that is . The distance to equilibrium therefore shrinks by the factor every step.
For , start in state A: . One step: , the first column.
Second step: . Each entry sums over the ways to arrive: in A after two steps means A→A→A () or A→B→A (). The entries still sum to ✓ — a quick check that the multiplication used rows, not columns.
Same chain, same start. The steady state is and . Write , so .
Then
Check at : the first entry is ✓, matching the hand computation. The gap to equilibrium is : about after one step, after three, and under after seven. This chain forgets its start fast because is small.
In the same chain, what is the probability of being in A two steps after starting in B? That is the entry : row A of times column B of .
. The two terms are the two routes: B→A→A (probability ) and B→B→A (). Matrix multiplication is exactly "sum over the intermediate state" — which is why powers of answer every multi-step question at once.
With columns as "from," a start in A is the first column. A common slip multiplies by rows instead and reports — entries that sum to , which no probability distribution can do. That is . (Some books use the other convention, row vectors and rows summing to ; either works if used consistently, and the sum-to- check catches a mix-up at once.)
For and a start in state 2, , find , , the steady state, and .
Show the answerHide the answer
, the second column. ; the entries sum to ✓. Steady state: gives , so and . . Check with the closed form: , so the first entry of is ✓.
Absorbing Chains: Where You End Up
Let be the probability that the chain, started in state , is eventually absorbed in a target state . Then , at every other absorbing state, and for each transient state
where is the probability of stepping from to . Together with for expected times, this answers "where" and "how long."
Condition on the first step. From the chain moves to with probability , and from there its chance of ending in is — the chain has no memory of how it got to . Adding over gives the equation. The expected-time equation has the extra for the step just taken. Both are small linear systems, one unknown per transient state.
A gambler with bets at a time on fair coin flips and stops at or . What is the chance of reaching ? With and , each middle state satisfies .
That equation says each is the average of its neighbors, so the lie on a straight line from to : , and . The expected number of bets solves with , whose solution is : . Check: , and ✓. A fair game gives a winning chance equal to the fraction of the total money you start with.
A token on steps up with probability and down with ; and absorb it. Starting at , what is the chance of reaching ? The equations: and .
Substitute the second into the first: , so and . Then . Check against the gambler's-ruin formula with , : ✓. Expected time: and give , so and .
Writing the expected-time equations as and (without the for the step just taken) gives , so — the token supposedly finishes instantly. The absorption-probability equations have no because they count chances, not steps; the time equations must count the step. A zero or negative expected time is the telltale sign.
A fair walk on (up or down with probability each) is absorbed at and . Starting at , find the chance of ending at and the expected number of steps.
Show the answerHide the answer
Absorption: and . Substituting, , so — the fraction of the way to the top, as the straight-line rule predicts. Time: and (the terms for drop out). Substituting, , so and . This matches ✓.
Proofs & Why It Matters
Let . Column sums equal means — so is an eigenvalue of , and a matrix and its transpose share a characteristic polynomial, hence eigenvalues: is an eigenvalue of too.
Moreover no eigenvalue can exceed in magnitude: if , comparing the largest-magnitude entry of both sides shows (each entry of is a weighted average of entries of ). Significance: existence of a steady state is thus structural — probability is conserved, so equilibrium is guaranteed; the only question is how fast you get there, which is 's job.
Markov chains tie the whole course together: the steady state is an eigenvector (eigenvalues topic), computing is diagonalization (powers topic), the entries of converge because (spectral thinking), and expected absorption times are a linear system (row reduction). One applied object exercising every tool in the box — which is exactly why it closes the course.
Going Deeper: Worked Problems
Sunny goes to sunny with probability , else rainy; rainy goes to rainy , sunny , cloudy ; cloudy goes to sunny , cloudy . Find the long-run fraction of sunny days.
Step 1 — transition matrix (columns from-state, rows to-state): ; each column sums to ✓.
Step 2 — steady state solves : from row 2, gives ; from row 3, gives .
Step 3 — normalize: , so sunny, , .
Step 4 — verify row 1: ✓. The forecast for a year from now needs no calendar — only this eigenvector.
A token starts at and each second moves with probability or stays with probability ; it stops on reaching . Expected time to stop?
Step 1 — let be the expected remaining time from position , with .
Step 2 — first-step analysis at each state: , so , i.e. .
Step 3 — unwind from the end: , , .
Step 4 — interpret: each step forward takes expected seconds (geometric distribution), and three steps are needed — linearity of expectation gives directly, and the linear system confirms it.