Matrices Modeling Contexts
When things move between a few states (customers between two plans, days between sunny and rainy) at steady percent rates, a matrix tracks the whole system. This guide builds the transition matrix, predicts future states, finds the steady state, and looks back in time with the inverse.
Percent rates of moving between states form a transition matrix. Here each column lists where the members of one state go, so each column adds to 1. Multiplying the matrix by a state vector (how many are in each state now) predicts the next state; multiplying repeatedly predicts \(n\) steps ahead, \(T^n\vec x_0\). Repeated multiplication approaches a steady state, a distribution with \(T\vec s = \vec s\) that no longer changes. Multiplying by the inverse matrix predicts past states.
1Building a transition matrix
Each month, 80% of Plan A customers stay and 20% switch to Plan B; 90% of Plan B customers stay and 10% switch to Plan A. Write a matrix that updates the state vector \(\begin{bmatrix} A \\ B \end{bmatrix}\).
- 1Let column 1 describe where Plan A customers go (0.8 to A, 0.2 to B) and column 2 where Plan B customers go (0.1 to A, 0.9 to B).
- 2\(T = \begin{bmatrix} 0.8 & 0.1 \\ 0.2 & 0.9 \end{bmatrix}\). Each column adds to 1, since everyone goes somewhere.
- 3Row 1 then reads: next month’s A = 0.8(this month’s A) + 0.1(this month’s B).
If the columns are “from” states, the 20% who leave Plan A go in column 1, row 2. Putting it in row 1, column 2 describes people leaving Plan B instead. Check that each column adds to 1.
2Predicting the future
There are 600 Plan A and 400 Plan B customers now. Predict the next two months.
- 1Month 1: \(T\begin{bmatrix} 600 \\ 400 \end{bmatrix} = \begin{bmatrix} 480 + 40 \\ 120 + 360 \end{bmatrix} = \begin{bmatrix} 520 \\ 480 \end{bmatrix}\).
- 2Month 2: \(T\begin{bmatrix} 520 \\ 480 \end{bmatrix} = \begin{bmatrix} 416 + 48 \\ 104 + 432 \end{bmatrix} = \begin{bmatrix} 464 \\ 536 \end{bmatrix}\). In general, month \(n\) is \(T^n\vec x_0\).
“\(T\vec x_0 = \langle 520, 480\rangle\), so after one month the model predicts 520 Plan A customers and 480 Plan B customers.”
3The steady state
What distribution does not change from month to month?
- 1A steady state \(\vec s\) satisfies \(T\vec s = \vec s\). Row 1: \(0.8A + 0.1B = A\), so \(0.1B = 0.2A\) and \(B = 2A\).
- 2With 1000 customers in all, \(A + 2A = 1000\): \(A \approx 333.3\), \(B \approx 666.7\).
- 3Repeated multiplication agrees: after 10 months Plan A has about 340.9 and after 20 about 333.5 (Figure 2).
Each day, 70% of sunny days are followed by a sunny day and 40% of rainy days are followed by a sunny day. In the long run, what fraction of days are sunny?
- 1Columns are “from sunny” and “from rainy”: \(T = \begin{bmatrix} 0.7 & 0.4 \\ 0.3 & 0.6 \end{bmatrix}\).
- 2Steady state: \(0.7s + 0.4r = s\) gives \(0.4r = 0.3s\). With \(s + r = 1\): \(s = \frac47 \approx 0.571\), \(r = \frac37 \approx 0.429\).
At the steady state, people still switch every month: 20% of 333.3 leave Plan A, but 10% of 666.7 arrive. The flows balance, so the totals stay the same.
4Looking backward
What was the distribution one month before the 600 and 400?
- 1Undo one step with the inverse: \(\det T = 0.72 - 0.02 = 0.7\), \(T^{-1} = \frac{1}{0.7}\begin{bmatrix} 0.9 & -0.1 \\ -0.2 & 0.8 \end{bmatrix}\).
- 2\(T^{-1}\begin{bmatrix} 600 \\ 400 \end{bmatrix} = \frac{1}{0.7}\begin{bmatrix} 540 - 40 \\ -120 + 320 \end{bmatrix} \approx \begin{bmatrix} 714.3 \\ 285.7 \end{bmatrix}\).
- 3Check: \(T\) applied to those values returns 600 and 400.
Going back one step undoes \(T\), which takes \(T^{-1}\). Multiplying by \(T\) again only moves forward another month.
Quick reference
| Task | Computation |
|---|---|
| Next state | \(T\vec x\) |
| \(n\) steps ahead | \(T^n\vec x_0\) |
| Steady state | Solve \(T\vec s = \vec s\) with the total fixed |
| One step back | \(T^{-1}\vec x\) |
| Check the matrix | Each column (from-state) adds to 1 |