Axiom Learning·AP Precalculus

Chapter 12: Matrices

矩阵 — Operations, Transformations, and Markov Chains

本章概览
矩阵(matrix)是将数字排列成行和列的表格,是线性代数的基础工具。矩阵可以表示数据、描述几何变换(旋转、缩放),甚至建模随机过程(马尔可夫链)。本章将学习矩阵的基本运算、行列式、逆矩阵、线性变换,以及马尔可夫链。
本章在考纲中的位置 Where this chapter fits
本章对应 CED Unit 4 · Topics 4.10–4.14(Matrices, Linear Transformations, Matrix Models)。Unit 4 是 "Additional Topic Available to Schools":不在 AP Precalculus 考试范围内(Not assessed on the AP Exam),由学校决定是否讲授。考纲只要求 $2\times2$ 矩阵和 $\mathbb{R}^2$ 中的变换;本章个别例题用到更大的矩阵,作为拓展。
Term 术语Chinese 中文Meaning
Matrix矩阵Rectangular array of numbers, order $m\times n$
Entry $a_{ij}$元素Number in row $i$, column $j$
Square matrix方阵Same number of rows and columns
Identity matrix $I$单位矩阵Square matrix with 1s on diagonal, 0s elsewhere
Determinant行列式$\det(A)=ad-bc$ for $2\times2$; scalar value
Inverse matrix $A^{-1}$逆矩阵$AA^{-1}=A^{-1}A=I$; exists iff $\det(A)\ne0$
Linear transformation线性变换Map $T(\vec{x})=A\vec{x}$; outputs are linear combos of inputs
Standard matrix标准矩阵Matrix whose columns are images of standard unit vectors
Rotation operator旋转算子Matrix that rotates vectors by angle $\theta$
Area scale factor面积缩放因子$|\det(A)|$; how much areas grow/shrink under $T$
Markov chain马尔可夫链System where next state depends only on current state
Transition matrix转移矩阵$P$; columns sum to 1; $\vec{x}_{n+1}=P\vec{x}_n$
Steady state稳态$P\vec{q}=\vec{q}$; distribution that doesn't change

12.1 Matrix Basics 矩阵基础

A matrix(矩阵)is a rectangular array of numbers arranged in rows and columns. A general $m\times n$ matrix has $m$ rows and $n$ columns: $$A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix}$$ The entry $a_{ij}$ is in row $i$, column $j$. The order(阶)of the matrix is $m\times n$.
Common Types 常见类型
  • Row matrix(行矩阵): $1\times n$, e.g. $\begin{bmatrix}10 & 18 & 26\end{bmatrix}$
  • Column matrix(列矩阵): $m\times1$, e.g. $\begin{bmatrix}3\\8\\4\end{bmatrix}$
  • Square matrix(方阵): $n\times n$, e.g. $\begin{bmatrix}1&2\\3&4\end{bmatrix}$
Matrix Equality 相等矩阵: Two matrices are equal iff they have the same order AND every corresponding entry is equal.

12.2 Matrix Addition and Subtraction 矩阵加减法

Matrices can be added or subtracted only when they have the same order(相同阶): $$A + B = \begin{bmatrix}a_{11}+b_{11} & a_{12}+b_{12} \\ a_{21}+b_{21} & a_{22}+b_{22}\end{bmatrix}$$ Subtraction works the same way entry-by-entry.
🤝 一起做 Together  T-1  — Matrix Addition and Subtraction

Let $A=\begin{bmatrix}2&-1\\4&3\end{bmatrix}$, $B=\begin{bmatrix}0&3\\-5&2\end{bmatrix}$, $C=\begin{bmatrix}6&1\\4&7\end{bmatrix}$. Find $A+B$ and $C-A$.

$A+B$: add corresponding entries.
$$A+B=\begin{bmatrix}2+0 & -1+3\\ 4+(-5) & 3+2\end{bmatrix}=\begin{bmatrix}2&2\\-1&5\end{bmatrix}$$
$C-A$: subtract corresponding entries.
$$C-A=\begin{bmatrix}6-2&1-(-1)\\4-4&7-3\end{bmatrix}=\begin{bmatrix}4&2\\0&4\end{bmatrix}$$
$A+B=\begin{bmatrix}2&2\\-1&5\end{bmatrix}$; $\quad C-A=\begin{bmatrix}4&2\\0&4\end{bmatrix}$

12.3 Matrix Multiplication 矩阵乘法

To multiply $A\times B$, the number of columns of $A$ must equal the number of rows of $B$: $$A_{m\times k} \cdot B_{k\times n} = C_{m\times n}$$ Each entry $c_{ij}$ = dot product of row $i$ of $A$ with column $j$ of $B$: $$c_{ij} = \sum_{\ell=1}^k a_{i\ell}\,b_{\ell j}$$
$m\times k$
$A$
×
$k\times n$
$B$
=
$m\times n$
$C$
Inner dimensions must match!
⚠ 矩阵乘法不满足交换律
一般来说,$AB \neq BA$。矩阵乘法的顺序至关重要!先乘 $A$ 再乘 $B$,与先乘 $B$ 再乘 $A$ 结果通常不同。
🤝 一起做 Together  T-2  — Matrix Multiplication

Let $A=\begin{bmatrix}1&2&1\\0&3&4\end{bmatrix}$ ($2\times3$), $B=\begin{bmatrix}2&1\\5&0\\1&-3\end{bmatrix}$ ($3\times2$). Find $AB$.

Dimension check.
$A$ is $2\times3$, $B$ is $3\times2$ → inner dims both $3$ ✓ → result is $2\times2$.
Compute each entry (row of $A$) · (column of $B$).
$c_{11}$: Row 1 of $A$ · Col 1 of $B$ $= 1(2)+2(5)+1(1)=2+10+1=13$
$c_{12}$: Row 1 of $A$ · Col 2 of $B$ $= 1(1)+2(0)+1(-3)=1+0-3=-2$
$c_{21}$: Row 2 of $A$ · Col 1 of $B$ $= 0(2)+3(5)+4(1)=0+15+4=19$
$c_{22}$: Row 2 of $A$ · Col 2 of $B$ $= 0(1)+3(0)+4(-3)=0+0-12=-12$
$AB=\begin{bmatrix}13&-2\\19&-12\end{bmatrix}$
📝 练习 E-1 — Matrix Multiplication

Let $A=\begin{bmatrix}3&1\\-2&4\end{bmatrix}$, $B=\begin{bmatrix}1&0\\2&-1\end{bmatrix}$. Find $AB$ and $BA$. Are they equal?

$AB=\begin{bmatrix}3(1)+1(2)&3(0)+1(-1)\\-2(1)+4(2)&-2(0)+4(-1)\end{bmatrix}=\begin{bmatrix}5&-1\\6&-4\end{bmatrix}$

$BA=\begin{bmatrix}1(3)+0(-2)&1(1)+0(4)\\2(3)+(-1)(-2)&2(1)+(-1)(4)\end{bmatrix}=\begin{bmatrix}3&1\\8&-2\end{bmatrix}$

$AB\neq BA$ — confirms matrix multiplication is not commutative.

12.4 Identity Matrix 单位矩阵

The identity matrix(单位矩阵)$I_n$ is an $n\times n$ square matrix with $1$s on the main diagonal and $0$s elsewhere: $$I_2=\begin{bmatrix}1&0\\0&1\end{bmatrix}, \qquad I_3=\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}$$ For any square matrix $A$: $\quad AI = IA = A$.   (Works like the number $1$ in multiplication.)
单位矩阵的作用
单位矩阵 $I$ 是矩阵乘法中的"乘法单位元",就像数字中的 $1$:任何矩阵乘以 $I$ 都等于它本身。在求逆矩阵时,$AA^{-1}=I$ 是核心关系。

12.5 Inverse Matrix and Determinant 逆矩阵与行列式

Determinant of a $2\times2$ matrix 行列式: $$\det\begin{bmatrix}a&b\\c&d\end{bmatrix} = ad-bc$$ A matrix is invertible(可逆)iff $\det(A)\neq0$.
Inverse Formula 逆矩阵公式 (for $2\times2$ only): $$A^{-1} = \frac{1}{\det(A)}\begin{bmatrix}d&-b\\-c&a\end{bmatrix} \quad \text{when } \det(A)\neq0$$ Recipe: swap diagonal entries, negate off-diagonal, divide by determinant.
逆矩阵口诀
对于 $2\times2$ 矩阵 $\begin{bmatrix}a&b\\c&d\end{bmatrix}$:
① 对角线元素 $a,d$ 互换位置;② 副对角线元素 $b,c$ 取相反数;③ 整体除以行列式 $ad-bc$。
验证:$AA^{-1}=I$。
🤝 一起做 Together  T-3  — Finding the Inverse of a Matrix

Find the inverse of $A=\begin{bmatrix}3&-2\\-1&1\end{bmatrix}$.

Step 1 — Compute $\det(A)$.
$\det(A)=3(1)-(-2)(-1)=3-2=1$
Since $\det(A)=1\neq0$, the inverse exists.
Step 2 — Apply inverse formula.
$$A^{-1}=\frac{1}{1}\begin{bmatrix}1&2\\1&3\end{bmatrix}=\begin{bmatrix}1&2\\1&3\end{bmatrix}$$
Verify: $AA^{-1}=I$.
$\begin{bmatrix}3&-2\\-1&1\end{bmatrix}\begin{bmatrix}1&2\\1&3\end{bmatrix}=\begin{bmatrix}3-2&6-6\\-1+1&-2+3\end{bmatrix}=\begin{bmatrix}1&0\\0&1\end{bmatrix}=I$ ✓
$A^{-1}=\begin{bmatrix}1&2\\1&3\end{bmatrix}$
📝 练习 E-2 — Determinant and Inverse

(a) Find $\det\begin{bmatrix}5&3\\2&4\end{bmatrix}$ and state whether it is invertible.
(b) If invertible, find its inverse.

(a) $\det=5(4)-3(2)=20-6=14\neq0$ → invertible ✓
(b) $A^{-1}=\dfrac{1}{14}\begin{bmatrix}4&-3\\-2&5\end{bmatrix}=\begin{bmatrix}2/7&-3/14\\-1/7&5/14\end{bmatrix}$
TI-84 · Matrices 矩阵运算
  1. 2nd x⁻¹ (MATRIX) → EDIT → 1:[A]. Enter the size (e.g. 2 × 2), then the entries.
  2. On the home screen, paste the matrix with 2nd x⁻¹ → NAMES → 1:[A].
  3. Inverse: [A] x⁻¹ ENTER. For fractions: MATH → 1:▶Frac.
  4. Determinant: 2nd x⁻¹ → MATH → 1:det( → [A] ) ENTER.
  5. Products and powers: [A]*[B]; [A]^10 gives $A^{10}$ (useful for Markov chains in 12.12).
If $\det(A)=0$, asking for $A^{-1}$ gives an ERR: SINGULAR MAT error: the matrix has no inverse.

12.6 Determinants and Area 行列式与面积

Given two vectors $\vec{u}=\langle u_1,u_2\rangle$ and $\vec{v}=\langle v_1,v_2\rangle$, form the matrix with these as columns: $$M = \begin{bmatrix}u_1 & v_1\\ u_2 & v_2\end{bmatrix}$$ Area of the parallelogram(平行四边形面积)formed by $\vec{u}$ and $\vec{v}$: $$\text{Area} = |\det(M)| = |u_1v_2 - u_2v_1|$$ If $\det(M)=0$, the vectors are parallel and the area is $0$.
🤝 一起做 Together  T-4  — Parallelogram Area via Determinant

Use determinants to find the area of the parallelogram with vertices $(0,0)$, $(7,2)$, $(12,11)$, $(5,9)$.

Identify the two edge vectors from the origin.
$\vec{u}=\langle7,2\rangle$ (to $(7,2)$) and $\vec{v}=\langle5,9\rangle$ (to $(5,9)$).
Form matrix and compute determinant.
$M=\begin{bmatrix}7&5\\2&9\end{bmatrix}$; $\quad\det(M)=7(9)-5(2)=63-10=53$
Area $=|\det(M)|=53$.
Verify: $(7,2)+(5,9)=(12,11)$ ✓ — this is the fourth vertex.
2 4 6 8 10 12 2 4 6 8 10 12 x y u = ⟨7, 2⟩ v = ⟨5, 9⟩ (12, 11) Area = 53
Area $= 53$ square units

12.7 Linear Transformations 线性变换

A linear transformation(线性变换)$T:\mathbb{R}^n\to\mathbb{R}^m$ maps input vectors to output vectors where each output component is a linear combination of input components.

It can be written as matrix multiplication: $T(\vec{x})=A\vec{x}$, where $A$ is an $m\times n$ matrix.
What is linear? 什么是线性?
  • $(x,y)\mapsto(2x+y,\;3x-y)$ ✓ linear
  • $(x,y)\mapsto(x^2,\;y)$ ✗ NOT linear (has $x^2$)
  • $(x,y)\mapsto(xy,\;y)$ ✗ NOT linear (variables multiplied)
  • $(x,y)\mapsto(x+1,\;y)$ ✗ NOT linear (constant term: $(0,0)\mapsto(1,0)$)
Quick test 快速检验: a linear transformation always maps the zero vector to the zero vector, $T(\vec 0)=\vec 0$. If $T(\vec 0)\neq\vec 0$, it is not linear. (Passing this test alone does not prove linearity: $(x^2,y)$ also sends $\vec 0$ to $\vec 0$.)
🤝 一起做 Together  T-5  — Applying a Linear Transformation

Let $T:\mathbb{R}^3\to\mathbb{R}^2$ be defined by $T(x,y,z)=(x-y,\;2x+y+3z)$. Find the image of $\vec{v}=\begin{bmatrix}1\\3\\-2\end{bmatrix}$.

Write the standard matrix $A$.
Each output component is read off as a row:
$x-y+0z \Rightarrow$ row 1: $[1,\,-1,\,0]$
$2x+y+3z \Rightarrow$ row 2: $[2,\,1,\,3]$
$$A=\begin{bmatrix}1&-1&0\\2&1&3\end{bmatrix}$$
Compute $A\vec{v}$.
$$A\vec{v}=\begin{bmatrix}1(1)+(-1)(3)+0(-2)\\2(1)+1(3)+3(-2)\end{bmatrix}=\begin{bmatrix}1-3+0\\2+3-6\end{bmatrix}=\begin{bmatrix}-2\\-1\end{bmatrix}$$
$T\!\left(\begin{bmatrix}1\\3\\-2\end{bmatrix}\right)=\begin{bmatrix}-2\\-1\end{bmatrix}$

Transforming Several Vectors at Once 一次变换多个向量

A vector in $\mathbb{R}^2$ can be written as a $2\times1$ matrix, and a set of $n$ vectors as a $2\times n$ matrix $V$ (one vector per column). For a $2\times2$ transformation matrix $A$, the product $AV$ is a $2\times n$ matrix whose columns are the $n$ output vectors.
🤝 一起做 Together  T-6  — Transforming a Triangle 变换三角形

Triangle $PQR$ has vertices $P(1,1)$, $Q(4,1)$, $R(1,3)$. Use one matrix product to find the image of the triangle under $T(\vec v)=A\vec v$ with $A=\begin{bmatrix}1&2\\0&1\end{bmatrix}$. Compare the areas.

Vertices as columns. $V=\begin{bmatrix}1&4&1\\1&1&3\end{bmatrix}$ ($2\times3$)
One product. $$AV=\begin{bmatrix}1&2\\0&1\end{bmatrix}\begin{bmatrix}1&4&1\\1&1&3\end{bmatrix}=\begin{bmatrix}3&6&7\\1&1&3\end{bmatrix}$$ So $P'(3,1)$, $Q'(6,1)$, $R'(7,3)$. Each point slides right by twice its $y$-coordinate (a shear, 错切).
Areas. Original: $\frac12(3)(2)=3$. Image: base $P'Q'=3$, height $2$, area $3$. Same, because $|\det A|=|1-0|=1$ (see 12.10).
1 2 3 4 5 6 7 1 2 3 x y P Q R P′ Q′ R′
Teal: original triangle; purple: its image.
$P'(3,1)$, $Q'(6,1)$, $R'(7,3)$; both areas are $3$.

12.8 Standard Matrix 标准矩阵

The standard matrix(标准矩阵)of a linear transformation $T:\mathbb{R}^n\to\mathbb{R}^m$ is the matrix whose columns are the images of the standard unit vectors: $$A = \bigl[T(\mathbf{e}_1)\;\big|\;T(\mathbf{e}_2)\;\big|\;\cdots\;\big|\;T(\mathbf{e}_n)\bigr]$$ where $\mathbf{e}_1=\langle1,0,\ldots\rangle$, $\mathbf{e}_2=\langle0,1,0,\ldots\rangle$, etc.
快速找标准矩阵的方法
把每个输出分量写成输入变量的线性组合,然后把各系数排成一行,得到矩阵的每一行。或者:把 $T(\mathbf{e}_1),T(\mathbf{e}_2),\ldots$ 的结果依次排成列。
🤝 一起做 Together  T-7  — Finding the Standard Matrix

Find the matrix $A$ associated with $T(x,y)=(2x+y,\;-x,\;3y)$, where $T:\mathbb{R}^2\to\mathbb{R}^3$.

Find $T(\mathbf{e}_1)=T(1,0)$ and $T(\mathbf{e}_2)=T(0,1)$.
$T(1,0)=(2,\,-1,\,0)$
$T(0,1)=(1,\,0,\,3)$
Form matrix with these as columns.
$$A=\begin{bmatrix}2&1\\-1&0\\0&3\end{bmatrix}$$
Verify: $A\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}2x+y\\-x\\3y\end{bmatrix}$ ✓
$A=\begin{bmatrix}2&1\\-1&0\\0&3\end{bmatrix}$

12.9 Rotation Operators 旋转算子

A rotation operator(旋转算子)rotates vectors in $\mathbb{R}^2$ counterclockwise by angle $\theta$: $$R_\theta = \begin{bmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{bmatrix}$$ The rotated image of $\vec{v}$ is $R_\theta\vec{v}$.
旋转矩阵的推导
旋转矩阵的列是标准基向量旋转后的结果: $R_\theta\mathbf{e}_1=\langle\cos\theta,\sin\theta\rangle$(第一列),$R_\theta\mathbf{e}_2=\langle-\sin\theta,\cos\theta\rangle$(第二列)。 常用旋转:$90°:\begin{bmatrix}0&-1\\1&0\end{bmatrix}$;$180°:\begin{bmatrix}-1&0\\0&-1\end{bmatrix}$。
🤝 一起做 Together  T-8  — Rotation by $\pi/2$

Find the image of $\vec{v}=\begin{bmatrix}1\\1\end{bmatrix}$ after rotating counterclockwise by $\dfrac{\pi}{2}$.

Write the rotation matrix for $\theta=\dfrac{\pi}{2}$.
$\cos\dfrac{\pi}{2}=0$, $\sin\dfrac{\pi}{2}=1$
$R_{\pi/2}=\begin{bmatrix}0&-1\\1&0\end{bmatrix}$
Multiply.
$R_{\pi/2}\vec{v}=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}0(1)+(-1)(1)\\1(1)+0(1)\end{bmatrix}=\begin{bmatrix}-1\\1\end{bmatrix}$
−1 1 1 x y ⟨1, 1⟩ ⟨−1, 1⟩ 90°
Image: $\begin{bmatrix}-1\\1\end{bmatrix}$. (The vector rotated $90°$ counterclockwise from $(1,1)$ to $(-1,1)$.)
📝 练习 E-3 — Rotation

Rotate the vector $\vec{v}=\begin{bmatrix}3\\0\end{bmatrix}$ counterclockwise by $\dfrac{\pi}{6}$. Give exact values.

$R_{\pi/6}=\begin{bmatrix}\cos(\pi/6)&-\sin(\pi/6)\\\sin(\pi/6)&\cos(\pi/6)\end{bmatrix}=\begin{bmatrix}\sqrt{3}/2&-1/2\\1/2&\sqrt{3}/2\end{bmatrix}$
$R_{\pi/6}\begin{bmatrix}3\\0\end{bmatrix}=\begin{bmatrix}3\sqrt{3}/2\\3/2\end{bmatrix}$

Reflections and Dilations from Unit Vectors 由单位向量写出反射与伸缩

To find the matrix of a transformation described in words, ask where $\mathbf e_1=\langle1,0\rangle$ and $\mathbf e_2=\langle0,1\rangle$ go; those images are the two columns.
Transformation 变换$T(\mathbf e_1)$$T(\mathbf e_2)$Matrix$\det$
Reflect over the $x$-axis$\langle1,0\rangle$$\langle0,-1\rangle$$\begin{bmatrix}1&0\\0&-1\end{bmatrix}$$-1$
Reflect over the $y$-axis$\langle-1,0\rangle$$\langle0,1\rangle$$\begin{bmatrix}-1&0\\0&1\end{bmatrix}$$-1$
Reflect over $y=x$$\langle0,1\rangle$$\langle1,0\rangle$$\begin{bmatrix}0&1\\1&0\end{bmatrix}$$-1$
Dilate by factor $k$$\langle k,0\rangle$$\langle0,k\rangle$$\begin{bmatrix}k&0\\0&k\end{bmatrix}$$k^2$
Stretch: horizontal $a$, vertical $b$$\langle a,0\rangle$$\langle0,b\rangle$$\begin{bmatrix}a&0\\0&b\end{bmatrix}$$ab$
Reflections and rotations have $|\det|=1$: they keep areas the same.

12.10 Dilations and Area Scaling 缩放与面积变化

For a $2\times2$ matrix transformation $T(\vec{x})=A\vec{x}$: $$\text{Area scale factor} = |\det(A)|$$
  • $|\det(A)|>1$: areas are enlarged(放大)
  • $|\det(A)|=1$: areas are preserved(面积不变), e.g. every rotation: $\det R_\theta=\cos^2\theta+\sin^2\theta=1$
  • $0<|\det(A)|<1$: areas are shrunk(缩小)
  • $\det(A)=0$: regions collapse to a line or point(坍缩为直线或点)
🤝 一起做 Together  T-9  — Area Scale Factor

Given $A=\begin{bmatrix}1&1\\-1&3\end{bmatrix}$, find the area scale factor of the transformation $T(\vec{x})=A\vec{x}$.

Compute $\det(A)$.
$\det(A)=1(3)-(1)(-1)=3+1=4$
Area scale factor $= |\det(A)| = 4$.
Every region in $\mathbb{R}^2$ is enlarged by a factor of $4$ under this transformation.
Area scale factor $= 4$ (areas are quadrupled).
🤝 一起做 Together  T-10  — Seeing the Area Scale Factor 看见面积缩放

Use the matrix $A=\begin{bmatrix}1&1\\-1&3\end{bmatrix}$ from T-9. Find the image of the unit square with vertices $(0,0)$, $(1,0)$, $(1,1)$, $(0,1)$, and check that its area is $|\det A|$ times the original area.

All four vertices at once. $$A\begin{bmatrix}0&1&1&0\\0&0&1&1\end{bmatrix}=\begin{bmatrix}0&1&2&1\\0&-1&2&3\end{bmatrix}$$ Image vertices: $(0,0)$, $(1,-1)$, $(2,2)$, $(1,3)$: a parallelogram spanned by the columns of $A$, $\langle1,-1\rangle$ and $\langle1,3\rangle$.
Area. Parallelogram area $=\left|\det\begin{bmatrix}1&1\\-1&3\end{bmatrix}\right|=|3-(-1)|=4$. The unit square had area $1$, so areas are multiplied by $4=|\det A|$ ✓
1 2 −1 1 2 3 x y area 1 area 4 (1, −1) (2, 2) (1, 3)
Teal: the unit square (area 1); purple: its image (area 4).
Image: parallelogram with vertices $(0,0),(1,-1),(2,2),(1,3)$; area $4=|\det A|\times1$.

12.11 Composition of Linear Transformations 线性变换的复合

If $T(\vec{x})=A\vec{x}$ and $S(\vec{x})=B\vec{x}$, then the composition "apply $T$ first, then $S$" is: $$(S\circ T)(\vec{x}) = S(T(\vec{x})) = BA\vec{x}$$ The matrix for $S\circ T$ is $BA$ (not $AB$!) — order matters.
复合顺序 — 从右向左读
$S\circ T$ 表示"先做 $T$,再做 $S$"。对应矩阵从右到左写:先 $A$(做$T$),再 $B$(做$S$),矩阵乘积是 $BA$。
🤝 一起做 Together  T-11  — Composition as Matrix Product

Let $T(x,y)=(x+y,\;2x)$ and $S(x,y)=(3x,\;-x+y)$. Express $S\circ T$ as a matrix transformation.

Find matrices $A$ (for $T$) and $B$ (for $S$).
$T(x,y)=\begin{bmatrix}1&1\\2&0\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}$, so $A=\begin{bmatrix}1&1\\2&0\end{bmatrix}$
$S(x,y)=\begin{bmatrix}3&0\\-1&1\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}$, so $B=\begin{bmatrix}3&0\\-1&1\end{bmatrix}$
Matrix for $S\circ T$ is $BA$.
$$BA=\begin{bmatrix}3&0\\-1&1\end{bmatrix}\begin{bmatrix}1&1\\2&0\end{bmatrix}=\begin{bmatrix}3&3\\1&-1\end{bmatrix}$$
$(S\circ T)(\vec{x})=\begin{bmatrix}3&3\\1&-1\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}$, i.e. $(S\circ T)(x,y)=(3x+3y,\;x-y)$.
🤝 一起做 Together  T-12  — Rotate, then Reflect 先旋转再反射

(a) Find the single matrix that rotates every vector $90°$ counterclockwise and then reflects it over the $x$-axis.  (b) Find the matrix for the opposite order (reflect first, then rotate).  (c) Apply both to $\langle2,1\rangle$.

The two matrices. Rotation $R=\begin{bmatrix}0&-1\\1&0\end{bmatrix}$; reflection over the $x$-axis $F=\begin{bmatrix}1&0\\0&-1\end{bmatrix}$.
(a) Rotate first → $R$ on the right. $$FR=\begin{bmatrix}1&0\\0&-1\end{bmatrix}\begin{bmatrix}0&-1\\1&0\end{bmatrix}=\begin{bmatrix}0&-1\\-1&0\end{bmatrix}$$ This sends $(x,y)\mapsto(-y,-x)$: a reflection over the line $y=-x$.
(b) Reflect first → $F$ on the right. $$RF=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}1&0\\0&-1\end{bmatrix}=\begin{bmatrix}0&1\\1&0\end{bmatrix}$$ This is the reflection over $y=x$. Different order, different transformation.
(c) Check with $\langle2,1\rangle$. (a) Rotate: $\langle-1,2\rangle$; reflect: $\langle-1,-2\rangle$; and $FR\langle2,1\rangle=\langle-1,-2\rangle$ ✓.  (b) Reflect: $\langle2,-1\rangle$; rotate: $\langle1,2\rangle$; and $RF\langle2,1\rangle=\langle1,2\rangle$ ✓
(a) $\begin{bmatrix}0&-1\\-1&0\end{bmatrix}$ (reflection over $y=-x$)  (b) $\begin{bmatrix}0&1\\1&0\end{bmatrix}$ (reflection over $y=x$)  (c) $\langle-1,-2\rangle$ and $\langle1,2\rangle$
📝 练习 E-4 — Inverse of a Linear Transformation

$T:\mathbb{R}^2\to\mathbb{R}^2$ is defined by $x_1=2x+y$, $x_2=3x+4y$. Show it is one-to-one and find $T^{-1}(x_1,x_2)$.

$A=\begin{bmatrix}2&1\\3&4\end{bmatrix}$; $\det(A)=8-3=5\neq0$ → invertible → one-to-one ✓
$A^{-1}=\dfrac{1}{5}\begin{bmatrix}4&-1\\-3&2\end{bmatrix}$
$T^{-1}(x_1,x_2)=\dfrac{1}{5}(4x_1-x_2,\;-3x_1+2x_2)$
Inverse transformations 逆变换: $L$ and $L^{-1}$ are inverses when their composition maps every vector to itself. If $L(\vec v)=A\vec v$, then $L^{-1}(\vec v)=A^{-1}\vec v$, since $A^{-1}A=I$.
Example: undoing a rotation by $\theta$ is a rotation by $-\theta$: $\;R_\theta^{-1}=R_{-\theta}=\begin{bmatrix}\cos\theta&\sin\theta\\-\sin\theta&\cos\theta\end{bmatrix}$ (use the inverse formula with $\det R_\theta=1$).

12.12 Markov Chains 马尔可夫链

A Markov chain(马尔可夫链)models a system that moves among a finite number of states. Key property: the next state depends only on the current state — not on the full history.
Transition Matrix $P$ 转移矩阵
$p_{ij}$ = probability of moving from state $j$ to state $i$.
Each column sums to $1$.
State Vector $\vec{x}$ 状态向量
Lists the probability (or the number of people) in each state.
Probabilities sum to $1$; counts sum to the total.
Future States 预测未来状态: $$\vec{x}_{n+1} = P\vec{x}_n \qquad \Rightarrow \qquad \vec{x}_n = P^n\vec{x}_0$$ Past States 推算过去: since $\vec{x}_n=P\vec{x}_{n-1}$, multiply both sides by $P^{-1}$: $$\vec{x}_{n-1}=P^{-1}\vec{x}_n$$ Steady State 稳态: A vector $\vec{q}$ satisfying $P\vec{q}=\vec{q}$: a distribution that does not change from one step to the next. For transition matrices like the ones in this chapter (all entries positive), $P^n\vec{x}_0$ gets closer and closer to $\vec{q}$ as $n$ grows, so repeated multiplication with technology predicts the steady state.
稳态的求法
稳态向量 $\vec{q}$ 满足 $P\vec{q}=\vec{q}$,即 $(P-I)\vec{q}=\vec{0}$。结合"所有分量之和等于 $1$"的约束,联立方程组即可求解。对于 $2\times2$ 的转移矩阵,只需解一个含两个未知数的方程组。
🤝 一起做 Together  T-13  — Markov Chain: Predicting Future States

An alumni donation model has two states: State 1 (donates) and State 2 (does not donate). The transition matrix is $P=\begin{bmatrix}0.8&0.3\\0.2&0.7\end{bmatrix}$. A new graduate did not donate in the initial year. Find the probability they donate after 3 years.

题意理解
初始状态:不捐款 → $\vec{x}_0=\begin{bmatrix}0\\1\end{bmatrix}$(State 1 概率 $0$,State 2 概率 $1$)。
列 $j$ 表示从状态 $j$ 出发的转移概率:列 2 为 $\begin{bmatrix}0.3\\0.7\end{bmatrix}$(从不捐款出发,$30\%$ 变为捐款,$70\%$ 继续不捐款)。
Initial state vector.
$\vec{x}_0=\begin{bmatrix}0\\1\end{bmatrix}$
After 1 year: $\vec{x}_1=P\vec{x}_0$.
$\vec{x}_1=\begin{bmatrix}0.8&0.3\\0.2&0.7\end{bmatrix}\begin{bmatrix}0\\1\end{bmatrix}=\begin{bmatrix}0.3\\0.7\end{bmatrix}$
After 2 years: $\vec{x}_2=P\vec{x}_1$.
$\vec{x}_2=\begin{bmatrix}0.8&0.3\\0.2&0.7\end{bmatrix}\begin{bmatrix}0.3\\0.7\end{bmatrix}=\begin{bmatrix}0.24+0.21\\0.06+0.49\end{bmatrix}=\begin{bmatrix}0.45\\0.55\end{bmatrix}$
After 3 years: $\vec{x}_3=P\vec{x}_2$.
$\vec{x}_3=\begin{bmatrix}0.8&0.3\\0.2&0.7\end{bmatrix}\begin{bmatrix}0.45\\0.55\end{bmatrix}=\begin{bmatrix}0.36+0.165\\0.09+0.385\end{bmatrix}=\begin{bmatrix}0.525\\0.475\end{bmatrix}$
After 3 years, the probability of donating is $\approx\mathbf{52.5\%}$.
🤝 一起做 Together  T-14  — Finding the Steady State

Using the same transition matrix $P=\begin{bmatrix}0.8&0.3\\0.2&0.7\end{bmatrix}$, find the steady-state vector $\vec{q}$.

Set up $P\vec{q}=\vec{q}$.
Let $\vec{q}=\begin{bmatrix}q_1\\q_2\end{bmatrix}$. Then: $0.8q_1+0.3q_2=q_1 \;\Rightarrow\; -0.2q_1+0.3q_2=0$
Add constraint $q_1+q_2=1$.
From $-0.2q_1+0.3q_2=0$: $q_2=\dfrac{0.2}{0.3}q_1=\dfrac{2}{3}q_1$
Substitute: $q_1+\dfrac{2}{3}q_1=1\Rightarrow\dfrac{5}{3}q_1=1\Rightarrow q_1=\dfrac{3}{5}=0.6$
$q_2=1-0.6=0.4$
Verify $P\vec{q}=\vec{q}$.
$\begin{bmatrix}0.8&0.3\\0.2&0.7\end{bmatrix}\begin{bmatrix}0.6\\0.4\end{bmatrix}=\begin{bmatrix}0.48+0.12\\0.12+0.28\end{bmatrix}=\begin{bmatrix}0.6\\0.4\end{bmatrix}$ ✓
Steady state: $\vec{q}=\begin{bmatrix}0.6\\0.4\end{bmatrix}$ — in the long run, $60\%$ donate and $40\%$ do not.

Building a Model from a Context 由情境构造模型

Turn each percent into a decimal. Column $j$ describes where everyone currently in state $j$ goes, so each column sums to $1$. Rows are "to", columns are "from".
🤝 一起做 Together  T-15  — Building a Transition Matrix 构造转移矩阵

Each day, students choose pizza (P) or salad (S) for lunch. Of the students who choose pizza one day, $90\%$ choose pizza the next day and $10\%$ switch to salad. Of those who choose salad, $20\%$ switch to pizza and $80\%$ stay with salad. Today $310$ students chose pizza and $190$ chose salad.
(a) Write the transition matrix and today's state vector.  (b) Predict the next two days.  (c) Use repeated multiplication to predict the long-run distribution, and confirm it with $P\vec q=\vec q$.

(a) Columns = from P, from S; rows = to P, to S: $$P=\begin{bmatrix}0.9&0.2\\0.1&0.8\end{bmatrix},\qquad \vec x_0=\begin{bmatrix}310\\190\end{bmatrix}$$ Check: each column sums to $1$ ✓
(b) $\vec x_1=P\vec x_0=\begin{bmatrix}0.9(310)+0.2(190)\\0.1(310)+0.8(190)\end{bmatrix}=\begin{bmatrix}317\\183\end{bmatrix}$,   $\vec x_2=P\vec x_1=\begin{bmatrix}321.9\\178.1\end{bmatrix}\approx\begin{bmatrix}322\\178\end{bmatrix}$
(c) Repeated multiplication (calculator: [A]^n*[B]):
$n$$0$$1$$2$$5$$10$$20$$50$
pizza$310$$317$$321.9$$329.41$$332.67$$333.31$$333.33$
salad$190$$183$$178.1$$170.59$$167.33$$166.69$$166.67$
5 10 15 20 310 320 330 340 n pizza steady state ≈ 333.3
The pizza count levels off at about 333.
Confirm: $P\vec q=\vec q$ gives $0.9q_1+0.2q_2=q_1$, so $0.2q_2=0.1q_1$ and $q_1=2q_2$. With $q_1+q_2=500$: $q_1=333.\overline{3}$, $q_2=166.\overline{6}$ ✓
(a) $P=\begin{bmatrix}0.9&0.2\\0.1&0.8\end{bmatrix}$, $\vec x_0=\begin{bmatrix}310\\190\end{bmatrix}$  (b) $317$ and $183$; then about $322$ and $178$  (c) about $333$ pizza and $167$ salad in the long run

Past States with the Inverse 用逆矩阵推算过去

🤝 一起做 Together  T-16  — Going Back in Time 推算过去的状态

Using the lunch model from T-15, how many students chose each lunch yesterday? Two days ago?

Inverse of $P$. $\det P=0.9(0.8)-0.2(0.1)=0.7$, so $$P^{-1}=\frac{1}{0.7}\begin{bmatrix}0.8&-0.2\\-0.1&0.9\end{bmatrix}$$
Yesterday. $\vec x_{-1}=P^{-1}\vec x_0=\dfrac{1}{0.7}\begin{bmatrix}0.8(310)-0.2(190)\\-0.1(310)+0.9(190)\end{bmatrix}=\dfrac{1}{0.7}\begin{bmatrix}210\\140\end{bmatrix}=\begin{bmatrix}300\\200\end{bmatrix}$
Check: $P\begin{bmatrix}300\\200\end{bmatrix}=\begin{bmatrix}270+40\\30+160\end{bmatrix}=\begin{bmatrix}310\\190\end{bmatrix}$ ✓
Two days ago. $\vec x_{-2}=P^{-1}\begin{bmatrix}300\\200\end{bmatrix}=\dfrac{1}{0.7}\begin{bmatrix}200\\150\end{bmatrix}\approx\begin{bmatrix}285.7\\214.3\end{bmatrix}$. The model is an approximation, so the counts are not whole numbers: about $286$ and $214$.
Yesterday: $300$ pizza, $200$ salad. Two days ago: about $286$ pizza, $214$ salad.
📝 练习 E-5 — Markov Chain: Weather Model

A weather model has two states: Sunny (S) and Rainy (R). The transition matrix is $P=\begin{bmatrix}0.7&0.4\\0.3&0.6\end{bmatrix}$ where columns represent current state (S, then R). Today is Sunny. Find: (a) probability it rains in 2 days, (b) the steady-state distribution.

(a) $\vec{x}_0=\begin{bmatrix}1\\0\end{bmatrix}$; $\vec{x}_1=\begin{bmatrix}0.7\\0.3\end{bmatrix}$; $\vec{x}_2=P\vec{x}_1=\begin{bmatrix}0.7(0.7)+0.4(0.3)\\0.3(0.7)+0.6(0.3)\end{bmatrix}=\begin{bmatrix}0.61\\0.39\end{bmatrix}$
Probability of rain in 2 days $= 39\%$.

(b) Steady state: $0.7q_1+0.4q_2=q_1\Rightarrow 0.4q_2=0.3q_1\Rightarrow q_1=\tfrac{4}{3}q_2$; with $q_1+q_2=1$: $q_1=\tfrac{4}{7}\approx57.1\%$ Sunny, $q_2=\tfrac{3}{7}\approx42.9\%$ Rainy.
📝 练习 E-6 — City and Suburbs 城市与郊区人口

Each year, $5\%$ of city residents move to the suburbs and $3\%$ of suburban residents move to the city; everyone else stays. This year the city has $60{,}000$ residents and the suburbs $40{,}000$.
(a) Write the transition matrix.  (b) Predict next year.  (c) Find last year's populations.  (d) Find the long-run populations.

(a) $P=\begin{bmatrix}0.95&0.03\\0.05&0.97\end{bmatrix}$ (columns: from city, from suburbs).
(b) $P\begin{bmatrix}60000\\40000\end{bmatrix}=\begin{bmatrix}58200\\41800\end{bmatrix}$.
(c) $\det P=0.92$; $\;P^{-1}\begin{bmatrix}60000\\40000\end{bmatrix}=\dfrac{1}{0.92}\begin{bmatrix}0.97(60000)-0.03(40000)\\-0.05(60000)+0.95(40000)\end{bmatrix}=\dfrac{1}{0.92}\begin{bmatrix}57000\\35000\end{bmatrix}\approx\begin{bmatrix}61957\\38043\end{bmatrix}$.
(d) $0.05c=0.03s$ and $c+s=100000$: city $37{,}500$, suburbs $62{,}500$.

Chapter 12 Summary 本章总结

Topic 主题Key Formula / Rule
Matrix addition/subtractionEntry-by-entry; requires same order
Matrix multiplication$A_{m\times k}\cdot B_{k\times n}=C_{m\times n}$; row · column dot products
Not commutative$AB\neq BA$ in general
Identity matrix$AI=IA=A$; diag $=1$, off-diag $=0$
Determinant ($2\times2$)$\det\begin{bmatrix}a&b\\c&d\end{bmatrix}=ad-bc$
Inverse ($2\times2$)$A^{-1}=\dfrac{1}{ad-bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix}$; exists iff $\det\neq0$
Parallelogram area$|\det[\vec{u}\;|\;\vec{v}]|$
Linear transformation$T(\vec{x})=A\vec{x}$; outputs are linear combos of inputs
Standard matrixColumns $= T(\mathbf{e}_1),T(\mathbf{e}_2),\ldots$
Rotation by $\theta$$R_\theta=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}$
Area scale factor$|\det(A)|$
Composition $S\circ T$Matrix $= BA$ (right-to-left order)
Markov next state$\vec{x}_{n+1}=P\vec{x}_n$; after $n$ steps: $P^n\vec{x}_0$
Steady state$P\vec{q}=\vec{q}$ with $\sum q_i=1$ (or the total); or compute $P^n\vec{x}_0$ for large $n$
Building $P$Column $j$ = where state $j$ goes (percents as decimals); each column sums to $1$
Markov past state$\vec{x}_{n-1}=P^{-1}\vec{x}_n$
Linear testMust have $T(\vec 0)=\vec 0$
Several vectors at onceVectors as columns of $V$ ($2\times n$); images are the columns of $AV$
Reflections$x$-axis $\begin{bmatrix}1&0\\0&-1\end{bmatrix}$, $y$-axis $\begin{bmatrix}-1&0\\0&1\end{bmatrix}$, $y=x$ $\begin{bmatrix}0&1\\1&0\end{bmatrix}$
Inverse transformation$L^{-1}(\vec v)=A^{-1}\vec v$; $\;R_\theta^{-1}=R_{-\theta}$
考试重点提示
  • 矩阵乘法的维数检验:内维必须相等,结果矩阵取外维。
  • $2\times2$ 逆矩阵:先算行列式,再用公式(对角互换,副对角取反,除以行列式)。
  • 行列式 $=0$ 时,矩阵不可逆,对应的线性变换会压缩掉一个维度。
  • 复合变换:先做的变换对应的矩阵写在右边($S\circ T \leftrightarrow BA$)。
  • 马尔可夫链:转移矩阵每列之和为 $1$;稳态向量满足 $P\vec{q}=\vec{q}$ 且分量和为 $1$。
  • 由情境构造转移矩阵:第 $j$ 列写"从状态 $j$ 出发去各状态的比例",写完检查每列和为 $1$。
  • 推算过去用 $P^{-1}$;预测长期用 $P^n\vec{x}_0$($n$ 取大),或解 $P\vec{q}=\vec{q}$。
🎉 全书完结!课程总结
恭喜完成全部 12 章!按 CED 的单元划分:
  • Ch 1–4:函数、多项式、有理函数、母函数与变换
  • Ch 5–7:指数函数、数列、对数函数
  • Ch 8–9:三角函数、极坐标
以上第 1–9 章对应 CED Units 1–3,是 AP 考试范围。
  • Ch 10–12:参数方程与圆锥曲线、向量、矩阵:对应 CED Unit 4,由学校自选,不在 AP 考试范围内。
Axiom Learning
AP Precalculus · Chapter 12: Matrices 矩阵  |  Axiom Learning 讲义