Linear Algebra, Interactive EditionXYZ Homework Edition

⇩ Download ▾

5.5 Stochastic Matrices and the Steady State

The last section ended on a rule: an eigenvalue strictly larger in absolute value than every other decides the long run. Almost always that means growth without bound or decay to nothing. The interesting case is a dominant eigenvalue of exactly 11, with every other eigenvalue smaller than 11 in absolute value — the long run then goes somewhere and stays.

Model a system that is always in one of three states, and let the numbers MijM_{ij} be the probability of moving to state ii given that you are currently in state jj. Take

M = ( 0.6 0.3 0.2 0.4 0.5 0.2 0 0.2 0.6 ) M = \begin{pmatrix} 0.6 & 0.3 & 0.2 \\ 0.4 & 0.5 & 0.2 \\ 0 & 0.2 & 0.6 \end{pmatrix}

Read the columns: from state 1, the chances of going to states 1, 2, 3 are 0.60.6, 0.40.4, 00 — you never jump from state 1 to state 3 in a single step. Each column sums to 11, because from wherever you are you must end up somewhere. A matrix with non-negative entries whose columns each sum to 11 is called stochastic.

A distribution 𝐱=(x1,x2,x3)\mathbf{x} = (x_1, x_2, x_3) records the probability of being in each state; its entries are non-negative and sum to 11, so distributions form a triangle inside the plane x+y+z=1x + y + z = 1. Applying MM advances the system one step, and the column condition is exactly what guarantees the result is another distribution — the entries of M𝐱M\mathbf{x} sum to 11 whenever 𝐱\mathbf{x}'s do.

A small semi-transparent sloping triangle, the set of all probability distributions over three states, with a white line marking one edge of the triangle where the third probability is zero. A short green marker shows the chosen starting distribution, set by two independent sliders - it is a genuine distribution, and sits on the triangle, only while the two slider values sum to at most one; past that the third probability goes negative and the marker leaves the triangle. An amber segment runs from the green marker to where one step of the chain sends the start. A red dot marks the steady state at (0.4, 0.4, 0.2). Wherever the start is placed, the amber segment runs from the marker toward the red dot, and when the start is dialed onto the red dot the segment shrinks to nothing.Explore in 3D (opens in a new tab)

A small semi-transparent sloping triangle, the set of all probability distributions over three states, with a white line marking one edge of the triangle where the third probability is zero. A short green marker shows the chosen starting distribution, set by two independent sliders - it is a genuine distribution, and sits on the triangle, only while the two slider values sum to at most one; past that the third probability goes negative and the marker leaves the triangle. An amber segment runs from the green marker to where one step of the chain sends the start. A red dot marks the steady state at (0.4, 0.4, 0.2). Wherever the start is placed, the amber segment runs from the marker toward the red dot, and when the start is dialed onto the red dot the segment shrinks to nothing.

The plane of distributions, with the white line marking one edge of the triangle where genuine distributions live. The green marker is the starting distribution (s,a,1−s−a)(s, a, 1 - s - a) set by the two sliders, the amber segment runs from it to where one step of the chain sends it, and the red dot is the steady state (0.4,0.4,0.2)(0.4, 0.4, 0.2).

Explore the figure

  1. At the defaults s=0.1s = 0.1, a=0.1a = 0.1 — a system almost certainly in state 3 — the amber segment is long. One step takes this start to (0.25,0.25,0.5)(0.25, 0.25, 0.5), a displacement of (+0.15,+0.15,−0.30)(+0.15, +0.15, -0.30): probability is draining out of state 3 and splitting evenly between states 1 and 2.
  2. Drag the sliders to s=0.4s = 0.4, a=0.4a = 0.4. The segment shrinks to nothing. That is the steady state: one step changes it not at all, which is what "steady" means.
  3. Move several notches away from those values in any direction — try s=0.5s = 0.5, a=0.4a = 0.4. The segment reappears, running from the green marker back toward the red dot. Every start is pulled the same way.
  4. Try a corner, s=1s = 1, a=0a = 0 — the system definitely in state 1. One step gives (0.6,0.4,0)(0.6, 0.4, 0), which is still on the edge where state 3 has probability zero: the segment runs along that white edge rather than into the interior, because MM has a 00 in the row-3, column-1 position and you cannot reach state 3 from state 1 in a single step. Take a second step and the interior opens up; the destination is unchanged either way.

The steady state is an eigenvector

A distribution that a step leaves alone satisfies Mπ=πM\boldsymbol\pi = \boldsymbol\pi — which is the eigenvector equation for eigenvalue 11. Finding it means solving (M−I)π=0(M - I)\boldsymbol\pi = \mathbf{0}, so the steady state is simply the null space of M−IM - I, with one extra condition to pin down the scale: its entries must sum to 11.

Why should λ=1\lambda = 1 be available at all? Because the columns of MM each sum to 11, the columns of M−IM - I each sum to 00. That is a dependency among the rows: adding all three rows of M−IM - I gives the zero row. Dependent rows means a determinant of zero, which means M−IM - I is not invertible, which means its null space contains something other than 0\mathbf{0}. Every stochastic matrix has 11 as an eigenvalue, and the argument used nothing about the particular numbers.

Be careful about what that buys. It produces a nonzero vector fixed by MM, and no more. Nothing in the determinant forces that vector's entries to be non-negative, or even to sum to something other than zero so that it could be rescaled to sum to 11 — and a fixed vector failing either test is not a distribution. That every stochastic matrix does in fact fix a genuine distribution is a separate and harder theorem (Perron–Frobenius), which this book takes on trust. What the argument above settles is the easy half: that there is something to look for.

00
The shifted matrix is singular, as it must be ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The shifted matrix is singular, as it must be, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The determinant of M−IM - I is exactly zero. This is not a numerical coincidence of the chosen entries: the columns of MM sum to 11, so the columns of M−IM - I sum to 00, and a matrix whose columns sum to zero has dependent rows. So λ=1\lambda = 1 is guaranteed before any of it is computed — though, as the text notes, turning the fixed vector that guarantees into an honest distribution takes a theorem this determinant does not supply.

[10−201−2000]\begin{bmatrix}1 & 0 & -2 \\ 0 & 1 & -2 \\ 0 & 0 & 0\end{bmatrix}
Reducing to find it ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text Reducing to find it, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The reduced form of M−IM - I: two pivots and one free variable, so the null space is a line. Reading it off, x1=2x3x_1 = 2x_3 and x2=2x3x_2 = 2x_3, so every solution is a multiple of (2,2,1)(2, 2, 1). Those three numbers sum to 55, so dividing by 55 gives the one solution that is a distribution.

That division is the last step: π=15(2,2,1)=(0.4,0.4,0.2)\boldsymbol\pi = \tfrac{1}{5}(2, 2, 1) = (0.4, 0.4, 0.2), the red dot. Confirm it directly, since the check is short. The first coordinate of MπM\boldsymbol\pi is 0.6(0.4)+0.3(0.4)+0.2(0.2)=0.24+0.12+0.04=0.40.6(0.4) + 0.3(0.4) + 0.2(0.2) = 0.24 + 0.12 + 0.04 = 0.4, and the other two work out the same way.

Why everything drifts there

Existence is not convergence. What makes step 3 of the exploration true — that every start is pulled in — is the rest of the spectrum. The eigenvalues of MM are 11, 12\tfrac12 and 15\tfrac15. They are distinct, and eigenvectors belonging to distinct eigenvalues are always independent, so these three form a basis — which is exactly the situation the last section needed in order to write A=PDP−1A = PDP^{-1}.

Write any starting distribution in that basis. Its λ=1\lambda = 1 component is some multiple of π\boldsymbol\pi, and the other two components lie along the remaining eigenvectors. Applying MM a total of kk times multiplies those pieces by 1k1^k, (12)k(\tfrac12)^k and (15)k(\tfrac15)^k. The first piece never moves; the other two shrink by a factor of one half and one fifth at every step, vanishing as kk grows. Since the sums stay equal to 11 throughout, the surviving piece must be π\boldsymbol\pi itself. So

M k 𝐱 ⟶ π for every starting distribution  𝐱 M^k\mathbf{x} \longrightarrow \boldsymbol\pi \quad \text{for every starting distribution } \mathbf{x}

and the rate is governed by the second-largest eigenvalue, 12\tfrac12: in the long run the distance to the steady state roughly halves each step. That is why the amber segment is long far from the red dot and short near it.

An original work of XYZ Homework, built around interactive XYZ 3D figures. Chapters 1–6 follow the topic sequence of Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL). Chapter 0's scope (its topics, their order, and the idea each figure shows) follows the Vectors chapter of Ximera's Linear Algebra: An Interactive Introduction. The prose, worked examples and figures were written for this book, which is not affiliated with or endorsed by the authors of either work. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or any other accessibility standard. Every page is built against an automated accessibility gate, and our target for the published editions is WCAG 2.2 Level AA. If something is unusable, please tell us.