模拟2 解答


第1题(10分)

P_2(t) 为次数 \leqslant 2 的多项式全体构成的线性空间。对任意 f(t),g(t)\in P_2(t),定义内积

(f(t),g(t))=\int_0^1 f(t)g(t)\,\mathrm{d}t.

(1)求多项式 1-t 的长度

解:

多项式 1-t 的长度即其在上述内积下的范数:

\|1-t\|=\sqrt{(1-t,\,1-t)}=\sqrt{\int_0^1(1-t)^2\,\mathrm{d}t} =\sqrt{\int_0^1(1-2t+t^2)\,\mathrm{d}t} =\sqrt{\left[t-t^2+\frac{t^3}{3}\right]_0^1} =\sqrt{\frac{1}{3}}
\|1-t\|=\frac{1}{\sqrt{3}}

(2)记 W=\mathrm{span}\{1-t\},求 W^\perp

解:

W^\perp=\{p(t)\in P_2(t):(p(t),\,1-t)=0\}。设 p(t)=a+bt+ct^2,则

(p,\,1-t)=\int_0^1(a+bt+ct^2)(1-t)\,\mathrm{d}t =\frac{a}{2}+\frac{b}{6}+\frac{c}{12}=0,

6a+2b+c=0。该方程有 2 个自由未知量,故 \dim W^\perp=2

取两组无关整数解:

  • a=1,b=0,c=-6 \Rightarrow p_1(t)=1-6t^2
  • a=0,b=1,c=-2 \Rightarrow p_2(t)=t-2t^2

可验证 (p_1,1-t)=0(p_2,1-t)=0,且 p_1,p_2 线性无关。

W^\perp=\mathrm{span}\{1-6t^2,\;t-2t^2\}
【定义】内积空间中的长度与范数
(\cdot,\cdot) 为线性空间 V 上的内积。向量 v\in V长度范数)定义为 \|v\|=\sqrt{(v,v)}。须满足 (v,v)\geqslant 0,且 (v,v)=0\Leftrightarrow v=0。本题 (f,g)=\int_0^1 f(t)g(t)\,\mathrm{d}tP_2(t) 上的标准内积之一。
【定义】正交补 W^\perp
W 为内积空间 V 的子空间。W正交补定义为
W^\perp=\{v\in V:(v,w)=0,\;\forall w\in W\}.

W=\mathrm{span}\{u\} 为一维子空间,则 W^\perp=\{v:(v,u)=0\},即"与 u 正交"的全部向量。有 \dim W+\dim W^\perp=\dim V;本题 \dim W=1,故 \dim W^\perp=3-1=2

【方法】求正交补的步骤
① 写出 W 的生成元 u;② 设 p\in V 的一般形式(本题 p=a+bt+ct^2);③ 令 (p,u)=0 得系数齐次方程;④ 求方程基础解系,即为 W^\perp 的一组基。亦可对 \{u,1,t,t^2\} 施行 Gram–Schmidt 正交化,但直接解方程更快捷。

第2题(10分)

在线性空间 \mathbb{R}^{2\times 2} 中有下列 5 个向量:

\alpha_1=\begin{pmatrix}1&2\\1&0\end{pmatrix},\quad \alpha_2=\begin{pmatrix}-2&1\\3&1\end{pmatrix},\quad \beta_1=\begin{pmatrix}1&0\\3&0\end{pmatrix},\quad \beta_2=\begin{pmatrix}1&2\\1&2\end{pmatrix},\quad \beta_3=\begin{pmatrix}2&1\\1&1\end{pmatrix}.

V=\mathrm{span}\{\alpha_1,\alpha_2\}W=\mathrm{span}\{\beta_1,\beta_2,\beta_3\}


(1)证明:\alpha_2\in W

解:

2\times 2 矩阵按列展开为 \mathbb{R}^4 中的向量。设

\alpha_2=x_1\beta_1+x_2\beta_2+x_3\beta_3,

等价于线性方程组(按列优先向量化):

\begin{pmatrix}1&1&2\\3&1&1\\0&2&1\\0&2&1\end{pmatrix} \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix} =\begin{pmatrix}-2\\3\\1\\1\end{pmatrix}.

对增广矩阵作行化简,得

\left(\begin{array}{ccc|c} 1&1&2&-2\\ 3&1&1&3\\ 0&2&1&1\\ 0&2&1&1 \end{array}\right) \;\Longrightarrow\; \left(\begin{array}{ccc|c} 1&0&0&\dfrac{5}{4}\\[4pt] 0&1&0&\dfrac{7}{4}\\[4pt] 0&0&1&-\dfrac{5}{2}\\[4pt] 0&0&0&0 \end{array}\right),

有解。取特解 x_1=\dfrac{5}{4}x_2=\dfrac{7}{4}x_3=-\dfrac{5}{2},则

\alpha_2=\frac{5}{4}\beta_1+\frac{7}{4}\beta_2-\frac{5}{2}\beta_3\in W.

验算:

\frac{5}{4}\begin{pmatrix}1&0\\3&0\end{pmatrix} +\frac{7}{4}\begin{pmatrix}1&2\\1&2\end{pmatrix} -\frac{5}{2}\begin{pmatrix}2&1\\1&1\end{pmatrix} =\begin{pmatrix}-2&1\\3&1\end{pmatrix}=\alpha_2.

\alpha_2\in W


(2)判别 V+W 是否是直和,并说明理由

解:

V+W直和当且仅当 V\cap W=\{0\}(等价地,V+W 中每个向量分解 v+w 唯一)。

由(1),\alpha_2\in W;又 \alpha_2\in V=\mathrm{span}\{\alpha_1,\alpha_2\},故 \alpha_2\neq 0\alpha_2\in V\cap W

因此 V\cap W\neq\{0\}V+W\ \text{不是直和}

【定义】矩阵空间的向量化
\mathbb{R}^{2\times 2}\mathbb{R}^4 同构。常将矩阵 A=(a_{ij})列优先(或按行优先,须前后一致)排成 4 维列向量,从而"矩阵的线性组合问题"化为通常的线性方程组。
【定义】子空间的直和
V_1,V_2 为线性空间 V 的子空间。若 V_1+V_2 中每个向量可唯一写成 v_1+v_2v_i\in V_i),则称 V_1+V_2直和,记作 V_1\oplus V_2。等价条件:V_1\cap V_2=\{0\},或 \dim(V_1+V_2)=\dim V_1+\dim V_2
【方法】证明向量属于 \mathrm{span}\{\cdots\}
要证 \alpha\in\mathrm{span}\{\beta_1,\ldots,\beta_k\},即解 \alpha=x_1\beta_1+\cdots+x_k\beta_k。向量化后列增广矩阵作行化简:有解则属于该张成空间;无解则不属于。本题(1)行化简后无矛盾行,故 \alpha_2\in W
【性质】直和判别的快捷思路
若已找到非零向量同时属于 VW,则立即断定 V+W 不是直和,无需再算维数。本题 \alpha_2 即这样的向量。反之,要证直和,需证 V\cap W=\{0\},可解齐次方程组 x_1\alpha_1+x_2\alpha_2=y_1\beta_1+y_2\beta_2+y_3\beta_3 仅有零解。

第3题(10分)

已知 4\times 5 矩阵

A=\begin{pmatrix}1&1&4&2&8\\1&1&2&0&4\\0&0&2&2&4\\-2&-2&0&4&0\end{pmatrix},

经初等行变换,得行阶梯形

\begin{pmatrix}1&1&4&2&8\\0&0&2&2&4\\0&0&0&0&0\\0&0&0&0&0\end{pmatrix}.

(1)求 A 的满秩分解和 A^+

解:

由行阶梯形,主元在第 13 列,故 \mathrm{rank}(A)=2

继续化为行最简形:

\begin{pmatrix}1&1&0&-2&0\\0&0&1&1&2\\0&0&0&0&0\\0&0&0&0&0\end{pmatrix}.

读出列向量关系(记 c_iA 的第 i 列):

c_2=c_1,\qquad c_4=c_3-2c_1,\qquad c_5=2c_3.

取两个线性无关列作 F,系数矩阵作 G,得满秩分解 A=FGF\in\mathbb{R}^{4\times 2}G\in\mathbb{R}^{2\times 5}):

F=\begin{pmatrix}1&4\\1&2\\0&2\\-2&0\end{pmatrix},\qquad G=\begin{pmatrix}1&1&0&-2&0\\0&0&1&1&2\end{pmatrix}.

验证:FG=A

由满秩分解 A=FG,Moore–Penrose 广义逆为

A^+=G^{\mathrm T}(GG^{\mathrm T})^{-1}(F^{\mathrm T}F)^{-1}F^{\mathrm T}.

先算

GG^{\mathrm T}=\begin{pmatrix}6&-2\\-2&6\end{pmatrix},\quad (GG^{\mathrm T})^{-1}=\frac{1}{32}\begin{pmatrix}6&2\\2&6\end{pmatrix},
F^{\mathrm T}F=\begin{pmatrix}6&6\\6&24\end{pmatrix},\quad (F^{\mathrm T}F)^{-1}=\frac{1}{108}\begin{pmatrix}24&-6\\-6&6\end{pmatrix}.

代入计算,得

A^+=\begin{pmatrix} \dfrac{1}{96}&\dfrac{7}{288}&-\dfrac{1}{72}&-\dfrac{11}{144}\\[6pt] \dfrac{1}{96}&\dfrac{7}{288}&-\dfrac{1}{72}&-\dfrac{11}{144}\\[6pt] \dfrac{1}{32}&\dfrac{5}{288}&\dfrac{1}{72}&-\dfrac{1}{144}\\[6pt] \dfrac{1}{96}&-\dfrac{1}{32}&\dfrac{1}{24}&\dfrac{7}{48}\\[6pt] \dfrac{1}{16}&\dfrac{5}{144}&\dfrac{1}{36}&-\dfrac{1}{72} \end{pmatrix}.

(2)求 Ax=b 的极小范数最小二乘解,其中 b=(1,1,1,1)^{\mathrm T}

解:

\mathrm{rank}(A)=2<4,而 b\in\mathbb{R}^4,方程组一般不相容。极小范数最小二乘解为

x=A^+b.

计算:

x=\left(-\frac{1}{18},\,-\frac{1}{18},\,\frac{1}{18},\,\frac{1}{6},\,\frac{1}{9}\right)^{\mathrm T}

此时 Ax=AA^+b,为 b\mathcal{R}(A) 上的正交投影。

【定义】极小范数最小二乘解
Ax=b 不相容时,称 x最小二乘解,若它使残差 \|Ax-b\|_2 最小。最小二乘解通常不唯一;其中欧氏范数 \|x\|_2 最小者,称为极小范数最小二乘解,记为 x=A^+bA^+ 为 Moore–Penrose 广义逆)。
【定义】正交投影
W=\mathcal{R}(A)\subseteq\mathbb{R}^m。向量 b\in\mathbb{R}^mW 上的正交投影 p 满足:p\in W,且 b-p\perp W。对列空间投影,P_W=AA^+,故 p=AA^+b=Ax,即为 b\mathcal{R}(A) 上的正交投影。

(3)写出 A^+A 的 Smith 标准型

解:

先算

A^+A=\begin{pmatrix} \dfrac{3}{16}&\dfrac{3}{16}&\dfrac{1}{16}&-\dfrac{5}{16}&\dfrac{1}{8}\\[6pt] \dfrac{3}{16}&\dfrac{3}{16}&\dfrac{1}{16}&-\dfrac{5}{16}&\dfrac{1}{8}\\[6pt] \dfrac{1}{16}&\dfrac{1}{16}&\dfrac{3}{16}&\dfrac{1}{16}&\dfrac{3}{8}\\[6pt] -\dfrac{5}{16}&-\dfrac{5}{16}&\dfrac{1}{16}&\dfrac{11}{16}&\dfrac{1}{8}\\[6pt] \dfrac{1}{8}&\dfrac{1}{8}&\dfrac{3}{8}&\dfrac{1}{8}&\dfrac{3}{4} \end{pmatrix}.

A^+A 为对称幂等阵,\mathrm{rank}(A^+A)=2,特征值为 1,1,0,0,0

在域 \mathbb{R}:秩为 2,Smith 标准型为

\begin{pmatrix}1&0&0&0&0\\0&1&0&0&0\\0&0&0&0&0\\0&0&0&0&0\\0&0&0&0&0\end{pmatrix}

\mathbb{Z}A^+A 含分母,先同乘 16 化为整数矩阵

B=16\cdot A^+A=\begin{pmatrix}3&3&1&-5&2\\3&3&1&-5&2\\1&1&3&1&6\\-5&-5&1&11&2\\2&2&6&2&12\end{pmatrix}.

\mathrm{rank}(B)=2。对 B 施以初等行、列变换(只做整数加减与换行换列),化为对角形:

第 1 步:将最小非零元 1 换至 (1,1) 位——R_1\leftrightarrow R_3

B\xrightarrow{R_1\leftrightarrow R_3} \begin{pmatrix}1&1&3&1&6\\3&3&1&-5&2\\3&3&1&-5&2\\-5&-5&1&11&2\\2&2&6&2&12\end{pmatrix}.

第 2 步:以 a_{11}=1 为 pivot,消去第 1 列其余元素:

R_2\leftarrow R_2-3R_1,\;R_3\leftarrow R_3-3R_1,\;R_4\leftarrow R_4+5R_1,\;R_5\leftarrow R_5-2R_1,

再作列变换 C_2\leftarrow C_2-C_1C_4\leftarrow C_4-C_1C_5\leftarrow C_5-6C_1,得

\begin{pmatrix}1&0&3&0&0\\0&0&-8&-8&-16\\0&0&-8&-8&-16\\0&0&16&16&32\\0&0&0&0&0\end{pmatrix}.

第 3 步:在右下角子块中取最小元 8R_2\leftarrow -R_2,再 R_4\leftarrow R_4+2R_2 消去,得第二 pivot 8;继续列倍加消去同行其余元,并删去零行零列。

第 4 步:整理得

\begin{pmatrix}1&0&0&0&0\\0&8&0&0&0\\0&0&0&0&0\\0&0&0&0&0\\0&0&0&0&0\end{pmatrix}

对角元 d_1=1,\;d_2=8,满足 1\mid 8,即为 B(亦即 16\cdot A^+A)在 \mathbb{Z} 上的 Smith 标准型。


(4)求 \|e^{A^+A}\|_F

解:

A^+A 为对称幂等阵(投影阵),特征值为 1,1,0,0,0

矩阵指数与特征值同步:e^{A^+A} 的特征值为 e,e,1,1,1

A^+A 为正规阵(对称),Frobenius 范数等于特征值模长平方和的开方:

\|e^{A^+A}\|_F=\sqrt{e^2+e^2+1^2+1^2+1^2}=\sqrt{2e^2+3}\approx 4.2164.
\|e^{A^+A}\|_F=\sqrt{2e^2+3}

(亦可利用幂等性:e^{A^+A}=I+(e-1)A^+A,直接按定义求 Frobenius 范数,结果相同。)

【定义】满秩分解与 Moore–Penrose 广义逆
\mathrm{rank}(A)=r。若 A=FG,其中 F 列满秩(r 列)、G 行满秩(r 行),则称 A=FG满秩分解。其 Moore–Penrose 广义逆为
A^+=G^{\mathrm T}(GG^{\mathrm T})^{-1}(F^{\mathrm T}F)^{-1}F^{\mathrm T}.

A^+ 满足 AA^+A=AA^+AA^+=A^+,且 AA^+A^+A 均为对称幂等阵。

【定义】Smith 标准型(入门版)
对矩阵 A,允许做初等行变换初等列变换,把它化成对角矩阵 S,称为 A 的 Smith 标准型。在 \mathbb{R} 上结果恒为 \mathrm{diag}(\underbrace{1,\ldots,1}_{r},0,\ldots,0);在 \mathbb{Z} 上须先消分母化为整数阵,对角元 d_i 满足 d_1\mid d_2\mid\cdots\mid d_r
【方法】满秩分解的构造
① 对 A 作行化简得 RREF;② 主元列标出 r 个线性无关列,组成 F;③ 由列关系读出 G,使 A 的每一列都是 F 各列的线性组合,组合系数排成 G 的列;④ 验证 FG=A
【性质】A^+A 为投影阵
A^+AAA^+ 均为对称幂等阵:(A^+A)^{\mathrm T}=A^+A(A^+A)^2=A^+A。特征值只能是 01\mathrm{rank}(A^+A)=\mathrm{rank}(A)=2。故 e^{A^+A}=I+(e-1)A^+A(矩阵指数在幂等阵上可如此简化)。
【定义】Frobenius 范数(F 范数)
对矩阵 M\|M\|_F=\sqrt{\sum_{i,j}|m_{ij}|^2}=\sqrt{\mathrm{tr}(M^{\mathrm T}M)}。若 M 为正规阵(如对称阵),则 \|M\|_F=\sqrt{\sum_i|\lambda_i|^2}。本题 e^{A^+A} 对称,特征值 e,e,1,1,1,故 \|e^{A^+A}\|_F=\sqrt{2e^2+3}

第4题(10分)

已知

A=\begin{pmatrix}2&2&6&4\\1&5&15&10\\1&13&43&32\\1&9&59&68\end{pmatrix},\quad b=\begin{pmatrix}2\\1\\-1\\-2\end{pmatrix}.

(1)求 ALU 分解(L 为单位下三角阵,U 为上三角阵)

解:

用 Doolittle 方法,主元存入 U,乘数 l_{ik}=a_{ik}^{(k)}/a_{kk}^{(k)} 存入 L

消第 1 列u_{11}=2):

l_{21}=\frac{1}{2},\quad l_{31}=\frac{1}{2},\quad l_{41}=\frac{1}{2}.

更新后第 2 列主元 u_{22}=4

消第 2 列u_{22}=4):

l_{32}=\frac{12}{4}=3,\quad l_{42}=\frac{8}{4}=2.

更新后第 3 列主元 u_{33}=4

消第 3 列

l_{43}=\frac{32}{4}=8.

L=\begin{pmatrix}1&0&0&0\\[4pt]\dfrac{1}{2}&1&0&0\\[4pt]\dfrac{1}{2}&3&1&0\\[4pt]\dfrac{1}{2}&2&8&1\end{pmatrix},\quad U=\begin{pmatrix}2&2&6&4\\0&4&12&8\\0&0&4&6\\0&0&0&2\end{pmatrix}

验算:LU=A


(2)利用 LU 分解解 Ax=b

解:

Ly=b(前代),再令 Ux=y(回代)。

前代 Ly=b

\begin{cases} y_1=2,\\ y_2=1-\dfrac{1}{2}y_1=0,\\ y_3=-1-\dfrac{1}{2}y_1-3y_2=-2,\\ y_4=-2-\dfrac{1}{2}y_1-2y_2-8y_3=13. \end{cases}

回代 Ux=y

\begin{cases} x_4=\dfrac{y_4}{2}=\dfrac{13}{2},\\[6pt] x_3=\dfrac{y_3-6x_4}{4}=\dfrac{-2-39}{4}=-\dfrac{41}{4},\\[6pt] x_2=\dfrac{y_2-12x_3-8x_4}{4}=\dfrac{0+123-52}{4}=\dfrac{71}{4},\\[6pt] x_1=\dfrac{y_1-2x_2-6x_3-4x_4}{2}=\dfrac{2-\frac{71}{2}+\frac{123}{2}-26}{2}=1. \end{cases}

验算 Ax=b 成立。

x=\left(1,\;\dfrac{71}{4},\;-\dfrac{41}{4},\;\dfrac{13}{2}\right)^{\mathrm T}
【定义】LU 分解
若方阵 A 可分解为 A=LU,其中 L单位下三角阵(对角元全为 1),U上三角阵,则称该分解为 LU 分解。它把 Gauss 消元过程编码为矩阵乘法:消元乘数写入 L,消元结果写入 U
【方法】Doolittle LU 分解
k 步乘数 l_{ik}=\dfrac{a_{ik}^{(k)}}{a_{kk}^{(k)}}i>k),并更新 a_{ij}^{(k+1)}=a_{ij}^{(k)}-l_{ik}a_{kj}^{(k)}i,j>k)。主元 u_{kk}=a_{kk}^{(k)} 存入 U 对角元。无行交换时可直接按公式计算。
【方法】LU 解线性方程组
Ax=b\Leftrightarrow LUx=b。分两步:① 前代解 Ly=bL 单位下三角,逐行求 y_i);② 回代解 Ux=yU 上三角,从 x_n 逆推)。同一 A 对多个 b 只需分解一次。
【易错】前代与回代的顺序
前代按 i=1,2,\ldots,n 递增求 y_i;回代按 i=n,n-1,\ldots,1 递减求 x_i。切勿混淆。代入 Ly=b 时,y_i 仅依赖 y_1,\ldots,y_{i-1};代入 Ux=y 时,x_i 仅依赖 x_{i+1},\ldots,x_n