第 34 章

期末总复习:用六道旧题串起整门课

从秩与可解性、四个子空间、矩阵乘法、正交投影、Markov 过程到最小二乘,每道题对应一条主线,答案背后是同一张四子空间图。

Final Review: Six Old Problems That Span the Course

From rank and solvability, four subspaces, and matrix multiplication to orthogonal projection, Markov processes, and least squares, every problem traces back to the same four-subspace picture.

首发于 2009.05.07中 / EN
系统课程linear-algebracourse-reviewleast-squaresmarkov
语言
字号
目录
篇内目录

复习的方式

最后一讲没有重新讲定义,而是拿旧考题现场推理。每道题都对应课程的一条主线;把它们放在一起,就是一张完整的知识地图。

下面按题型整理,重点不是答案,而是看到条件后应该先问什么。

时间轴

时间内容
0:07期末复习的形式
1:18第一题:由 Ax=bAx=b 反推 m,n,rm,n,r
3:26主元与可解性
5:01构造满足条件的矩阵
7:33可逆性与 ATAA^{\mathsf T}A 的秩
10:26ATAA^{\mathsf T}A 的零空间
14:40ATy=cA^{\mathsf T}y=c 与 ATA^{\mathsf T} 的零空间
17:06四个子空间的维数
18:28线性组合、无关性与零空间
21:29唯一性取决于零空间
22:53最近点与投影
25:02特征值、迹与行列式
26:54马尔可夫矩阵的稳态
28:22稳态特征向量的计算
32:16由性质构造矩阵
34:26SΛS−1S\Lambda S^{-1} 的用法
35:43有正交特征向量但不对称的矩阵
38:49最小二乘的解与残差
41:07让最小二乘解改变的右端向量

题型一:由可解性反推 m、n、r

题目

设 AA 是 3×n3\times n 矩阵。已知:

  • Ax=(1,0,0)TAx=(1,0,0)^{\mathsf T} 无解;
  • Ax=(0,1,0)TAx=(0,1,0)^{\mathsf T} 恰有一个解。

问 m,n,rm,n,r 的关系。

推理

  1. 右边是三维向量,所以 m=3m=3。
  2. 存在某个右端无解,说明消元会出现零行,因此 r<mr<m,即 r<3r<3。
  3. 「恰有一个解」说明零空间只有零向量,因此列线性无关,r=nr=n。

合起来:

r=n<3.r=n<3.

例子

取

A=[010].A=\begin{bmatrix}0\\1\\0\end{bmatrix}.

它是 3×13\times1,r=n=1r=n=1。列空间是 yy 轴,(0,1,0)(0,1,0) 在其中且解唯一;(1,0,0)(1,0,0) 不在其中,无解。

若想用两列,可以取

A=[001001],A=\begin{bmatrix}0&0\\1&0\\0&1\end{bmatrix},

列空间是 yzyz 平面,同样满足条件。

题型二:关于 ATAA^{\mathsf T}A 与 AATAA^{\mathsf T} 的真假判断

在上面的设定下(r=n<3r=n<3),判断三条命题。

命题一:det⁡(ATA)=det⁡(AAT)\det(A^{\mathsf T}A)=\det(AA^{\mathsf T})

假。两个矩阵尺寸不同:ATAA^{\mathsf T}A 是 n×nn\times n,AATAA^{\mathsf T} 是 3×33\times3。

只有当 AA 是方阵时,det⁡(BA)=det⁡(AB)\det(BA)=\det(AB) 才成立,并且此时两者都等于 (det⁡A)2(\det A)^2。

命题二:ATAA^{\mathsf T}A 可逆

真。因为 r=nr=n,列线性无关,ATAA^{\mathsf T}A 是 n×nn\times n 且满秩。

命题三:AATAA^{\mathsf T} 正定

假。AATAA^{\mathsf T} 是 3×33\times3,但秩只有 r=n<3r=n<3,必然奇异,最多半正定。

对应的例子中 AATAA^{\mathsf T} 的第一行全为零,显然不正定。

题型三:证明 ATy=cA^{\mathsf T}y=c 总有解

ATA^{\mathsf T} 是 n×3n\times3。因为 AA 的列线性无关,ATA^{\mathsf T} 的行线性无关,所以

rank⁡(AT)=n,\operatorname{rank}(A^{\mathsf T})=n,

行满秩意味着对任意右端都有解。

至于为什么有无穷多解:ATA^{\mathsf T} 的零空间维数是

m−r=3−r>0,m-r=3-r>0,

所以只要有一个解,就能加上零空间中的任意向量,得到无穷多个解。

这道题把「行满秩 ⇒\Rightarrow 总有解」与「零空间维数 =m−r=m-r」两条结论合在一起,是典型的综合题。

题型四:矩阵乘法与零空间

设 AA 的列是 v1,v2,v3v_1,v_2,v_3。

解 Ax=v1−v2+v3Ax=v_1-v_2+v_3

按列组合的定义,

A[1−11]=1⋅v1+(−1)⋅v2+1⋅v3=v1−v2+v3.A\begin{bmatrix}1\\-1\\1\end{bmatrix} =1\cdot v_1+(-1)\cdot v_2+1\cdot v_3 =v_1-v_2+v_3.

所以

x=[1−11].x=\begin{bmatrix}1\\-1\\1\end{bmatrix}.

这是矩阵乘法最基本的事实:AxAx 是列向量的线性组合,系数就是 xx 的分量。

若 v1−v2+v3=0v_1-v_2+v_3=0

那么上面这个 xx 就在 AA 的零空间中。于是对任意解,都可以加上它而结果不变:

A(x+kc)=Ax.A(x+kc)=Ax.

所以解不唯一。唯一性等价于零空间只有零向量。

题型五:正交向量与最近点

设 v1,v2,v3v_1,v_2,v_3 标准正交。

问:v1,v2v_1,v_2 的哪个线性组合最接近 v3v_3?

因为 v3v_3 与 v1,v2v_1,v_2 都正交,它在 span⁡(v1,v2)\operatorname{span}(v_1,v_2) 上的投影是零。所以最接近的组合是

0⋅v1+0⋅v2=0.0\cdot v_1+0\cdot v_2=0.

用标准基想象:v1,v2,v3v_1,v_2,v_3 就是 x,y,zx,y,z 轴,xyxy 平面上离 zz 轴最近的点是原点。

题型六:Markov 矩阵与稳态

矩阵与特征值

课堂上给出的矩阵满足三个结构性质:

  • 每一列元素非负且和为 11(Markov 性质);
  • 第一列加第二列等于第三列的两倍,因此列线性相关,矩阵奇异;
  • 迹为 0.80.8。

由此直接读出三个特征值:

  • 因为 Markov,11 一定是特征值;
  • 因为奇异,00 是特征值;
  • 因为迹等于特征值之和,第三个是 0.8−1−0=−0.20.8-1-0=-0.2。

补充:录音中的矩阵数字有噪声。一个满足上述全部条件的具体矩阵是 A=[0.20.40.30.40.20.30.40.40.4].A=\begin{bmatrix}0.2&0.4&0.3\\0.4&0.2&0.3\\0.4&0.4&0.4\end{bmatrix}. 它的列和为 11,第一列加第二列等于 (0.6,0.6,0.8)=2(0.3,0.3,0.4)(0.6,0.6,0.8)=2(0.3,0.3,0.4),迹为 0.80.8。

稳态

设初值 u0=(0,10,0)u_0=(0,10,0),考察 uk=Aku0u_k=A^ku_0。把 u0u_0 展开成特征向量组合:

uk=c1λ1kx1+c2λ2kx2+c3λ3kx3.u_k=c_1\lambda_1^kx_1+c_2\lambda_2^kx_2+c_3\lambda_3^kx_3.

当 k→∞k\to\infty,λ1=0\lambda_1=0 与 λ3=−0.2\lambda_3=-0.2 的项都趋于零,只剩 λ2=1\lambda_2=1 的项:

u∞=c2x2.u_\infty=c_2x_2.

求 λ=1\lambda=1 的特征向量,解 (A−I)x=0(A-I)x=0 得

x2=[334].x_2=\begin{bmatrix}3\\3\\4\end{bmatrix}.

系数为什么是 1

Markov 矩阵保持总人口不变:

1TAu=1Tu.\mathbf 1^{\mathsf T}Au=\mathbf 1^{\mathsf T}u.

对特征向量 xix_i,若 λi≠1\lambda_i\neq1,则

1TAxi=λi1Txi=1Txi,\mathbf 1^{\mathsf T}Ax_i=\lambda_i\mathbf 1^{\mathsf T}x_i=\mathbf 1^{\mathsf T}x_i,

所以 (λi−1)1Txi=0(\lambda_i-1)\mathbf 1^{\mathsf T}x_i=0,即 1Txi=0\mathbf 1^{\mathsf T}x_i=0。也就是说,非 11 特征向量的分量和为零。

初值的分量和是 1010,x2x_2 的分量和也是 1010,因此 c2=1c_2=1。稳态是

u∞=[334].u_\infty=\begin{bmatrix}3\\3\\4\end{bmatrix}.

题型七:按性质构造矩阵

要求例子理由
投影到过 a=(4,−3)a=(4,-3) 的直线125[16−12−129]\dfrac{1}{25}\begin{bmatrix}16&-12\\-12&9\end{bmatrix}P=aaTaTaP=\dfrac{aa^{\mathsf T}}{a^{\mathsf T}a}
特征值 0,30,3,特征向量 (1,2),(2,1)(1,2),(2,1)[4−22−1]\begin{bmatrix}4&-2\\2&-1\end{bmatrix}A=SΛS−1A=S\Lambda S^{-1}
不能写成 BTBB^{\mathsf T}B[0100]\begin{bmatrix}0&1\\0&0\end{bmatrix}BTBB^{\mathsf T}B 必对称
有正交特征向量但不对称[0−110]\begin{bmatrix}0&-1\\1&0\end{bmatrix}反对称矩阵的特征向量正交

第三题的要点:BTBB^{\mathsf T}B 永远对称,所以任何非对称矩阵都不可能具有这种形式。

第四题的要点:正交特征向量不只属于对称矩阵。反对称矩阵与正交矩阵同样满足 AAT=ATAAA^{\mathsf T}=A^{\mathsf T}A,它们的特征向量也可以选成正交(可能是复向量)。

题型八:最小二乘的四个追问

题目

A=[101112],b=[341].A=\begin{bmatrix}1&0\\1&1\\1&2\end{bmatrix},\qquad b=\begin{bmatrix}3\\4\\1\end{bmatrix}.

1. 最小二乘解

ATA=[3335],ATb=[86].A^{\mathsf T}A=\begin{bmatrix}3&3\\3&5\end{bmatrix},\qquad A^{\mathsf T}b=\begin{bmatrix}8\\6\end{bmatrix}.

解正规方程得

x^=[11/3−1].\hat x=\begin{bmatrix}11/3\\-1\end{bmatrix}.

2. 投影是什么

投影就是最优组合:

p=Ax^=113[111]−[012]=[11/38/35/3].p=A\hat x=\frac{11}{3}\begin{bmatrix}1\\1\\1\end{bmatrix} -\begin{bmatrix}0\\1\\2\end{bmatrix} =\begin{bmatrix}11/3\\8/3\\5/3\end{bmatrix}.

3. 对应的直线

AA 的两列分别对应「常数项」和「斜率」,所以这是在拟合

y=113−t.y=\frac{11}{3}-t.

在 t=0,1,2t=0,1,2 处,直线给出 11/3, 8/3, 5/311/3,\,8/3,\,5/3,与实际值 3,4,13,4,1 的误差平方和最小。

4. 什么时候最小二乘解为零

要找非零的 bb,使得最优组合是零向量。这等价于 bb 与整个列空间正交。

列空间由 (1,1,1)(1,1,1) 与 (0,1,2)(0,1,2) 张成。取

b′=[1−21],b'=\begin{bmatrix}1\\-2\\1\end{bmatrix},

它满足

[111]b′=0,[012]b′=0.\begin{bmatrix}1&1&1\end{bmatrix}b'=0,\qquad \begin{bmatrix}0&1&2\end{bmatrix}b'=0.

所以 b′b' 与两列都正交,投影为零,最小二乘解为零。

整门课的一条主线

把这些题放在一起,可以看到同一条思路反复出现:

  1. 秩决定一切:可解性、唯一性、逆的类型,都由 rr 与 m,nm,n 的关系决定。
  2. 四个子空间是坐标系:零空间管唯一性,列空间管可解性,行空间与左零空间管投影与最小二乘。
  3. 矩阵乘法就是列的线性组合:这是所有计算的起点。
  4. 特征值描述长期行为:微分方程看指数,Markov 过程看幂。
  5. 特殊矩阵有特殊谱:对称(实、正交特征向量)、反对称(纯虚)、正交(模长 11)、投影(00 或 11)、Markov(11 与不超过 11)。
  6. SVD 把一般矩阵化归为对角:伪逆、最小二乘、四个子空间的基,都从它得到。

理解检验

1. 由「某右端无解、另一右端唯一解」如何推出 r=n<mr=n<m?

参考答案:右端是三维向量,所以 m=3m=3。存在一个右端 Ax=(1,0,0)TAx=(1,0,0)^{\mathsf T} 无解,说明 AA 不能对每个 b∈R3\mathbf b\in\mathbb R^3 都求解,即列空间不是整个 R3\mathbb R^3,于是 r<mr<m,也就是 r<3r<3。另一方面 Ax=(0,1,0)TAx=(0,1,0)^{\mathsf T} 恰有一个解,说明零空间只有零向量(否则可加上零空间向量得到更多解),所以列线性无关,r=nr=n。合并得 r=n<3r=n<3。注意这里 nn 可以是 11 或 22,但必须等于 rr。

2. 为什么 ATAA^{\mathsf T}A 可逆而 AATAA^{\mathsf T} 不正定?

参考答案:AA 是 3×n3\times n 且 r=nr=n,列线性无关,所以 ATAA^{\mathsf T}A 是 n×nn\times n 且满秩,可逆;由 xTATAx=∥Ax∥2>0x^{\mathsf T}A^{\mathsf T}Ax=\lVert Ax\rVert^2>0(x≠0x\ne0)它还正定。而 AATAA^{\mathsf T} 是 3×33\times3,秩只有 r=n<3r=n<3,所以奇异,必有零特征值,最多半正定,不可能正定。两者尺寸和秩都不同,不能混用;只有 AA 为方阵且可逆时,两者才都可逆并互为转置关系。

3. 若 v1−v2+v3=0v_1-v_2+v_3=0,Ax=v1Ax=v_1 的解是否唯一?为什么?

参考答案:不唯一。条件说明向量 c=(1,−1,1)Tc=(1,-1,1)^{\mathsf T} 满足 Ac=v1−v2+v3=0Ac=v_1-v_2+v_3=0,即 c∈N(A)c\in N(A),且 c≠0c\ne0,所以零空间非平凡。Ax=v1Ax=v_1 显然有解 x=e1=(1,0,0)Tx=e_1=(1,0,0)^{\mathsf T}(取第一列为 v1v_1 的系数);于是对任意 kk,

A(e1+kc)=v1+k⋅0=v1,A(e_1+kc)=v_1+k\cdot0=v_1,

得到无穷多个解。唯一性等价于零空间只有零向量,而这里不满足。

4. Markov 矩阵的非 11 特征向量为什么分量和为零?这如何帮助求稳态系数?

参考答案:Markov 矩阵每列和为 11,即 1TA=1T\mathbf 1^{\mathsf T}A=\mathbf 1^{\mathsf T}。对特征向量 Axi=λixiAx_i=\lambda_ix_i,两边左乘 1T\mathbf 1^{\mathsf T}:

λi1Txi=1TAxi=1Txi,\lambda_i\mathbf 1^{\mathsf T}x_i=\mathbf 1^{\mathsf T}Ax_i=\mathbf 1^{\mathsf T}x_i,

所以 (λi−1)1Txi=0(\lambda_i-1)\mathbf 1^{\mathsf T}x_i=0。当 λi≠1\lambda_i\ne1 时必有 1Txi=0\mathbf 1^{\mathsf T}x_i=0,即分量和为零。求稳态系数时把 u0=∑cixiu_0=\sum c_ix_i 两边取分量和:非 11 项贡献为零,只剩 c21Tx2=1Tu0c_2\mathbf 1^{\mathsf T}x_2=\mathbf 1^{\mathsf T}u_0,于是 c2=1Tu0/1Tx2=10/10=1c_2=\mathbf 1^{\mathsf T}u_0/\mathbf 1^{\mathsf T}x_2=10/10=1。这避免了真正解方程组求系数。

5. 最小二乘解为零的充要条件是什么?如何构造这样的 bb?

参考答案:最小二乘解满足正规方程 ATAx^=ATbA^{\mathsf T}A\hat x=A^{\mathsf T}b,所以 x^=0\hat x=0 当且仅当 ATb=0A^{\mathsf T}b=0,即 bb 与 AA 的每一列都正交,也就是 b∈N(AT)b\in N(A^{\mathsf T})(左零空间),等价于 b⊥C(A)b\perp C(A)。构造方法是取一个非零的左零空间向量:本题 AA 的列是 (1,1,1)T(1,1,1)^{\mathsf T} 与 (0,1,2)T(0,1,2)^{\mathsf T},解 b1+b2+b3=0b_1+b_2+b_3=0、b2+2b3=0b_2+2b_3=0,取 b3=1b_3=1 得 b2=−2b_2=-2、b1=1b_1=1,即 b′=(1,−2,1)Tb'=(1,-2,1)^{\mathsf T}。此时投影 p=Ax^=0p=A\hat x=0,最小二乘解 x^=0\hat x=0。

结语

线性代数的力量在于:不同的题目背后是同一组结构。秩、子空间、特征值、分解——掌握这四件事,具体计算只是它们的展开。

How the review works

The last lecture does not restate definitions. It works old exam problems live. Every problem maps to one thread of the course; together they form a complete map.

Below, the problems are grouped by type. The point is not the answer but what to ask first when a condition appears.

Timeline

TimeTopic
0:07The format of the final review
1:18Problem one: inferring m,n,rm,n,r from Ax=bAx=b
3:26Pivots and solvability
5:01Constructing a matrix with prescribed properties
7:33Invertibility and the rank of ATAA^{\mathsf T}A
10:26The nullspace of ATAA^{\mathsf T}A
14:40ATy=cA^{\mathsf T}y=c and the nullspace of ATA^{\mathsf T}
17:06Dimensions of the four subspaces
18:28Combinations, independence, nullspace
21:29Uniqueness is decided by the nullspace
22:53Nearest point and projection
25:02Eigenvalues, trace, determinant
26:54Steady state of a Markov matrix
28:22Computing the steady state eigenvector
32:16Building a matrix from its properties
34:26Using SΛS−1S\Lambda S^{-1}
35:43Orthogonal eigenvectors without symmetry
38:49Least squares solution and residual
41:07Changing bb so the least squares solution changes

Type one: recover m, n, r from solvability

Problem

Let AA be 3×n3\times n. Suppose:

  • Ax=(1,0,0)TAx=(1,0,0)^{\mathsf T} has no solution;
  • Ax=(0,1,0)TAx=(0,1,0)^{\mathsf T} has exactly one solution.

Find the relation among m,n,rm,n,r.

Reasoning

  1. The right side is a three-dimensional vector, so m=3m=3.
  2. Some right side has no solution, so elimination produces a zero row, hence r<mr<m, that is r<3r<3.
  3. "Exactly one solution" means the null space is trivial, so the columns are independent and r=nr=n.

Therefore

r=n<3.r=n<3.

An example

A=[010].A=\begin{bmatrix}0\\1\\0\end{bmatrix}.

It is 3×13\times1 with r=n=1r=n=1. Its column space is the yy-axis, which contains (0,1,0)(0,1,0) uniquely but not (1,0,0)(1,0,0).

With two columns, take

A=[001001],A=\begin{bmatrix}0&0\\1&0\\0&1\end{bmatrix},

whose column space is the yzyz-plane and which satisfies the same conditions.

Type two: true or false about ATAA^{\mathsf T}A and AATAA^{\mathsf T}

Under r=n<3r=n<3, decide three statements.

Statement one: det⁡(ATA)=det⁡(AAT)\det(A^{\mathsf T}A)=\det(AA^{\mathsf T})

False. The matrices have different sizes: ATAA^{\mathsf T}A is n×nn\times n, while AATAA^{\mathsf T} is 3×33\times3.

The identity det⁡(BA)=det⁡(AB)\det(BA)=\det(AB) requires square matrices, and then both equal (det⁡A)2(\det A)^2.

Statement two: ATAA^{\mathsf T}A is invertible

True. Since r=nr=n, the columns are independent and ATAA^{\mathsf T}A is n×nn\times n of full rank.

Statement three: AATAA^{\mathsf T} is positive definite

False. AATAA^{\mathsf T} is 3×33\times3 but has rank r=n<3r=n<3, so it is singular and at most semidefinite.

In the example, the first row of AATAA^{\mathsf T} is entirely zero, so it certainly is not positive definite.

Type three: proving ATy=cA^{\mathsf T}y=c is always solvable

ATA^{\mathsf T} is n×3n\times3. Since the columns of AA are independent, the rows of ATA^{\mathsf T} are independent, so

rank⁡(AT)=n.\operatorname{rank}(A^{\mathsf T})=n.

Full row rank means every right side is solvable.

Why infinitely many? The null space of ATA^{\mathsf T} has dimension

m−r=3−r>0.m-r=3-r>0.

So once one solution exists, adding any null-space vector gives another.

This problem combines two facts: full row rank implies solvability, and the left null space has dimension m−rm-r.

Type four: matrix multiplication and null spaces

Let the columns of AA be v1,v2,v3v_1,v_2,v_3.

Solve Ax=v1−v2+v3Ax=v_1-v_2+v_3

By the definition of multiplication by columns,

A[1−11]=v1−v2+v3.A\begin{bmatrix}1\\-1\\1\end{bmatrix} =v_1-v_2+v_3.

So

x=[1−11].x=\begin{bmatrix}1\\-1\\1\end{bmatrix}.

This is the most basic fact about matrix multiplication: AxAx is a combination of the columns, with the entries of xx as coefficients.

If v1−v2+v3=0v_1-v_2+v_3=0

Then this xx lies in the null space of AA. Any solution can be shifted by it:

A(x+kc)=Ax.A(x+kc)=Ax.

So solutions are not unique. Uniqueness is exactly the statement that the null space is trivial.

Type five: orthonormal vectors and the nearest point

Suppose v1,v2,v3v_1,v_2,v_3 are orthonormal.

Which combination of v1,v2v_1,v_2 is closest to v3v_3?

Since v3v_3 is orthogonal to both, its projection onto span⁡(v1,v2)\operatorname{span}(v_1,v_2) is zero. The closest combination is therefore

0⋅v1+0⋅v2=0.0\cdot v_1+0\cdot v_2=0.

Picture the standard basis: the point in the xyxy-plane closest to the zz-axis is the origin.

Type six: Markov matrices and steady state

The matrix and its eigenvalues

The lecture's matrix has three structural properties:

  • every column is nonnegative and sums to 11 (Markov);
  • column one plus column two equals twice column three, so the columns are dependent and the matrix is singular;
  • the trace is 0.80.8.

The eigenvalues follow immediately:

  • Markov forces 11 to be an eigenvalue;
  • singularity forces 00;
  • the trace is the sum, so the third is 0.8−1−0=−0.20.8-1-0=-0.2.

Background: the recorded digits are noisy. One matrix satisfying every stated property is A=[0.20.40.30.40.20.30.40.40.4].A=\begin{bmatrix}0.2&0.4&0.3\\0.4&0.2&0.3\\0.4&0.4&0.4\end{bmatrix}. Its columns sum to 11, column one plus column two equals (0.6,0.6,0.8)=2(0.3,0.3,0.4)(0.6,0.6,0.8)=2(0.3,0.3,0.4), and its trace is 0.80.8.

Steady state

Start from u0=(0,10,0)u_0=(0,10,0) and iterate uk=Aku0u_k=A^ku_0. Expand the initial vector in the eigenbasis:

uk=c1λ1kx1+c2λ2kx2+c3λ3kx3.u_k=c_1\lambda_1^kx_1+c_2\lambda_2^kx_2+c_3\lambda_3^kx_3.

As k→∞k\to\infty, the terms with λ1=0\lambda_1=0 and λ3=−0.2\lambda_3=-0.2 vanish, leaving only the λ2=1\lambda_2=1 term:

u∞=c2x2.u_\infty=c_2x_2.

Solving (A−I)x=0(A-I)x=0 gives

x2=[334].x_2=\begin{bmatrix}3\\3\\4\end{bmatrix}.

Why the coefficient is one

A Markov matrix preserves total population:

1TAu=1Tu.\mathbf 1^{\mathsf T}Au=\mathbf 1^{\mathsf T}u.

For an eigenvector xix_i with λi≠1\lambda_i\neq1,

1TAxi=λi1Txi=1Txi,\mathbf 1^{\mathsf T}Ax_i=\lambda_i\mathbf 1^{\mathsf T}x_i=\mathbf 1^{\mathsf T}x_i,

so (λi−1)1Txi=0(\lambda_i-1)\mathbf 1^{\mathsf T}x_i=0, hence 1Txi=0\mathbf 1^{\mathsf T}x_i=0: eigenvectors for other eigenvalues have zero component sum.

The initial vector sums to 1010, and x2x_2 also sums to 1010, so c2=1c_2=1. The steady state is

u∞=[334].u_\infty=\begin{bmatrix}3\\3\\4\end{bmatrix}.

Type seven: construct a matrix with given properties

RequirementExampleReason
Projection onto the line through a=(4,−3)a=(4,-3)125[16−12−129]\dfrac{1}{25}\begin{bmatrix}16&-12\\-12&9\end{bmatrix}P=aaTaTaP=\dfrac{aa^{\mathsf T}}{a^{\mathsf T}a}
Eigenvalues 0,30,3, eigenvectors (1,2),(2,1)(1,2),(2,1)[4−22−1]\begin{bmatrix}4&-2\\2&-1\end{bmatrix}A=SΛS−1A=S\Lambda S^{-1}
Not expressible as BTBB^{\mathsf T}B[0100]\begin{bmatrix}0&1\\0&0\end{bmatrix}BTBB^{\mathsf T}B is always symmetric
Orthogonal eigenvectors but not symmetric[0−110]\begin{bmatrix}0&-1\\1&0\end{bmatrix}Skew-symmetric matrices qualify

The third point: BTBB^{\mathsf T}B is always symmetric, so any non-symmetric matrix is impossible.

The fourth point: orthogonal eigenvectors are not exclusive to symmetric matrices. Skew-symmetric and orthogonal matrices also satisfy AAT=ATAAA^{\mathsf T}=A^{\mathsf T}A, and their eigenvectors can be chosen orthogonal, possibly over the complex numbers.

Type eight: four questions about one least-squares problem

The setup

A=[101112],b=[341].A=\begin{bmatrix}1&0\\1&1\\1&2\end{bmatrix},\qquad b=\begin{bmatrix}3\\4\\1\end{bmatrix}.

1. The least-squares solution

ATA=[3335],ATb=[86].A^{\mathsf T}A=\begin{bmatrix}3&3\\3&5\end{bmatrix},\qquad A^{\mathsf T}b=\begin{bmatrix}8\\6\end{bmatrix}.

Solving the normal equations:

x^=[11/3−1].\hat x=\begin{bmatrix}11/3\\-1\end{bmatrix}.

2. The projection

The projection is the optimal combination:

p=Ax^=113[111]−[012]=[11/38/35/3].p=A\hat x=\frac{11}{3}\begin{bmatrix}1\\1\\1\end{bmatrix} -\begin{bmatrix}0\\1\\2\end{bmatrix} =\begin{bmatrix}11/3\\8/3\\5/3\end{bmatrix}.

3. The corresponding line

The two columns correspond to an intercept and a slope, so this fits

y=113−t.y=\frac{11}{3}-t.

At t=0,1,2t=0,1,2 the line gives 11/3, 8/3, 5/311/3,\,8/3,\,5/3, minimizing the squared error against 3,4,13,4,1.

4. When is the least-squares solution zero

Find a nonzero bb whose optimal combination is the zero vector. This is equivalent to bb being orthogonal to the whole column space.

The column space is spanned by (1,1,1)(1,1,1) and (0,1,2)(0,1,2). Take

b′=[1−21],b'=\begin{bmatrix}1\\-2\\1\end{bmatrix},

which satisfies

[111]b′=0,[012]b′=0.\begin{bmatrix}1&1&1\end{bmatrix}b'=0,\qquad \begin{bmatrix}0&1&2\end{bmatrix}b'=0.

So b′b' is orthogonal to both columns, its projection is zero, and the least-squares solution is zero.

One thread through the whole course

Put together, the problems repeat a single pattern:

  1. Rank governs everything: solvability, uniqueness, and the kind of inverse all follow from how rr compares with mm and nn.
  2. The four subspaces are the coordinate system: the null space controls uniqueness, the column space controls solvability, and the row and left null spaces control projection and least squares.
  3. Matrix multiplication is a combination of columns: this is where every computation starts.
  4. Eigenvalues describe long-term behavior: exponentials for differential equations, powers for Markov chains.
  5. Special matrices have special spectra: symmetric (real, orthogonal eigenvectors), skew-symmetric (purely imaginary), orthogonal (unit modulus), projection (00 or 11), Markov (11 and no larger).
  6. SVD reduces any matrix to diagonal form: pseudoinverses, least squares, and bases for all four subspaces follow from it.

Check your understanding

1. How do "one right side unsolvable, another uniquely solvable" imply r=n<mr=n<m?

Reference answer: The right side is a three-dimensional vector, so m=3m=3. The existence of an unsolvable right side Ax=(1,0,0)TAx=(1,0,0)^{\mathsf T} means AA cannot be solved for every b∈R3\mathbf b\in\mathbb R^3; the column space is not all of R3\mathbb R^3, hence r<mr<m, i.e. r<3r<3. On the other hand Ax=(0,1,0)TAx=(0,1,0)^{\mathsf T} has exactly one solution, so the null space is trivial (otherwise adding any null-space vector would produce more solutions) and the columns are independent, r=nr=n. Combining gives r=n<3r=n<3. Here nn may be 11 or 22, but it must equal rr.

2. Why is ATAA^{\mathsf T}A invertible while AATAA^{\mathsf T} is not positive definite?

Reference answer: AA is 3×n3\times n with r=nr=n, so its columns are independent and ATAA^{\mathsf T}A is n×nn\times n of full rank, hence invertible; it is even positive definite, since xTATAx=∥Ax∥2>0x^{\mathsf T}A^{\mathsf T}Ax=\lVert Ax\rVert^2>0 for x≠0x\ne0. But AATAA^{\mathsf T} is 3×33\times3 with rank r=n<3r=n<3, so it is singular, has a zero eigenvalue, and is at most positive semidefinite — never positive definite. The two products differ in both size and rank and cannot be treated interchangeably; they are both invertible only when AA is square and invertible.

3. If v1−v2+v3=0v_1-v_2+v_3=0, is the solution of Ax=v1Ax=v_1 unique? Why?

Reference answer: No. The condition says Ac=v1−v2+v3=0Ac=v_1-v_2+v_3=0 for c=(1,−1,1)Tc=(1,-1,1)^{\mathsf T}, so c∈N(A)c\in N(A) and c≠0c\ne0 — the null space is nontrivial. The system Ax=v1Ax=v_1 has the obvious solution x=e1=(1,0,0)Tx=e_1=(1,0,0)^{\mathsf T} (the coefficient on the first column); then for every kk,

A(e1+kc)=v1+k⋅0=v1,A(e_1+kc)=v_1+k\cdot0=v_1,

giving infinitely many solutions. Uniqueness is equivalent to a trivial null space, which fails here.

4. Why do eigenvectors of a Markov matrix for eigenvalues other than 11 have zero component sum, and how does that determine the steady-state coefficient?

Reference answer: A Markov matrix has columns summing to 11, i.e. 1TA=1T\mathbf 1^{\mathsf T}A=\mathbf 1^{\mathsf T}. For Axi=λixiAx_i=\lambda_ix_i, left-multiply by 1T\mathbf 1^{\mathsf T}:

λi1Txi=1TAxi=1Txi,\lambda_i\mathbf 1^{\mathsf T}x_i=\mathbf 1^{\mathsf T}Ax_i=\mathbf 1^{\mathsf T}x_i,

so (λi−1)1Txi=0(\lambda_i-1)\mathbf 1^{\mathsf T}x_i=0. If λi≠1\lambda_i\ne1, then 1Txi=0\mathbf 1^{\mathsf T}x_i=0: the components sum to zero. To get the steady-state coefficient, sum the components on both sides of u0=∑cixiu_0=\sum c_ix_i: every non-11 term contributes zero, leaving c21Tx2=1Tu0c_2\mathbf 1^{\mathsf T}x_2=\mathbf 1^{\mathsf T}u_0, so c2=1Tu0/1Tx2=10/10=1c_2=\mathbf 1^{\mathsf T}u_0/\mathbf 1^{\mathsf T}x_2=10/10=1. This avoids solving for the coefficients directly.

5. What is the exact condition for the least-squares solution to be zero, and how do you construct such a bb?

Reference answer: The least-squares solution satisfies the normal equations ATAx^=ATbA^{\mathsf T}A\hat x=A^{\mathsf T}b, so x^=0\hat x=0 exactly when ATb=0A^{\mathsf T}b=0, i.e. bb is orthogonal to every column of AA — equivalently b∈N(AT)b\in N(A^{\mathsf T}) (the left null space), or b⊥C(A)b\perp C(A). To construct one, take a nonzero left-null-space vector: here the columns of AA are (1,1,1)T(1,1,1)^{\mathsf T} and (0,1,2)T(0,1,2)^{\mathsf T}, so solve b1+b2+b3=0b_1+b_2+b_3=0 and b2+2b3=0b_2+2b_3=0; setting b3=1b_3=1 gives b2=−2b_2=-2, b1=1b_1=1, so b′=(1,−2,1)Tb'=(1,-2,1)^{\mathsf T}. Then the projection p=Ax^=0p=A\hat x=0 and the least-squares solution is x^=0\hat x=0.

Closing

The power of linear algebra is that different problems share the same structure. Rank, subspaces, eigenvalues, and factorizations — master those four, and the computations are just their unfolding.

来源