---
title: 线性代数 第 4 章 · 正交性 习题答案
aliases:
  - 正交性 习题答案
tags:
  - 类型/习题答案
  - 线性代数/正交
chapter: "4"
created: 2026-10-17
updated: 2026-10-17
---

# 线性代数 第 4 章 · 正交性（24 题）

> [!abstract] 本章速览
> 4 篇 · 24 题：四大子空间的正交性（4-1，7 题）、投影与投影矩阵（4-2，7 题）、最小二乘（4-3，5 题）、标准正交基与 Gram–Schmidt（4-4，5 题）。

## 4-1 四大子空间的正交性（7 题）

| 题号 | 结论 |
|---|---|
| 基础 1 | $V^{\perp}=\operatorname{span}\{(1,-1,1)\}$；平面 $x_1-x_2+x_3=0$ |
| 基础 2 | 四空间维数 $2,1,2,0$；两个直和成立 |
| 进阶 3 | $\mathbb R^4=\mathbf C(A^{\mathsf T})\oplus\mathbf N(A)$（$3+1$）；$\mathbb R^5=\mathbf C(A)\oplus\mathbf N(A^{\mathsf T})$（$3+2$） |
| 进阶 4 | $\mathbf x_V=(3,3,3)$、$\mathbf x_{V^\perp}=(-1,0,1)$；$29=27+2$ |
| 思考 5、6、7 | 见解析 |

### 基础题 1　（求正交补）

**解**

**第 1 步：设方程。** $\mathbf x\in V^\perp$ ⟺ $\mathbf x$ 与两个生成向量都正交：

$$
x_1+x_2=0,\qquad x_2+x_3=0
$$

**第 2 步：解。** $x_1=-x_2$、$x_3=-x_2$，取 $x_2=-1$：

$$
V^{\perp}=\operatorname{span}\left\{(1,-1,1)^{\mathsf T}\right\},\qquad\dim V^{\perp}=3-2=1
$$

**第 3 步：平面方程。** 法向量即 $(1,-1,1)$：

$$
x_1-x_2+x_3=0
$$

**答案**　基 $\{(1,-1,1)^{\mathsf T}\}$，$\dim=1$；平面 $x_1-x_2+x_3=0$。

**易错点**　① 把 $V^\perp$ 算成三维（忘了 $V$ 只有两维）；② 平面方程漏掉某个系数；③ 法向量与生成向量搞混。

### 基础题 2　（$2\times3$ 的四大子空间）

**解**

**第 1 步：秩。** 两行 $(1,1,0)$、$(0,1,1)$ 不成比例 ⇒ $r=2$。

**第 2 步：四个子空间。**

| 子空间 | 所在空间 | 维数 | 基 |
|---|---|---|---|
| $\mathbf C(A)$ | $\mathbb R^2$ | $2$ | $\{(1,0),(0,1)\}$（标准基） |
| $\mathbf N(A)$ | $\mathbb R^3$ | $3-2=1$ | $\{(1,-1,1)\}$ |
| $\mathbf C(A^{\mathsf T})$ | $\mathbb R^3$ | $2$ | $\{(1,1,0),(0,1,1)\}$（行） |
| $\mathbf N(A^{\mathsf T})$ | $\mathbb R^2$ | $2-2=0$ | $\varnothing$（只有零向量） |

**第 3 步：验证直和。** $(1,1,0)\cdot(1,-1,1)=0$、$(0,1,1)\cdot(1,-1,1)=0$ ⇒ $\mathbf C(A^{\mathsf T})\perp\mathbf N(A)$，维数和 $2+1=3$，故

$$
\mathbb R^3=\mathbf C(A^{\mathsf T})\oplus\mathbf N(A)
$$

又 $\mathbf C(A)=\mathbb R^2$、$\mathbf N(A^{\mathsf T})=\{\mathbf 0\}$，故 $\mathbb R^2=\mathbf C(A)\oplus\{\mathbf 0\}$ ✓

**答案**　如上。

**易错点**　① 把 $\mathbf C(A)$ 与 $\mathbf C(A^{\mathsf T})$ 混为一谈（一个在 $\mathbb R^2$、一个在 $\mathbb R^3$）；② 忘记 $\dim\mathbf N(A^{\mathsf T})=m-r=0$；③ 用「正交 + 维数和为 $n$」验证直和。

### 进阶题 3　（$5\times4$ 的分解）

**解**

**第 1 步：维数。** $r=3$。在 $\mathbb R^4$ 中：$\dim\mathbf C(A^{\mathsf T})=3$、$\dim\mathbf N(A)=4-3=1$；在 $\mathbb R^5$ 中：$\dim\mathbf C(A)=3$、$\dim\mathbf N(A^{\mathsf T})=5-3=2$。

**第 2 步：两个分解。**

$$
\mathbb R^4=\mathbf C(A^{\mathsf T})\oplus\mathbf N(A)\ (3+1),\qquad \mathbb R^5=\mathbf C(A)\oplus\mathbf N(A^{\mathsf T})\ (3+2)
$$

**第 3 步：正交对象。** $\mathbf N(A)$ 中的向量与 $\mathbf C(A^{\mathsf T})$ 正交，而 $\mathbf C(A^{\mathsf T})$ 由 $A$ 的**三个线性无关的行**（转置成列）张成。故 $\mathbf N(A)$ 的每个向量与 $A$ 的**三个无关行向量**都正交（等价地：与 $A$ 的全部行正交）。

**答案**　如上。

### 进阶题 4　（正交分解）

**解**

**第 1 步：单位向量。** $\mathbf q=(1,1,1)^{\mathsf T}/\sqrt3$。

**第 2 步：投影。**

$$
\mathbf x_V=\left(\mathbf x\cdot\mathbf q\right)\mathbf q=\frac{9}{\sqrt3}\cdot\frac{(1,1,1)^{\mathsf T}}{\sqrt3}=(3,3,3)^{\mathsf T}
$$

**第 3 步：正交部分。** $\mathbf x_{V^\perp}=\mathbf x-\mathbf x_V=(-1,0,1)^{\mathsf T}$；验算 $(-1,0,1)\cdot(1,1,1)=0$ ✓

**第 4 步：勾股。** $\lVert\mathbf x\rVert^2=4+9+16=29$；$\lVert\mathbf x_V\rVert^2=27$；$\lVert\mathbf x_{V^\perp}\rVert^2=2$；$27+2=29$ ✓

**答案**　$\mathbf x_V=(3,3,3)^{\mathsf T}$、$\mathbf x_{V^\perp}=(-1,0,1)^{\mathsf T}$。

### 思考题 5　（反对称矩阵）

**解**

**第 1 步：$x^{\mathsf T}Ax=0$。** 它是数，等于自己的转置：

$$
x^{\mathsf T}Ax=\left(x^{\mathsf T}Ax\right)^{\mathsf T}=x^{\mathsf T}A^{\mathsf T}x=-x^{\mathsf T}Ax\ \Longrightarrow\ x^{\mathsf T}Ax=0
$$

**第 2 步：$\mathbf C(A)\perp\mathbf N(A)$。** 取 $\mathbf y=A\mathbf x\in\mathbf C(A)$、$\mathbf z\in\mathbf N(A)$，则

$$
\mathbf y^{\mathsf T}\mathbf z=\left(A\mathbf x\right)^{\mathsf T}\mathbf z=\mathbf x^{\mathsf T}A^{\mathsf T}\mathbf z=-\mathbf x^{\mathsf T}A\mathbf z=0
$$

（用了 $A\mathbf z=\mathbf 0$ 与 $A^{\mathsf T}=-A$。）故 $\mathbf C(A)\perp\mathbf N(A)$（因 $\mathbf N(A^{\mathsf T})=\mathbf N(-A)=\mathbf N(A)$）。

**第 3 步：对角元为零。** $a_{ii}=-a_{ii}\Rightarrow a_{ii}=0$。

**第 4 步：奇数阶不可逆。**

$$
\det A=\det A^{\mathsf T}=\det(-A)=(-1)^n\det A=-\det A\ \Longrightarrow\ \det A=0
$$

**答案**　$\mathbf C(A)\perp\mathbf N(A)$；对角元全为 $0$；奇数阶 $\det A=0$ 故不可逆。

### 思考题 6　（正交子空间的维数）

**解**

**第 1 步：交为零。** 若 $\mathbf z\in V\cap W$，则 $\mathbf z\perp\mathbf z\Rightarrow\lVert\mathbf z\rVert^2=0\Rightarrow\mathbf z=\mathbf 0$。故 $V+W$ 是直和：

$$
\dim(V+W)=\dim V+\dim W\le n
$$

**第 2 步：严格小于的例子。** $\mathbb R^3$ 中 $V=\operatorname{span}\{\mathbf e_1\}$、$W=\operatorname{span}\{\mathbf e_2\}$：$\dim V+\dim W=2<3$。

**第 3 步：等于 $n$ 时。** 若 $\dim V+\dim W=n$，则 $\dim(V+W)=n$，故 $V+W=\mathbb R^n$；又 $W\subseteq V^\perp$ 且 $\dim V^\perp=n-\dim V=\dim W$，故 $W=V^\perp$。$\blacksquare$

### 思考题 7　（法方程必有解）

**解**

**第 1 步：关键结论。** $\mathbf C(A^{\mathsf T}A)=\mathbf C(A^{\mathsf T})$（由 3-5 思考题 5：$\operatorname{rank}(A^{\mathsf T}A)=\operatorname{rank}(A)$，且 $\mathbf C(A^{\mathsf T}A)\subseteq\mathbf C(A^{\mathsf T})$）。

**第 2 步：$A^{\mathsf T}\mathbf b$ 的位置。** 显然 $A^{\mathsf T}\mathbf b\in\mathbf C(A^{\mathsf T})$，故 $A^{\mathsf T}\mathbf b\in\mathbf C(A^{\mathsf T}A)$。

**第 3 步：结论。** 存在 $\hat{\mathbf x}$ 使 $A^{\mathsf T}A\hat{\mathbf x}=A^{\mathsf T}\mathbf b$，即法方程**一定有解**（不唯一时由伪逆给最小范数解）。这解释了为什么最小二乘总有解、即使 $A$ 的列相关。$\blacksquare$

## 4-2 投影与投影矩阵（7 题）

| 题号 | 结论 |
|---|---|
| 基础 1 | $\mathbf p=(2,2,2)^{\mathsf T}$，$P=\frac13J$ |
| 基础 2 | $(0,-1,1)^{\mathsf T}$ |
| 进阶 3 | 列无关；$P=\frac13\begin{bmatrix}2&-1&1\\-1&2&1\\1&1&2\end{bmatrix}$ |
| 进阶 4 | $P_1+P_2=\operatorname{diag}(1,1,0)$；$P_1P_2=P_2P_1=O$ |
| 思考 5–7 | 见解析 |

### 基础题 1　（到直线的投影）

**解**

**第 1 步：系数。** $\mathbf b\cdot\mathbf a=6$、$\mathbf a\cdot\mathbf a=3$，故

$$
\mathbf p=\frac{6}{3}(1,1,1)^{\mathsf T}=(2,2,2)^{\mathsf T}
$$

**第 2 步：投影矩阵。** $P=\frac{\mathbf a\mathbf a^{\mathsf T}}{\mathbf a^{\mathsf T}\mathbf a}=\frac13J$。

**第 3 步：验证。** $P^2=\frac19J^2=\frac19\cdot3J=P$ ✓；$\operatorname{tr}P=\frac{3}{3}=1$ ✓（投影秩为 $1$）。

**答案**　$\mathbf p=(2,2,2)^{\mathsf T}$、$P=\frac13J$。

### 基础题 2　（到平面的投影）

**解**

**第 1 步：法向量。** $\mathbf n=(1,1,1)^{\mathsf T}$。

**第 2 步：用 $P=I-\frac{\mathbf n\mathbf n^{\mathsf T}}{\mathbf n^{\mathsf T}\mathbf n}$。** $\frac{\mathbf n\mathbf n^{\mathsf T}}{3}\mathbf x=\frac{6}{3}\mathbf n=(2,2,2)^{\mathsf T}$，故

$$
P\mathbf x=(2,1,3)^{\mathsf T}-(2,2,2)^{\mathsf T}=(0,-1,1)^{\mathsf T}
$$

**第 3 步：验算。** 坐标和 $0-1+1=0$ ✓ 在平面上；残差 $(2,1,3)-(0,-1,1)=(2,2,2)$ 与 $\mathbf n$ 平行 ✓（正是法向分量）。

**答案**　$(0,-1,1)^{\mathsf T}$。

### 进阶题 3　（列无关情形）

**解**

**第 1 步：无关性。** 两列 $(1,0,1)$、$(2,1,3)$ 不成比例 ⇒ **线性无关**（故无需找主元列）。

**第 2 步：$A^{\mathsf T}A$。**

$$
A^{\mathsf T}A=\begin{bmatrix}2&5\\5&14\end{bmatrix},\qquad\left(A^{\mathsf T}A\right)^{-1}=\frac13\begin{bmatrix}14&-5\\-5&2\end{bmatrix}
$$

**第 3 步：投影矩阵。**

$$
P=A\left(A^{\mathsf T}A\right)^{-1}A^{\mathsf T}=\frac13\begin{bmatrix}2&-1&1\\-1&2&1\\1&1&2\end{bmatrix}
$$

**第 4 步：验证。** $\operatorname{tr}P=2$（= 列数，因列满秩）✓；$P^2=P$ 可直接乘验。

**答案**　列无关；$P$ 如上。

### 进阶题 4　（两个投影之和）

**解**

**第 1 步：写出。** $P_1=\operatorname{diag}(1,0,0)$、$P_2=\operatorname{diag}(0,1,0)$。

**第 2 步：相加。**

$$
P_1+P_2=\operatorname{diag}(1,1,0)
$$

它对称、幂等（$\operatorname{diag}(1,1,0)^2=\operatorname{diag}(1,1,0)$），是投影到 $xy$ 平面（$\operatorname{span}\{\mathbf e_1,\mathbf e_2\}$）的投影矩阵 ✓

**第 3 步：乘积。**

$$
P_1P_2=O=P_2P_1
$$

**答案**　$P_1+P_2=\operatorname{diag}(1,1,0)$（投影到 $xy$ 平面）；$P_1P_2=O$ 成立，但 $P_1P_2\ne P_2P_1$ **不成立**（两者都为零，恰好交换）。一般两个投影不必交换，本例坐标投影恰好交换。

### 思考题 5　（$Q=2P-I$ 是反射）

**解**

**第 1 步（$\Rightarrow$）。** $P^{\mathsf T}=P$、$P^2=P$：

$$
Q^{\mathsf T}=2P^{\mathsf T}-I=2P-I=Q,\qquad Q^2=4P^2-4P+I=4P-4P+I=I
$$

**第 2 步（$\Leftarrow$）。** 设 $Q^{\mathsf T}=Q$、$Q^2=I$，令 $P=\frac{Q+I}{2}$：

$$
P^{\mathsf T}=\frac{Q^{\mathsf T}+I}{2}=P,\qquad P^2=\frac{Q^2+2Q+I}{4}=\frac{I+2Q+I}{4}=P
$$

**第 3 步：几何意义。**

$$
Q\mathbf x=2P\mathbf x-\mathbf x=\mathbf x_V-\mathbf x_{V^\perp}
$$

即把 $\mathbf x$ 关于子空间 $V$ 做**镜面反射**：$V$ 内分量不变、法向分量反号。$\blacksquare$

### 思考题 6　（投影不放大长度）

**解**

**第 1 步：正交分解。** $\mathbf b=P\mathbf b+(I-P)\mathbf b$。又

$$
\left(P\mathbf b\right)^{\mathsf T}(I-P)\mathbf b=\mathbf b^{\mathsf T}\left(P-P^2\right)\mathbf b=0
$$

故两部分正交。

**第 2 步：勾股。**

$$
\lVert\mathbf b\rVert^2=\lVert P\mathbf b\rVert^2+\lVert(I-P)\mathbf b\rVert^2\ge\lVert P\mathbf b\rVert^2
$$

**第 3 步：等号条件。** 等号 $\iff\lVert(I-P)\mathbf b\rVert=0\iff\mathbf b=P\mathbf b\iff\mathbf b\in\mathbf C(P)$。$\blacksquare$

### 思考题 7　（列满秩投影矩阵的秩与特征值）

**解**

**第 1 步：$\operatorname{rank}(P)=n$。** 由 $PA=A$ 得

$$
\operatorname{rank}(A)=\operatorname{rank}(PA)\le\operatorname{rank}(P)
$$

又 $P$ 是 $m\times m$、$\operatorname{rank}(P)\le\operatorname{rank}(A)=n$，故 $\operatorname{rank}(P)=n$。

**第 2 步：$\det P=0$（$m>n$）。** $P$ 是 $m$ 阶而秩 $n<m$ ⇒ 奇异 ⇒ $\det P=0$。

**第 3 步：非零特征值。** $P$ 是到 $n$ 维子空间 $\mathbf C(A)$ 的正交投影，其特征值为 $1$（$n$ 重，对应 $\mathbf C(A)$）与 $0$（$m-n$ 重，对应 $\mathbf C(A)^\perp$）。故非零特征值全为 $1$。$\blacksquare$

## 4-3 最小二乘逼近（5 题）

| 题号 | 结论 |
|---|---|
| 练习 1 | $\hat{\mathbf x}=\left(\frac23,\frac53\right)$、$\mathbf p=\left(\frac73,\frac23,\frac53\right)$ |
| 练习 2 | $m=\frac12$、$c=\frac16$、SSE $=\frac16$ |
| 练习 3 | $\hat{\mathbf x}=\mathbf 0$；最佳近似就是零 |
| 练习 4 | 三条结论都成立 |
| 练习 5 | 第三列 $=2\times$ 第二列 ⇒ $A^{\mathsf T}A$ 必奇异 |

### 练习 1　（标准最小二乘）

**解**

**第 1 步：法方程。**

$$
A^{\mathsf T}A=\begin{bmatrix}2&1\\1&2\end{bmatrix},\qquad A^{\mathsf T}\mathbf b=\begin{bmatrix}3\\4\end{bmatrix}
$$

**第 2 步：求解。**

$$
\hat{\mathbf x}=\frac13\begin{bmatrix}2&-1\\-1&2\end{bmatrix}\begin{bmatrix}3\\4\end{bmatrix}=\begin{bmatrix}\frac23\\[1mm]\frac53\end{bmatrix}
$$

**第 3 步：投影。**

$$
\mathbf p=A\hat{\mathbf x}=\left(\frac73,\ \frac23,\ \frac53\right)^{\mathsf T}
$$

**第 4 步：验证正交。** $\hat{\mathbf e}=\mathbf b-\mathbf p=\left(-\frac43,\frac43,\frac43\right)^{\mathsf T}$，

$$
A^{\mathsf T}\hat{\mathbf e}=\begin{bmatrix}1&1&0\\1&0&1\end{bmatrix}\hat{\mathbf e}=\begin{bmatrix}-\frac43+\frac43\\-\frac43+\frac43\end{bmatrix}=\begin{bmatrix}0\\0\end{bmatrix}
$$

✓

**答案**　如上。

### 练习 2　（拟合直线）

**解**

**第 1 步：建模。** $y=c+mt$，故

$$
A=\begin{bmatrix}1&0\\1&1\\1&2\end{bmatrix},\qquad \mathbf b=\begin{bmatrix}0\\1\\1\end{bmatrix}
$$

**第 2 步：法方程。**

$$
A^{\mathsf T}A=\begin{bmatrix}3&3\\3&5\end{bmatrix},\qquad A^{\mathsf T}\mathbf b=\begin{bmatrix}2\\3\end{bmatrix}
$$

**第 3 步：求解。** $3c+3m=2$、$3c+5m=3$ ⇒ $2m=1\Rightarrow m=\frac12$，$c=\frac16$。

**第 4 步：残差。** 拟合 $y=\frac16+\frac t2$：$t=0$ 给 $\frac16$（残差 $\frac16$）、$t=1$ 给 $\frac23$（残差 $\frac13$）、$t=2$ 给 $\frac76$（残差 $-\frac16$）。故

$$
\text{SSE}=\frac1{36}+\frac19+\frac1{36}=\frac16
$$

**第 5 步：图像。** 直线过 $(0,\frac16)$、$(1,\frac23)$、$(2,\frac76)$：在第一个点上方、第二个点下方、第三个点上方——中间点被「拉低」最多。

**答案**　$m=\frac12$、$c=\frac16$、SSE $=\frac16$。

### 练习 3　（$\mathbf b\perp\mathbf C(A)$）

**解**

**第 1 步：$A^{\mathsf T}\mathbf b=\mathbf 0$。** 因 $\mathbf b\perp\mathbf C(A)$ 而 $\mathbf C(A)$ 由列张成，故 $\mathbf b$ 与每列正交。

**第 2 步：法方程。** $A^{\mathsf T}A\hat{\mathbf x}=\mathbf 0$；由 $\mathbf N(A^{\mathsf T}A)=\mathbf N(A)=\{\mathbf 0\}$ 得

$$
\hat{\mathbf x}=\mathbf 0
$$

**第 3 步：几何意义。** $\mathbf b$ 本身已垂直列空间，故它在 $\mathbf C(A)$ 上的投影是零向量——「最佳近似」只能是 $\mathbf 0$，残差就是 $\mathbf b$ 本身。$\blacksquare$

### 练习 4　（列标准正交）

**解**

**第 1 步：(a)** $A^{\mathsf T}A=I$ ⇒ 法方程化为 $\hat{\mathbf x}=A^{\mathsf T}\mathbf b$。

**第 2 步：(b)** 代入投影公式：

$$
P=A\left(A^{\mathsf T}A\right)^{-1}A^{\mathsf T}=AA^{\mathsf T}
$$

**第 3 步：(c)** $\hat{\mathbf e}=\mathbf b-A\hat{\mathbf x}$，

$$
\lVert\hat{\mathbf e}\rVert^2=\lVert\mathbf b\rVert^2-2\mathbf b^{\mathsf T}A\hat{\mathbf x}+\lVert A\hat{\mathbf x}\rVert^2=\lVert\mathbf b\rVert^2-2\lVert\hat{\mathbf x}\rVert^2+\lVert\hat{\mathbf x}\rVert^2=\lVert\mathbf b\rVert^2-\lVert A^{\mathsf T}\mathbf b\rVert^2
$$

（用了 $\lVert A\hat{\mathbf x}\rVert^2=\hat{\mathbf x}^{\mathsf T}A^{\mathsf T}A\hat{\mathbf x}=\lVert\hat{\mathbf x}\rVert^2$ 与 $\hat{\mathbf x}=A^{\mathsf T}\mathbf b$。）$\blacksquare$

### 练习 5　（共线参数）

**解**

**第 1 步：列的关系。** 设计矩阵的三列是 $\mathbf 1$、$\mathbf t$、$2\mathbf t$，第三列恰为第二列的 $2$ 倍。

**第 2 步：$A^{\mathsf T}A$ 奇异。** 列相关 ⇒ $\operatorname{rank}A<3$ ⇒ $\det(A^{\mathsf T}A)=0$（因 $\operatorname{rank}(A^{\mathsf T}A)=\operatorname{rank}A$）⇒ 法方程不唯一。

**第 3 步：真正的参数个数。** 只有 $2$ 个独立参数：

$$
c_1+c_2t+c_3(2t)=c_1+\left(c_2+2c_3\right)t
$$

**第 4 步：等价参数化。** 记 $\gamma_1=c_1$、$\gamma_2=c_2+2c_3$，则 $y=\gamma_1+\gamma_2t$——$c_2$ 与 $c_3$ 只有组合 $c_2+2c_3$ 可辨识。

**答案**　第三列 $=2\times$ 第二列；2 个独立参数；$y=\gamma_1+\gamma_2t$。

## 4-4 标准正交基与 Gram–Schmidt（5 题）

| 题号 | 结论 |
|---|---|
| 练习 1 | $A$ 不是（差 $\sqrt2$）；$B,C$ 是 |
| 练习 2 | $Q,R$ 见解析；$\prod r_{kk}=1=\lvert\det A\rvert$ |
| 练习 3 | 三条都成立（等距性） |
| 练习 4 | $P^2=P=P^{\mathsf T}$；$\operatorname{tr}P=\operatorname{rank}P=n$ |
| 练习 5 | 相减抵消 ⇒ 误差放大；修正 GS 二次正交化 |

### 练习 1　（三个矩阵的正交性）

**解**

**第 1 步：$A$。** $A^{\mathsf T}A=2I\ne I$ ⇒ 不是正交矩阵（列长 $\sqrt2$）。

**第 2 步：$B$。** $B=\frac{1}{\sqrt2}A$，故 $B^{\mathsf T}B=\frac12A^{\mathsf T}A=I$ ✓ 正交。

**第 3 步：$C$。**

$$
C^{\mathsf T}C=\begin{bmatrix}\cos^2\theta+\sin^2\theta&\cos\theta\sin\theta-\sin\theta\cos\theta\\ \cdot&\sin^2\theta+\cos^2\theta\end{bmatrix}=I
$$

✓ 正交（且对称，是反射矩阵）。

**答案**　$B,C$ 正交；$A$ 不是。

### 练习 2　（Gram–Schmidt 与 $QR$）

**解**

**第 1 步：$\mathbf q_1$。** $\mathbf a_1=(1,1,1)$，$\lVert\mathbf a_1\rVert=\sqrt3$：

$$
\mathbf q_1=\frac{1}{\sqrt3}(1,1,1)^{\mathsf T}
$$

**第 2 步：$\mathbf q_2$。** $\mathbf a_2\cdot\mathbf q_1=\frac{2}{\sqrt3}$，

$$
\mathbf a_2-\frac{2}{3}(1,1,1)=\left(-\frac23,\frac13,\frac13\right),\quad\text{范数}=\frac{\sqrt6}{3}\ \Longrightarrow\ \mathbf q_2=\frac{1}{\sqrt6}(-2,1,1)^{\mathsf T}
$$

**第 3 步：$\mathbf q_3$。** $\mathbf a_3\cdot\mathbf q_1=\frac2{\sqrt3}$、$\mathbf a_3\cdot\mathbf q_2=-\frac1{\sqrt6}$，

$$
\mathbf a_3-\frac23(1,1,1)+\frac16(-2,1,1)=\left(0,-\frac12,\frac12\right),\quad\text{范数}=\frac{\sqrt2}{2}\ \Longrightarrow\ \mathbf q_3=\frac{1}{\sqrt2}(0,-1,1)^{\mathsf T}
$$

**第 4 步：$Q,R$。**

$$
Q=\begin{bmatrix}\frac1{\sqrt3}&-\frac2{\sqrt6}&0\\ \frac1{\sqrt3}&\frac1{\sqrt6}&-\frac1{\sqrt2}\\ \frac1{\sqrt3}&\frac1{\sqrt6}&\frac1{\sqrt2}\end{bmatrix},\qquad R=Q^{\mathsf T}A=\begin{bmatrix}\sqrt3&\frac2{\sqrt3}&\frac2{\sqrt3}\\0&\frac{\sqrt6}{3}&-\frac1{\sqrt6}\\0&0&\frac1{\sqrt2}\end{bmatrix}
$$

**第 5 步：对照。** $\prod r_{kk}=\sqrt3\cdot\frac{\sqrt6}{3}\cdot\frac1{\sqrt2}=1$；而 $\lvert\det A\rvert=1$ ✓

**答案**　如上。

### 练习 3　（正交变换保距）

**解**

**第 1 步：关键恒等式。** 对任意 $\mathbf z$：$\lVert Q\mathbf z\rVert^2=\mathbf z^{\mathsf T}Q^{\mathsf T}Q\mathbf z=\lVert\mathbf z\rVert^2$。

**第 2 步：(a)** 取 $\mathbf z=\mathbf x-\mathbf y$ 即得 $\lVert Q\mathbf x-Q\mathbf y\rVert=\lVert\mathbf x-\mathbf y\rVert$。

**第 3 步：(b)** $(Q\mathbf x)^{\mathsf T}(Q\mathbf y)=\mathbf x^{\mathsf T}Q^{\mathsf T}Q\mathbf y=\mathbf x^{\mathsf T}\mathbf y$。

**第 4 步：(c)** 设 $\{\mathbf v_i\}$ 标准正交，令 $\mathbf u_i=Q\mathbf v_i$。由 (b) $\mathbf u_i^{\mathsf T}\mathbf u_j=\mathbf v_i^{\mathsf T}\mathbf v_j=\delta_{ij}$，故 $\{\mathbf u_i\}$ 仍标准正交；又 $Q$ 可逆，$\{Q\mathbf v_i\}$ 仍是基。$\blacksquare$

### 练习 4　（$P=QQ^{\mathsf T}$）

**解**

**第 1 步：幂等与对称。** $Q^{\mathsf T}Q=I_n$，故

$$
P^2=QQ^{\mathsf T}QQ^{\mathsf T}=Q\left(Q^{\mathsf T}Q\right)Q^{\mathsf T}=QQ^{\mathsf T}=P,\qquad P^{\mathsf T}=QQ^{\mathsf T}=P
$$

**第 2 步：迹与秩。** 用 $\operatorname{tr}(XY)=\operatorname{tr}(YX)$：

$$
\operatorname{tr}P=\operatorname{tr}\left(QQ^{\mathsf T}\right)=\operatorname{tr}\left(Q^{\mathsf T}Q\right)=\operatorname{tr}I_n=n
$$

由 $P$ 是到 $n$ 维子空间 $\mathbf C(Q)$ 的投影，$\operatorname{rank}P=n$。$\blacksquare$

### 练习 5　（经典 GS 的数值弱点）

**解**

**第 1 步：写出第二步。** $\mathbf q_1=\mathbf a_1/\lVert\mathbf a_1\rVert$，

$$
\mathbf a_2-\left(\mathbf a_2^{\mathsf T}\mathbf q_1\right)\mathbf q_1=\mathbf a_1+\varepsilon\mathbf w-\left(\mathbf a_1^{\mathsf T}\mathbf q_1+\varepsilon\mathbf w^{\mathsf T}\mathbf q_1\right)\mathbf q_1=\varepsilon\left[\mathbf w-\left(\mathbf w^{\mathsf T}\mathbf q_1\right)\mathbf q_1\right]
$$

**第 2 步：抵消。** 主项 $\mathbf a_1$ 被完全减掉，剩下 $\varepsilon$ 量级的小向量。若 $\mathbf w$ 几乎平行于 $\mathbf q_1$，则方括号内是「两个几乎相等的向量相减」，**灾难性抵消**使相对误差被放大到 $O(\varepsilon_{\text{mach}}/\varepsilon)$ 量级；$\mathbf q_2$ 的方向因此不可靠，$\mathbf q_1^{\mathsf T}\mathbf q_2$ 可能明显偏离 $0$。

**第 3 步：修正 GS。** 在算出 $\mathbf q_2$ 后**再**减去它在 $\mathbf q_1$ 上的分量（第二次正交化）：

$$
\mathbf q_2\leftarrow\mathbf q_2-\left(\mathbf q_2^{\mathsf T}\mathbf q_1\right)\mathbf q_1
$$

这样把残留的一阶误差再压掉一个量级，使 $\lvert\mathbf q_1^{\mathsf T}\mathbf q_2\rvert$ 回到机器精度附近。$\blacksquare$

**答案**　如上。
