Unit 4 · Topic 4.14

Matrices Modeling Contexts

A transition matrix holds the chances of moving between states in one step, with "from" columns that add up to 1.

Practice 1: Procedural and Symbolic FluencyPractice 3: Communication and Reasoning

Beyond the exam. The AP® Precalculus exam does not test this unit. Many classes teach it, and it prepares you for calculus.

Part 1 · Hook

Why this matters

A city's bike-share system moves bikes between stations every day: most stay put, some are ridden across town. Knowing only the chances of each move, a matrix can predict how many bikes each station will have tomorrow, next week and in the long run, and even how many it had yesterday.

Part 2 · Before you start

What this builds on

Part 3 · Prerequisite check

Quick check before you start

1. What is [0.50.20.50.8][100200]\left[ \begin{matrix} 0.5 & 0.2 \\ 0.5 & 0.8 \end{matrix} \right]\left[ \begin{matrix} 100 \\ 200 \end{matrix} \right]?

  1. [90210]\left[ \begin{matrix} 90 \\ 210 \end{matrix} \right]
  2. [50160]\left[ \begin{matrix} 50 \\ 160 \end{matrix} \right]
  3. [120180]\left[ \begin{matrix} 120 \\ 180 \end{matrix} \right]
  4. [150150]\left[ \begin{matrix} 150 \\ 150 \end{matrix} \right]
Show the answer

Row 1: 0.5(100)+0.2(200)=900.5(100) + 0.2(200) = 90. Row 2: 0.5(100)+0.8(200)0.5(100) + 0.8(200)=210= 210.

  • Correct: [90210]\left[ \begin{matrix} 90 \\ 210 \end{matrix} \right]:
  • [50160]\left[ \begin{matrix} 50 \\ 160 \end{matrix} \right]:
  • [120180]\left[ \begin{matrix} 120 \\ 180 \end{matrix} \right]:
  • [150150]\left[ \begin{matrix} 150 \\ 150 \end{matrix} \right]:

2. If Av=wA\mathbf{v} = \mathbf{w} and det⁡A≠0\det A \ne 0, how do you find v\mathbf{v} from w\mathbf{w}?

  1. v=A−1w\mathbf{v} = A^{-1}\mathbf{w}
  2. v=Aw\mathbf{v} = A\mathbf{w}
  3. v=wA−1\mathbf{v} = \mathbf{w}A^{-1}
  4. v=w−A\mathbf{v} = \mathbf{w} - A
Show the answer

Multiply both sides on the left by A−1A^{-1}: A−1Av=vA^{-1}A\mathbf{v} = \mathbf{v}.

  • Correct: v=A−1w\mathbf{v} = A^{-1}\mathbf{w}:
  • v=Aw\mathbf{v} = A\mathbf{w}:
  • v=wA−1\mathbf{v} = \mathbf{w}A^{-1}:
  • v=w−A\mathbf{v} = \mathbf{w} - A:

Part 4 · See it

See it first

Two circles, Station A and Station B. A loop on A is labeled 0.8 and an arrow from A to B is labeled 0.2; an arrow from B to A is labeled 0.3 and a loop on B is labeled 0.7. Each day a bike at A stays with chance 0.8 or moves to B with chance 0.2, and a bike at B moves to A with chance 0.3 or stays with chance 0.7.
Each arrow is a daily chance. As a transition matrix with "from" columns and "to" rows: [0.80.30.20.7]\left[ \begin{matrix} 0.8 & 0.3 \\ 0.2 & 0.7 \end{matrix} \right]. LevlPrep original diagram.

Part 5 · Step by step

How it works, step by step

  1. List the chance of moving from each state (column) to each state (row)the transition matrix TT; each column adds up to 11
  2. Multiply the current state vector by TTthe expected state one step later: xn+1=Txn\mathbf{x}_{n+1} = T\mathbf{x}_n
  3. Multiply by TT again and againxn=Tnx0\mathbf{x}_n = T^n\mathbf{x}_0, the prediction nn steps ahead
  4. Multiply by T−1T^{-1} insteadthe state one step earlier, as long as TT has an inverse

Part 6 · Key ideas

Key ideas

  • A transition matrix TT: the entry in row ii, column jj is the chance of moving from state jj to state ii in one step. Each column adds up to 11.
  • A state vector lists how many (or what share) are in each state. One step later: xn+1=Txn\mathbf{x}_{n+1} = T\mathbf{x}_n; after nn steps: xn=Tnx0\mathbf{x}_n = T^n\mathbf{x}_0.
  • One step earlier: xn−1=T−1xn\mathbf{x}_{n-1} = T^{-1}\mathbf{x}_n.
  • A steady state satisfies Tx=xT\mathbf{x} = \mathbf{x}. Over many steps the state vector usually settles toward it.

Part 7 · Misconception

A common mistake

The wrong idea: The first row of the bike matrix, 0.80.8 and 0.30.3, lists what happens to the bikes at station A.

What actually happens: With this setup the columns are "from" and the rows are "to". Column 1, 0.80.8 and 0.20.2, is what happens to bikes at A; row 1 collects every bike that ends at A. Always check which way your matrix is set up: each column adds up to 1 here.

Part 8 · Check yourself

Check yourself

Exam-style questions. Anything you miss goes into your review queue.

Diagram

A two-station bike share

A bike-share system has 500500 bikes. Today 400400 are at station A and 100100 at station B. The diagram shows the chance that a bike moves or stays each day.

Two circles, Station A and Station B. A loop on A is labeled 0.8 and an arrow from A to B is labeled 0.2; an arrow from B to A is labeled 0.3 and a loop on B is labeled 0.7. Each day a bike at A stays with chance 0.8 or moves to B with chance 0.2, and a bike at B moves to A with chance 0.3 or stays with chance 0.7.
LevlPrep original diagram.

1. Which transition matrix, with "from" columns (A, B) and "to" rows (A, B), models one day?

  1. [0.80.30.20.7]\left[ \begin{matrix} 0.8 & 0.3 \\ 0.2 & 0.7 \end{matrix} \right]
  2. [0.80.20.30.7]\left[ \begin{matrix} 0.8 & 0.2 \\ 0.3 & 0.7 \end{matrix} \right]
  3. [0.80.20.70.3]\left[ \begin{matrix} 0.8 & 0.2 \\ 0.7 & 0.3 \end{matrix} \right]
  4. [0.20.70.80.3]\left[ \begin{matrix} 0.2 & 0.7 \\ 0.8 & 0.3 \end{matrix} \right]
Show the answer

Column 1 is a bike at A: stays 0.80.8, goes to B 0.20.2. Column 2 is a bike at B: goes to A 0.30.3, stays 0.70.7. Each column adds up to 11.

  • Correct: [0.80.30.20.7]\left[ \begin{matrix} 0.8 & 0.3 \\ 0.2 & 0.7 \end{matrix} \right]: Columns (0.8,0.2)(0.8, 0.2) and (0.3,0.7)(0.3, 0.7).
  • [0.80.20.30.7]\left[ \begin{matrix} 0.8 & 0.2 \\ 0.3 & 0.7 \end{matrix} \right]: This puts "from" in the rows; its columns add up to 1.11.1 and 0.90.9.
  • [0.80.20.70.3]\left[ \begin{matrix} 0.8 & 0.2 \\ 0.7 & 0.3 \end{matrix} \right]: The chances for B are reversed: a bike at B stays with chance 0.70.7.
  • [0.20.70.80.3]\left[ \begin{matrix} 0.2 & 0.7 \\ 0.8 & 0.3 \end{matrix} \right]: The stay and move chances are swapped.

2. How many bikes are expected at station A after one day?

No calculator. Type the exact value (a fraction, π, e or a root is fine), in bikes.

Show the answer

Row 1 of TT times [400100]\left[ \begin{matrix} 400 \\ 100 \end{matrix} \right]: 0.8(400)0.8(400)+0.3(100)+ 0.3(100)=320= 320+30+ 30=350= 350.

  • Answer: 350 bikes

3. How many bikes are expected at station A after two days?

No calculator. Type the exact value (a fraction, π, e or a root is fine), in bikes.

Show the answer

x1=[350150]\mathbf{x}_1 = \left[ \begin{matrix} 350 \\ 150 \end{matrix} \right], so after two days A has 0.8(350)0.8(350)+0.3(150)+ 0.3(150)=280= 280+45+ 45=325= 325 bikes.

  • Answer: 325 bikes

4. In the long run, how many bikes are expected at station A?

No calculator. Type the exact value (a fraction, π, e or a root is fine), in bikes.

Show the answer

At a steady state 0.2a=0.3b0.2a = 0.3b, so a=1.5ba = 1.5b; with a+b=500a + b = 500, b=200b = 200 and a=300a = 300. Check: 0.8(300)+0.3(200)0.8(300) + 0.3(200)=300= 300.

  • Answer: 300 bikes

5. Why does each column of a transition matrix (with "from" columns) add up to 1?

  1. Everything in a state ends the step in some state
  2. Each row lists the states something can come from
  3. The matrix has an inverse
  4. The state vector has two entries
Show the answer

A column lists the chances for one starting state across every possible ending state, and something must end somewhere.

  • Correct: Everything in a state ends the step in some state: The chances for one starting state cover every outcome.
  • Each row lists the states something can come from: Rows collect arrivals; their sums can be anything.
  • The matrix has an inverse: Columns adding up to 1 does not make a matrix invertible.
  • The state vector has two entries: The number of entries does not set the sum.

6. Which could be a transition matrix with "from" columns?

  1. [0.60.10.40.9]\left[ \begin{matrix} 0.6 & 0.1 \\ 0.4 & 0.9 \end{matrix} \right]
  2. [0.60.40.60.4]\left[ \begin{matrix} 0.6 & 0.4 \\ 0.6 & 0.4 \end{matrix} \right]
  3. [0.51.20.5−0.2]\left[ \begin{matrix} 0.5 & 1.2 \\ 0.5 & -0.2 \end{matrix} \right]
  4. [0.30.30.30.3]\left[ \begin{matrix} 0.3 & 0.3 \\ 0.3 & 0.3 \end{matrix} \right]
Show the answer

Entries between 00 and 11, and each column adds up to 11: 0.6+0.40.6 + 0.4 and 0.1+0.90.1 + 0.9.

  • Correct: [0.60.10.40.9]\left[ \begin{matrix} 0.6 & 0.1 \\ 0.4 & 0.9 \end{matrix} \right]: Valid chances, columns add up to 11.
  • [0.60.40.60.4]\left[ \begin{matrix} 0.6 & 0.4 \\ 0.6 & 0.4 \end{matrix} \right]: Its columns add up to 1.21.2 and 0.80.8.
  • [0.51.20.5−0.2]\left[ \begin{matrix} 0.5 & 1.2 \\ 0.5 & -0.2 \end{matrix} \right]: A chance cannot be 1.21.2 or −0.2-0.2.
  • [0.30.30.30.3]\left[ \begin{matrix} 0.3 & 0.3 \\ 0.3 & 0.3 \end{matrix} \right]: Its columns add up to 0.60.6.

Part 9 · Summary

Summary

A transition matrix holds the chances of moving between states in one step, with "from" columns that add up to 1. Multiplying a state vector by TT moves it one step forward, TnT^n moves it nn steps, T−1T^{-1} moves it one step back, and a steady state is a vector that TT leaves unchanged.

Part 10 · Up next

What comes next

This is the last topic in the course.

Part 11 · Connections

Connections