式 5.3: \begin{equation}
\begin{cases}
2 x + 3 y = -5,\\
5 x + 2 y = 4.
\end{cases}
\end{equation}
定理(theorem) 5.1:高斯消元法则 若我们执行下列操作,线性方程组(system of linear equations)的解保持不变:
交换两行的顺序,
将某一行乘以一个常数 $\neq 0$,或
将另一行的倍数加到某一行上。
式 5.20: \begin{equation}
\begin{cases}
\begin{array}{rl}
5 &\bs x + 2 y = 4,\\
10 &\bs x + 4 y = 13.
\end{array}
\end{cases}
\end{equation}
式 5.39: \begin{equation}
\begin{cases}
x &= \class{hidden}{0 +} \frac{3}{2} t_1, \\
y &= \class{hidden}{0 + \frac{3}{2}} t_1 + t_2, \\
z &= 1 \class{hidden}{\frac{3}{2}}-t_1 + 2 t_2,
\end{cases}
\end{equation}
式 5.16: \begin{equation}
\begin{cases}
\begin{array}{rrrl}
3 & \bs x_2 - 6 & \bs x_3 = -21, \\
2 x_1 + 4 & \bs x_2 - 2 & \bs x_3 = \hid{-}16, \\
- x_1 - 7 & \bs x_2 + 2 & \bs x_3 = -27. \\
\end{array}
\end{cases}
\end{equation}
式 5.19: \begin{equation}
\begin{cases}
\begin{array}{rrrl}
2 x_1 + 4 x_2 - 2 x_3 & = 16, \\
-10 x_2 + 2 x_3 & = -38, \\
-54 x_3 & = -324.\\
\end{array}
\end{cases}
\end{equation}
定理 5.2:高斯消元法则 若我们执行下列操作,线性方程组的解保持不变:
交换两个方程的顺序,
将某个方程乘以一个常数 $\neq 0$,或
将另一个方程的倍数加到某个方程上。
式 5.53: \begin{equation}
\begin{cases}
\begin{array}{rrrll}
a_{11} x & \bsfem \, + a_{12} y & \bsfem \, + a_{13} z & \bsfem \, = b_1, & \bsfem \, \, \, (i)\\
a_{21} x & \bsfem \, + a_{22} y & \bsfem \, + a_{23} z & \bsfem \, = b_2, & \bsfem \, \, \, (ii)\\
a_{31} x & \bsfem \, + a_{32} y & \bsfem \, + a_{33} z & \bsfem \, = b_3. & \bsfem \, \, \, (iii)\\
\end{array}
\end{cases}
\end{equation}
式 5.54: \begin{equation}
\begin{cases}
\begin{array}{rrrrll}
a_{11} x & \bsfem \, + a_{12} y & \bsfem \, + a_{13} z & \bsfyra = & \bsfem b_1, & \bsfem \, \, \, (i')=(i) \\
(a_{21}+ka_{11}) x & \bsfem \, + (a_{22}+ka_{12}) y & \bsfem \, + (a_{23}+ka_{13}) z & \bsfyra = & \bsfem b_2 + k b_1, & \bsfem \, \, \, (ii') = (ii)+k(i)\\
a_{31} x & \bsfem \, + a_{32} y & \bsfem \, + a_{33} z & \bsfyra = & \bsfem b_3. & \bsfem \, \, \, (iii') = (iii) \\
\end{array}
\end{cases}
\end{equation}
式 5.56: \begin{equation}
\begin{cases}
\begin{array}{rl}
a_{11} x_1 + & \bs a_{12} x_2 + & \bs a_{13} x_3 + & \bs \ldots & \bsfem + a_{1M} x_M & \bs = b_1,\\
& \bs a'_{22} x_2 + & \bs a'_{13} x_3 + & \bs \ldots & \bsfem + a'_{2M} x_M & \bs = b'_2,\\
& \bs a'_{32} x_2 + & \bs a'_{33} x_3 + & \bs \ldots & \bsfem + a'_{3M} x_M & \bs = b'_3,\\
& & & & & \bsfem \vdots\\
& \bs a'_{N2} x_2 + & \bs a'_{N3} x_3 + & \bs \ldots & \bsfem + a'_{NM} x_M & \bs = b'_N.\\
\end{array}
\end{cases}
\end{equation}
式 5.33: \begin{equation}
\begin{cases}
\begin{array}{rrrl}
3 \sqrt{6}&\bs x + 3&\bs y + 3&\bs z = \sqrt{6},\\
& 6&\bs y + 6&\bs z = 2\sqrt{6},\\
& & &\bs 0 = 3\sqrt{6}.\\
\end{array}
\end{cases}
\end{equation}
定义(definition) 2.5:列向量记法 给定一组基(basis),$n$ 维空间中的列向量 $\vc{v}$(我们已使用 $n\in [1,2,3]$)是由 $n$ 个标量(scalar)值组成的列。这些向量(vector)的标量分量,有时也称为向量元素,可以用编号表示,即 $v_1$、$v_2$ 和 $v_3$,也可以在更方便时使用 $x$、$y$ 和 $z$ 作为下标。记法为:
\begin{gather}
\underbrace{ \vc{u} =
\begin{pmatrix} u_x
\end{pmatrix} =
\begin{pmatrix} u_1
\end{pmatrix}}_{\text{1D vector}},
\spc\spc
\underbrace{ \vc{v} =
\begin{pmatrix} v_x \\
v_y
\end{pmatrix} =
\begin{pmatrix} v_1 \\
v_2
\end{pmatrix}}_{\text{2D vector}},
\spc\spc
\\
\underbrace{ \vc{w} =
\begin{pmatrix} w_x \\
w_y \\
w_z
\end{pmatrix} =
\begin{pmatrix} w_1 \\
w_2 \\
w_3
\end{pmatrix}}_{\text{3D vector}},
\end{gather}
其中 $\vc{u} = u_x \vc{e}_1$、$\vc{v} = v_x \vc{e}_1 + v_y \vc{e}_2$ 且 $\vc{w} = w_x \vc{e}_1 + w_y \vc{e}_2 + w_z \vc{e}_3$。
式 5.67: \begin{equation}
k_1\vc{v}_1 + k_2 \vc{v}_2 + \dots + k_n \vc{v}_n = \vc{0},
\end{equation}
定义 5.2:线性无关(linear independence)与线性相关(linear dependence) 向量组 $\vc{v}_1,\dots,\vc{v}_n$ 称为线性无关,若方程
\begin{equation}
k_1\vc{v}_1 + k_2 \vc{v}_2 + \dots + k_n \vc{v}_n = \vc{0},
\end{equation}
仅 有唯一解
\begin{equation}
k_1 = k_2 = \dots = k_n =0.
\end{equation}
若存在至少一个其他解,则该向量组线性相关。
式 5.78: \begin{equation}
k_1 \begin{pmatrix}1\\
2 \\
3\end{pmatrix}
+
k_2 \begin{pmatrix}2\\
3 \\
4\end{pmatrix}
+
k_3 \begin{pmatrix}-1\\
0 \\
1\end{pmatrix}
=
\begin{pmatrix}0\\
0 \\
0\end{pmatrix}
\end{equation}
定理 5.4:线性组合(linear combination)与线性相关 向量组 $\vc{v}_1, \vc{v}_2, \dots, \vc{v}_n$ 中的一个向量 $\vc{v}_1, \vc{v}_2, \dots, \vc{v}_n$ 可表示为其余向量的线性组合,当且仅当 该向量组线性相关。
定理 2.4:二维坐标 设 $\vc{e}_1$ 和 $\vc{e}_2$ 是两个不平行的向量(均在同一平面内)。对于该平面内的每个向量 $\vc{v}$,存在唯一的坐标对 $(x,y)$,使得
\begin{equation}
\vc{v} = x\vc{e}_1 + y\vc{e}_2.
\end{equation}
(图中的向量 $\vc{v}$、$\vc{e}_1$ 和 $\vc{e}_2$ 可以拖动。)
定理 2.5:三维坐标 设 $\vc{e}_1$、$\vc{e}_2$ 和 $\vc{e}_3$ 为三个非零基向量,且不存在同时平行于这三个向量的平面。对于三维空间中的每个向量 $\vc{v}$,存在唯一的三元坐标组 $(x,y,z)$,使得
\begin{equation}
\vc{v} = x\vc{e}_1 + y\vc{e}_2 + z\vc{e}_3.
\end{equation}
定义 2.10:$\R^n$ 中的基 $\R^n$ 中的基是一组向量 $\{\vc{e}_1, \ldots, \vc{e}_m\}$,使得对于每个向量 $\vc{u}\in\R^n$,存在唯一的一组坐标 $(u_1, \ldots, u_m)$ 使得
\begin{equation}
\vc{u} = \sum_{i=1}^m u_i \vc{e}_i.
\end{equation}
定义 5.3:张成(span) $\R^n$ 中的向量组 $\{\vc{v}_1,\dots,\vc{v}_q\}$ 称为张成 $\R^n$,若方程
\begin{equation}
k_1\vc{v}_1 + k_2 \vc{v}_2 + \dots + k_q \vc{v}_q = \vc{u},
\end{equation}
对于每个 向量 $\vc{u}$ 都至少有一个解。
式 5.102: \begin{gather}
\hat{\vc{e}}_1 = x_{11} \vc{e}_1 + x_{21} \vc{e}_2,\\
\hat{\vc{e}}_2 = x_{12} \vc{e}_1 + x_{22} \vc{e}_2.
\end{gather}
式 5.104: \begin{gather}
\vc{u} = \hat{u}_1 \hat{\vc{e}}_1 + \hat{u}_2 \hat{\vc{e}}_2.\\
\end{gather}
式 5.106: \begin{gather}
\vc{u} = (x_{11} \hat{u}_1 + x_{12} \hat{u}_2 ) \vc{e}_1 + (x_{21}\hat{u}_1 + x_{22}\hat{u}_2 ) \vc{e}_2.
\end{gather}
式 5.103: \begin{gather}
\vc{u} = u_1 \vc{e}_1 + u_2 \vc{e}_2 .\\
\end{gather}
第 5 章:高斯消元法
本章介绍,这是一种求解的方法。这类方程组在处理实际问题中经常遇到,例如这个计算机视觉问题:给定物体的若干张图像,计算物体的三维模型。
图 5.1 展示了 Örebro 城堡的四张图像。利用这些图像以及另外 667 张类似图像,可以计算出
图 5.2 所示的点云。这些计算包括求解许多。是学习这类方程组的很好途径。有关此例子的更多信息,请参阅此
YouTube 视频 。
熟悉的一种方法是考察两条相交时会发生什么。
要在中描述一条,许多人首先遇到的记法之一是
\begin{equation}
y = kx + m,
\end{equation}
(5.1)
其中 $k$ 表示的斜率,$m$ 表示它与 $y$ 轴的交点。这种记法对大多数都适用,但并非对所有直线都适用。无论 $k$ 取何值,都无法表示一条完全竖直的(例如 $x=4$)。因此,在数学上更便利的记法是
\begin{equation}
ax + by + c = 0
\end{equation}
(5.2)
通常更受青睐。这种记法对所有形如 $y =kx + m$ 的都适用,只需令 $a=-k$、$b=1$ 和 $c=-m$。此外,它同样适用于竖直。例如,令 $a=1$、$b=0$ 和 $c=-4$
就表示过点 $(4,0)$ 且平行于 $y$ 轴的 $x=4$。在
图 5.3 中,我们
展示了由方程 $2x + 3y + 5 = 0$ 和
$5x+2y-4=0$ 表示的两条。
$2x+3y+5=0$ 由所有满足
$2x+3y+5=0$ 的点 $(x,y)$ 组成。同样,另一条由所有满足
$5x+2y-4=0$ 的 $(x,y)$ 对组成。两条的交点必须是同时满足两个方程的坐标 $(x,y)$。因此,要求交点,我们需要求解
方程组
\begin{equation}
\begin{cases}
2 x + 3 y = -5,\\
5 x + 2 y = 4.
\end{cases}
\end{equation}
(5.3)
上述方程组称为
的,因为它
只包含 $2 x$ 和
$3 y$ 这样的一次多项式项,而不包含 $x^2$、$xy$ 或 $y^3$ 等高次项,也不包含 $\cos x$ 或 $e^x$ 等其他项。这类
方程组有一个很好的性质:它们易于分析。例如,
若有解,则总能求出该解。若无解,例如两条平行且不重合的情况,分析过程会揭示
这一点。最后,若存在多个解,例如两条平行且重合的情况,分析过程同样会揭示这一点。
交互图 5.4 展示了当两条方程改变时,两条的交点,即诸如
(5.3) 这类的解,如何交互式地变化。
本章介绍一种称为
高斯消元法 的系统方法,用于分析和求解这类方程组。不过,
我们首先再从几个方程的例子开始。
例 5.1:
视频压缩
视频帧中的每个像素通过点亮三个子像素显示在计算机屏幕上,分别对应红、绿、蓝三色。在
图 5.5 的顶行中,这些
颜色分量在右侧分别独立展示。
可以看出,这些颜色通道(RGB)彼此相当相似,
这是因为三者都受亮度,即每个像素的整体明暗程度的影响。重复存储同一信息三次是低效的,因此 H.264 等视频编码方案并不将像素存储为 $(R, G, B)$,而是存储 $(Y, Cb, Cr)$,其中
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
Y = & \bs 0.299 & \bs R + 0.587 & \bs G + 0.114 & \bs B,\\
Cb = & \bs -0.169 & \bs R - 0.331 & \bs G + 0.500 & \bs B + 128,\\
Cr = & \bs 0.500 & \bs R - 0.419 & \bs G - 0.081 & \bs B + 128.
\end{array}
\end{cases}
\end{equation}
(5.4)
如
图 5.5 底行所示,
$Y$、$Cb$ 和 $Cr$ 通道现在彼此不那么相似了。后两个通道也显得更为“褪色”,而事实证明,这意味着可以用更少的比特来表示图像。此外,人类视觉系统对亮度(大致为 $Y$)误差的敏感度远高于
另外两个通道。这也被加以利用:以较低精度表示色度通道,从而进一步减少比特数。
解压缩时,我们需要从 $(Y, Cb, Cr)$ 恢复为
$(R, G, B)$ 以便在屏幕上显示像素。假设我们
已算出某个像素在 $(Y, Cb, Cr)$ 空间中的颜色为 $Y=180$、$Cb=80$ 和 $Cr=150$。这对应什么 $(R, G, B)$ 颜色?
答案是将 $Y$、$Cb$ 和 $Cr$ 的值代入上述方程并求解
所得的方程组,即
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
0.299 &\bs R + 0.587 &\bs G + 0.114 &\bs B = &\bs 180,\\
-0.169 &\bs R - 0.331 &\bs G + 0.500 &\bs B = &\bs -48,\\
0.500 &\bs R - 0.419 &\bs G - 0.081 &\bs B = &\bs 22.
\end{array}
\end{cases}
\end{equation}
(5.5)
例 5.2:
电子电路
对于下面的电子电路,我们希望计算
电流 $I_1$、$I_2$ 和 $I_3$。
Kirchoff 电压定律指出,沿电路中的闭合回路行进时,各电压之和等于
零。若将其应用于电路的左半部分,我们得到 $5V - I_2 1\mathrm{k}\Omega - I_2 2\mathrm{k}\Omega = 0$。若将其应用于电路的外回路,我们得到 $5V - I_3 4\mathrm{k}\Omega = 0$。最后,
可在电路中的红点处运用 Kirchoff 电流定律
得到第三个方程 $I_1 = I_2 + I_3$。总之,这
给出如下方程组
\begin{equation}
\begin{cases}
1000 I_2 + 2000 I_2 \hid{+ 4000 I_3} = 5,\\
\hid{1000 I_1 + 2000 I_2 +} 4000 I_3 = 5,\\
\hid{1000}I_1\hid{2000} -I_2\hid{4000}-I_3 = 0,\\
\end{cases}
\end{equation}
(5.6)
其中已去掉单位。由此可解出
$I_1$、$I_2$ 和 $I_3$。求解这类是本章其余部分的
主题。
例 5.3:
用三个点拟合圆
有些问题虽然,但在换元之后可以转化为方程组。这里我们用三个点拟合圆的问题来说明这一点。
圆由其圆心 $(u,v)$ 和半径 $r$ 确定。点 $(x_1,y_1)$ 在该圆上
当且仅当
\begin{equation}
(x_1-u)^2 + (y_1-v)^2 = r^2 .
\end{equation}
(5.7)
由于有 $3$ 个未知数($u$、$v$ 和 $r$),人们可能会预期需要 $3$ 个方程。
因此,也许需要三个点($(x_1,y_1)$、$(x_2,y_2)$ 和 $(x_3,y_3)$)来确定一个圆。
过三个点 $(-2,3)$、$(-1,1)$ 和 $(-1,2)$ 的圆是什么?
这给出由 3 个方程组成的方程组
\begin{equation}
\begin{cases}
(-2-u)^2 + (3-v)^2 = r^2 ,\\
(-1-u)^2 + (1-v)^2 = r^2 ,\\
(-1-u)^2 + (2-v)^2 = r^2 .\\
\end{cases}
\end{equation}
(5.8)
将方程中的平方项展开,我们得到
\begin{equation}
\begin{cases}
4+4u+u^2 + 9-6v+v^2 = r^2 ,\\
1+2u+u^2 + 1-2v+v^2 = r^2 ,\\
1+2u+u^2 + 4-4v+v^2 = r^2 .\\
\end{cases}
\end{equation}
(5.9)
整理各项后,我们有
\begin{equation}
\begin{cases}
(r^2 - u^2 - v^2) -4u +6v = 13 ,\\
(r^2 - u^2 - v^2) -2u +2v = 2 ,\\
(r^2 - u^2 - v^2) -2u +4v = 5 .\\
\end{cases}
\end{equation}
(5.10)
引入 $w = r^2-u^2-v^2$ 后,我们得到一个方程组
\begin{equation}
\begin{cases}
w -4u +6v = 13 ,\\
w -2u +2v = 2 ,\\
w -2u +4v = 5 .\\
\end{cases}
\end{equation}
(5.11)
再次注意,这个看似的问题可以转化为方程组。
求解之后,我们得到 $w$、$u$ 和 $v$ 的值,随后可利用 $w = r^2-u^2-v^2$,即 $r^2 = w+u^2+v^2$,求出半径。
上述例子见
交互图 5.7 。
例 5.4:
4000 年前的巴比伦问题
巴比伦泥板上就记载着。其中一个问题如下:
“有两块田地,总面积为 1800 平方码。一块每平方码产粮 2/3 蒲式耳,另一块每平方码产粮 1/2 蒲式耳。若总产量为 1100 蒲式耳,每块田地的面积是多少?”
为每块田地的面积引入一个变量,即第一块 $x_1$ 平方码,第二块 $x_2$ 平方码。则该问题可改写为
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
\frac{2}{3} x_1 & \bfm + & \bfm \frac{1}{2} x_2 & \bfm = 1100, \\
x_1 & \bfm + & \bfm x_2 & \bfm = 1800. \\
\end{array}
\end{cases}
\end{equation}
(5.12)
由此可解出 $x_1$、$x_2$。
求解这类是本章其余部分的主题。
求解有许多可能的方法,你
很可能以前已经学过其中一些。然而,高斯
消元法提供的是一种
始终有效 的方法。你可以
把它想象成一本食谱:只要按步骤操作,就总能得到同样的
美味佳肴。在我们的情形下,最终结果虽不可食用,但会得到一个具有
结构的方程组,因此称为方程组。
这一点可见于
图 5.8 。
尽管
图 5.8 中的方程组有 3 个
方程和 3 个未知数,但求解非常简单。原因
在于最下方的方程非常简单:两边同除以 $11$ 即可求出 $z$,从而得到 $z=\frac{-33}{11} = -3$。将这个
$z$ 的值代入倒数第二个方程,
得到 $2y + 3(-3) = -5$,即 $2y = 4$。同样,求解
$y=2$ 也很简单;现在可将 $y$ 和 $z$ 一并代入最上方方程,
得到关于 $x$ 的简单方程。
的目标是从任意方程组
出发,将其变换为方程组。这
只需运用三条简单规则,如下述
定理所示。
定理 5.1:
高斯消元法则
若我们执行下列操作,方程组的解保持不变:
交换两行的顺序,
将某一行乘以一个常数 $\neq 0$,或
将另一行的倍数加到某一行上。
此处,我们将该定理的证明推迟到
5.7.1 节 ,
届时为完整起见也会再次陈述这一定理。
作为一个例子,假设我们有如下方程组,
\begin{equation}
\begin{cases}
\begin{array}{rl}
-x + \hid{4} y =& \!\!\!\! 8,\\
2 x + 4y =& \!\!\!\!-10.
\end{array}
\end{cases}
\end{equation}
(5.13)
现在我们可以运用第二、第三条规则,将第一行
的 2 倍加到最后一行。于是得到方程组
\begin{equation}
\begin{cases}
-x + \hid{6} y = 8,\\
\hid{-x+}6y = 6,
\end{cases}
\end{equation}
(5.14)
这是一个方程组,这类方程组易于求解,正如我们
在本章前面所见。由最后一行可见
$y=1$;将其代入上方方程得到 $-x + 1 = 8$,
即 $x=-7$。
上面的例子易于求解,因为我们能使用
整数倍数。一般而言,这并不总能做到。例如考虑
\begin{equation}
\begin{cases}
2 x + 3 y = -5, \\
5 x + 2 y = 4.
\end{cases}
\end{equation}
(5.15)
要消去 $x$ 变量,我们需要将顶行乘以
$-\frac{5}{2}$ 再加到底行。由于用整数
计算比用分数更方便,更简单的方法是
将上方方程乘以 $5$、下方方程乘以 $2$,然后
相减。这在
交互图 5.9 中有详细说明。
上一步 重置 下一步
交互图 5.9:
高斯消元法的典型示例。第一步只是复制第一个方程,点击/按
下一步 即可看到。
交互图 5.9:
我们从处理最下方的方程开始。现在要消去第一个变量,此处为 $x$。
为此,我们在右侧展示一些草稿计算。我们将第一个方程复制到草稿区。
交互图 5.9:
现在我们将它乘以第二个方程中 $x$ 前的系数,此处以红色显示。
交互图 5.9:
……以及右边。接下来,我们将第二个方程复制到草稿区。
交互图 5.9:
可以看出,$x$ 前的系数等于 $(\textcolor{#00dd00}{5}\cdot 2 - \textcolor{red}{2} \cdot 5)$,即 $0$。因此我们可以重写该方程(下一步)。
交互图 5.9:
通常右侧的草稿方程是在心中计算的,因此这最后的展示就是纸上进行高斯消元法时会出现的结果。
交互图 5.9:
我们从处理最下方的方程开始。现在要消去第一个变量,此处为 $\hid{x}$。
为此,我们在右侧展示一些草稿计算。我们将第一个方程复制到草稿区。
$\Big\{\begin{array}{l} 2 x + 3 y = -5 \\ 5 x + 2 y = 4 \end{array}$
$2 x + 3 y = -5$
$\Big\{\begin{array}{rl} \class{hidden}{2 x + 3 y} & \class{hidden}{= -5} \\ \class{hidden}{11 y} & \class{hidden}{= -33} \end{array}$
$\class{hidden}{\Big\{}\begin{array}{l} 2 x + 3 y = -5 \\ \class{hidden}{5 x + 2 y = 4} \end{array}$
$2 x + 3 y = -5$
$\Big\{\begin{array}{l} 2 x + 3 y = -5 \\ \textcolor{red}{5} x + 2 y = 4 \end{array}$
$\textcolor{red}{5}\class{hidden}{(2 x + 3 y) = 5 (-5) }$
$\textcolor{red}{5}\class{hidden}{(2 x + 3 y) = 5 (-5) }$
$\class{hidden}{5}(2 x + 3 y) = \class{hidden}{5} (-5)$
$\textcolor{red}{5} (2 x + 3 y) = \textcolor{red}{5} (-5)$
$5 x + 2 y = 4$
$5 x + 2 y = 4$
$\class{hidden}{2}(5 x + 2 y) = \class{hidden}{2}(4)$
$\Big\{\begin{array}{l} \textcolor{#00dd00}{2} x + 3 y = -5 \\ 5 x + 2 y = 4 \end{array}$
$\textcolor{#00dd00}{2}$
$\textcolor{#00dd00}{2}$
$\textcolor{#00dd00}{2}\class{hidden}{(5 x + 2 y) =}\textcolor{#00dd00}{2}\class{hidden}{(4)}$
_____________________
$(\textcolor{red}{5}\cdot 2 - \textcolor{#00dd00}{2}\cdot 5) x + (\textcolor{red}{5} \cdot 3 - \textcolor{#00dd00}{2} \cdot 2) y = (\textcolor{red}{5})(-5) - \textcolor{#00dd00}{2}(4)$
$\Leftrightarrow$
$11 y = -33$
$\class{hidden}{\Big\{}\begin{align*} \class{hidden}{2 x + 3 y} & \class{hidden}{= -5} \\ 11 y & = -33 \end{align*}$
$\class{hidden}{5(2 x + 3 y) = }\textcolor{red}{5}\class{hidden}{(-5)}$
$\class{hidden}{2(5 x + 2 y) =}\textcolor{#00dd00}{2}\class{hidden}{(4)}$
$\class{hidden}{\Big\{}\begin{align*} \class{hidden}{2 x + 3 y} & \class{hidden}{= -5} \\ 11 y & = -33 \end{align*}$
$\class{hidden}{\Big\{}\begin{align*} 2 x + 3 y & = -5 \\ \class{hidden}{11 y} & \class{hidden}{= -33} \end{align*}$
$2 x + 3 y = -5$
$\textcolor{red}{5}\class{hidden}{(2 x + 3 y) = 5 (-5) }$
$\class{hidden}{5(2 x + 3 y) =}\textcolor{red}{5}\class{hidden}{(-5)}$
$5 x + 2 y = 4$
$\textcolor{#00dd00}{2}\class{hidden}{(5 x + 2 y) = 2(4)}$
$\class{hidden}{2(5 x + 2 y) =}\textcolor{#00dd00}{2}\class{hidden}{(4)}$
$\class{hidden}{\Big\{}\begin{align*} \class{hidden}{2 x + 3 y} & \class{hidden}{= -5} \\ 11 y & = -33 \end{align*}$
注意,从原方程组到
方程组(见
交互图 5.9 )这一步,并非直接
应用某一条法则。例如,我们将一行的倍数加到另一行的倍数上,而并没有这样的法则。然而,
这可以看作依次应用两条法则:先将第二行乘以 -2(法则 2),再将第一行的 5 倍加到该行上(法则 3)。这意味着
交互图 5.9
中的操作终究仍是合法的。
有时无法在下方的行中消去第一个变量,
因为它不在第一行中。例如
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
3 & \bs x_2 - 6 & \bs x_3 = -21, \\
2 x_1 + 4 & \bs x_2 - 2 & \bs x_3 = \hid{-}16, \\
- x_1 - 7 & \bs x_2 + 2 & \bs x_3 = -27. \\
\end{array}
\end{cases}
\end{equation}
(5.16)
解决办法就是简单地按第一条法则重新排列方程。
将第一个方程放到最后,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
2 & \!\!\!\!\!\! x_1 + 4 &\!\!\!\!\!\!\!x_2 - 2 &\!\!\!\!\!\!x_3 = \hid{-}16, \\
- & \!\!\!\!\!\! x_1 - 7 &\!\!\!\!\!\!x_2 + 2 &\!\!\!\!\!\!x_3 = -27, \\
& 3 &\!\!\!\!\!\!x_2 - 6 &\!\!\!\!\!\!x_3 = -21. \\
\end{array}
\end{cases}
\end{equation}
(5.17)
要消去第二行中的 $x_1$,可将其乘以
2 再加到第一行,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}\!
2 x_1 + 4&\!\!\!\!\!\!x_2 - 2&\!\!\!\!\!\!x_3 = \hid{-}16, \\
-10&\!\!\!\!\!\!x_2 + 2&\!\!\!\!\!\!x_3 = -38, \\
3&\!\!\!\!\!\!x_2 - 6&\!\!\!\!\!\!x_3 = -21. \\
\end{array}
\end{cases}
\end{equation}
(5.18)
要消去 $x_2$,我们将第二行乘以 3、最后一行
乘以 10,然后相加。得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
2 x_1 + 4 x_2 - 2 x_3 & = 16, \\
-10 x_2 + 2 x_3 & = -38, \\
-54 x_3 & = -324.\\
\end{array}
\end{cases}
\end{equation}
(5.19)
方程组现已呈结构,求 $x_3 =\frac{-324}{-54} = 6$ 很简单。将其代入第二行得到 $-10x_2 + 12 = -38$,等价于 $-10 x_2 = -50$,即 $x_2 =5$。最后,将 $x_2 = 5$ 和 $x_3 = 6$ 代入最上方方程,
得到 $2 x_1 + 20 - 12 = 16$,可化简为 $2 x_1= 8$,或直接写为 $x_1 = 4$。方程组现已求解完毕。
到目前为止,我们只遇到过恰有一个解的。情况并非总是如此,如下所示
\begin{equation}
\begin{cases}
\begin{array}{rl}
5 &\bs x + 2 y = 4,\\
10 &\bs x + 4 y = 13.
\end{array}
\end{cases}
\end{equation}
(5.20)
的解法是:将上方
方程乘以 -2 再加到第二个方程。得到
\begin{equation}
\begin{cases}
\begin{array}{rl}
5 x + 2 &\bs y = 4\\
&\bs 0 = 5
\end{array}
\end{cases}
\end{equation}
(5.21)
零永远不可能等于五,然而我们已严格遵循高斯
消元法则(
定理 5.1 )。这是因为该方程组
无解 。若我们将上方
方程乘以 2,即
\begin{equation}
\begin{cases}
10 x + 4 y = 8,\\
10 x + 4 y = 13.
\end{cases}
\end{equation}
(5.22)
这两个方程彼此矛盾。左边
完全相同,右边却
不同。因此该方程组无解。对此类方程组进行高斯
消元会得到形如
$0=5$ 的矛盾,正如我们上面遇到的那样。出现这种情形时,可以断定
该方程组无解。
$5 x + 2 y -4 = 0$
$10 x + 4 y -13 = 0$
若将
方程组 (5.20) 中的两个方程解释为两条,就能从图形上看出
发生了什么。上方方程 $5x + 2y = 4$
表示
图 5.10 中左侧的。
第二个方程 $10x + 4y = 13$ 表示最右侧的。如
图所示,这些平行,因此
永不相交 。由于交点表示解,上两条
彼此分离的平行等价于
一个无解的方程组。
无解并非唯一的特殊情况。例如,假设
我们有如下方程组,
\begin{equation}
\begin{cases}
\begin{array}{rll}
- &\bs x + &\bs y = \hid{-}8,\\
3 &\bs x - 3 &\bs y = -24.
\end{array}
\end{cases}
\end{equation}
(5.23)
通过消去第一个变量,可将第一行的 3 倍加到第二行。得到
\begin{equation}
\begin{cases}
\begin{array}{rl}
-x + y & \!\!\!\!= 8,\\
0 & \!\!\!\!= 0.
\end{array}
\end{cases}
\end{equation}
(5.24)
因此第二行化为 $0=0$,它恒为真,得不到关于
$y$ 变量的任何信息。出现这种情形时,
满足解的不止一对 $(x,y)$,而是
有许多对。要表示所有这些对,令 $y = t$。得到
\begin{equation}
\begin{cases}
\begin{array}{rl}
-x + t &\bsfyra = 8,\\
y &\bsfyra = t,\\
\end{array}
\end{cases}
\end{equation}
(5.25)
若对 $x$ 求解,得到
\begin{equation}
\begin{cases}
x = -8 + t,\\
y = \class{hidden}{-}0 + t.\\
\end{cases}
\end{equation}
(5.26)
重置 下一步
$\textcolor{#009600}{S = \begin{pmatrix} -8\\ 0 \end{pmatrix}}$
$\textcolor{#c80000}{\mathrm{\bf d} = \begin{pmatrix} 1\\ 1 \end{pmatrix}}$
$P(t) = S + \mathrm{\bf d}$
$-x + y = 8$
$3x - 3y = -24$
因此向量 $\begin{pmatrix} x\\ y \end{pmatrix}$ 可写
为 $\begin{pmatrix} -8\\ 0 \end{pmatrix} + \begin{pmatrix} 1\\ 1 \end{pmatrix}t$。如我们在
3.6.1 节 所见,这是形如 $P(t) = S+ t\mathrm{\bf d}$ 的,其中 $S = \begin{pmatrix} -8\\ 0 \end{pmatrix}$
且 $\mathrm{\bf d} = \begin{pmatrix} 1\\ 1 \end{pmatrix}$。换言
之,该方程组存在整条解。这在
交互图 5.11 中展示,其中绿点
等于点 $S$,红色箭头表示方向向量
$\mathrm{\bf d}$,所得 以黑色显示。
另一种看法是回到原方程,
\begin{equation}
\begin{cases}
\begin{array}{rll}
- &\bs x + &\bs y = \hid{-}8,\\
3 &\bs x - 3 &\bs y = -24.
\end{array}
\end{cases}
\end{equation}
(5.27)
现在,若将下方方程乘以 $-\frac{1}{3}$,得到
\begin{equation}
\begin{cases}
-x + y = 8,\\
-x + y = 8.
\end{cases}
\end{equation}
(5.28)
换言之,我们两次得到同一个方程。第二个方程
可看作只是重复我们已知的内容,即得不到新
信息。两条 $-x + y = 8$ 和 $3x - 3y =-24$ 彼此重合,即它们是同一条
。若按该交互图下方的下一步按钮,可在
交互图 5.11 中看到这一点。
事实上,这是同一条,只是 $-x +y = 8$ 和 $3x-3y=-24$
写成隐式形式,而 $P(t) = S + \mathrm{\bf d}$
写成显式形式。
现在考虑一个含三个方程和三个未知数的方程组,例
如
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
2 & \!\!\!\!\!\! x + 4 &\!\!\!\!\!\!\!y - 2 &\!\!\!\!\!\!z = \hid{-}16, \\
- & \!\!\!\!\!\! x - 7 &\!\!\!\!\!\!y + 2 &\!\!\!\!\!\!z = -27, \\
& 3 &\!\!\!\!\!\!y - 6 &\!\!\!\!\!\!z = -21. \\
\end{array}
\end{cases}
\end{equation}
(5.29)
与较小的含两个方程的方程组情形一样,这些
方程组也可作几何解释。不过在此情形中,每个
方程在三维空间中对应一个(见
3.6.2 节 )。方程组的解是三个彼此相交
的点。这在
交互图 5.12 的第一步中展示,其中每个
代表一个方程,它们交于同一点,
该点在图中为黑色。注意,按住鼠标右键并移动鼠标(Mac 上为 Ctrl 加鼠标键,或在 Mac 笔记本上用双指按压)可改变
交互图的视角。
在 iPad 上,用双指拖动可改变相机位置。
然而有时,各方程所表示的都包含同一条
,如
交互图 5.12 第二步所示。此时方程组不只有一个
解,而是有无穷多解。这些解等于图中黑色所示的。
在其他情形中,两个方程表示同一。这可能
是因为它们系数相同,或一个方程等于
另一个方程乘以常数。此时存在整个满足
这两个方程,如
交互图 5.12 第三步中虚线所示。整个
方程组的解则是该(二重)与第三个的交线。这对应整条解,如
图中实线黑色所示。
方程组有解的最后一种情形是:三个方程都表示同一,例如方程组
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
& \bs x + \!\!\!\!&\bs y + &\bs z = 1,\\
2&\bs x + 2&\bs y + 2&\bs z = 2,\\
3&\bs x + 3&\bs y + 3&\bs z = 3.\\
\end{array}
\end{cases}
\end{equation}
(5.30)
若点 $(x,y,z)$ 满足第一个方程,它也满足
第二和第三个方程,因为它们只是第一个方程
乘以 $2$ 或 $3$。因此该点也是整个
方程组的解。解因此可视化为
图 5.12 最后一步所示的整个黑色。
对于含两个方程和两个未知数的方程组,若要无解,
表示两个方程的两条必须平行,如
交互图 5.10 所示。三维
情形并非如此。例如考虑如下
方程组。
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
3 \sqrt{6}&\bs x + 3&\bs y + 3&\bs z = \sqrt{6}\\
-3 \sqrt{6}&\bs x + 3&\bs y + 3&\bs z = \sqrt{6}\\
& -6&\bs y - 6&\bs z = \sqrt{6}\\
\end{array}
\end{cases}
\end{equation}
(5.31)
容易看出这些都不平行,因为它们的
不同(且无法通过乘以常数使其相等)。三个分别为 $(3\sqrt{6}, 3, 3)$、$(-3\sqrt{6},3, 3)$ 和 $(0, -6, -6)$。然而对其实施后,很容易看出不存在解。将第一行与第二行相加可消去第一个方程中的 $x$,即
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
3 \sqrt{6}&\bs x + 3&\bs y + 3&\bs z = \sqrt{6},\\
& 6&\bs y + 6&\bs z = 2\sqrt{6},\\
& -6&\bs y - 6&\bs z = \sqrt{6}.\\
\end{array}
\end{cases}
\end{equation}
(5.32)
现在要消去 $y$,我们将最后两个方程相加,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
3 \sqrt{6}&\bs x + 3&\bs y + 3&\bs z = \sqrt{6},\\
& 6&\bs y + 6&\bs z = 2\sqrt{6},\\
& & &\bs 0 = 3\sqrt{6}.\\
\end{array}
\end{cases}
\end{equation}
(5.33)
这也消去了 $z$,并最终得到矛盾 $0 =3\sqrt{6}$,意味着不存在解。其几何形态见
图 5.13 第一步。存在满足
其中两个方程但不满足第三个方程的位置,这些
位置以虚线标出。注意,不存在同时属于三个的点,因此方程组
无解,尽管这些并不平行。
若三个彼此平行且互不重合,则无解。这见
于
图 5.13 的第二步。
一种特殊情形是两个方程表示同一,
而第三个方程表示另一个与它们平行、但不重合的。
该例见
图 5.13 的第三步,其中虚线
满足两个方程,另一个满足第三个
方程。同样,该方程组无解。
最后一种无解情形是两个
彼此平行(且互不相同)。
第三个沿两条与这两个平行相交
(在
交互图 5.13 第 4 步中以虚线标出),但不存在同时属于三个的点,因此该方程组
无解。
总之,我们可以看到,一个方程组要么有
恰有一个解,
无解,或
无穷多解。
一种特殊情形是所有方程右端均为零,如下例所示。
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
2 x_1 + 5 & \bs x_2 + 3 & \bs x_3 = 0, \\
4 x_1 + 2 & \bs x_2 +\hid{3}& \bs x_3 = 0, \\
2 x_1 - 3 & \bs x_2 - 2 & \bs x_3 = 0, \\
\end{array}
\end{cases}
\end{equation}
(5.34)
这样的方程组称为方程组,它总有
解 $x_1 = x_2 = x_3 = 0$。由于这个解非常「容易」找到,它常被称为「平凡」解。然而有时,方程组还有
除平凡解以外的解。我们用来判断是否
如此。第一步是从最下面两个方程中消去 $x_1$。对中间方程,我们取第一方程的两倍
减去第二方程。对最后一个方程,我们取第一方程
减去最后一个方程,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
2 x_1 + 5 & \bs x_2 + 3 & \bs x_3 = 0, \\
8 & \bs x_2 + 5 & \bs x_3 = 0, \\
8 & \bs x_2 + 5 & \bs x_3 = 0. \\
\end{array}
\end{cases}
\end{equation}
(5.35)
从最后两行中消去 $x_2$ 得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
2 x_1 + 5 & \bs x_2 + 3 & \bs x_3 = 0, \\
8 & \bs x_2 + 5 & \bs x_3 = 0, \\
& & \bs 0 = 0. \\
\end{array}
\end{cases}
\end{equation}
(5.36)
我们现在可令 $x_3 = t$,从而得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
2 x_1 + 5 & \bs x_2 + 3 & \bs t = 0, \\
8 & \bs x_2 + 5 & \bs t = 0, \\
& & \bs\bs x_3 = t. \\
\end{array}
\end{cases}
\end{equation}
(5.37)
解 $x_2$ 得 $x_2 = -\frac{5}{8}t$,将其代入
第一个方程得 $2 x_1 + 5 (-\frac{5}{8})t + 3 t = 0$。
这可以化简为 $x_1 = \frac{1}{16}t$。我们得到
\begin{equation}
\begin{cases}
\begin{array}{rrl}
x_1 = & \bs \frac{1}{16} & \bs t, \\
x_2 = & \bs -\frac{5}{8} & \bs t, \\
x_3 = & \bs &\bs t, \\
\end{array}
\end{cases}
\end{equation}
(5.38)
这意味着,除平凡解 $x_1 = x_2 = x_3= 0$ 外,该方程组还有无穷多解。
如我们在
3.6 节 所见,
与都可以写成隐式和显式两种形式。利用
,可以在两种
形式之间转换。回顾 $P(t_1, t_2) = S + t_1 \vc{d}_1 + t_2 \vc{d}_2$ 所表示的
是显式形式,而 $\vc{n}\cdot(P-S)=0$ 是隐式形式的。
假设我们有如下
\begin{equation}
\begin{cases}
x &= \class{hidden}{0 +} \frac{3}{2} t_1, \\
y &= \class{hidden}{0 + \frac{3}{2}} t_1 + t_2, \\
z &= 1 \class{hidden}{\frac{3}{2}}-t_1 + 2 t_2,
\end{cases}
\end{equation}
(5.39)
其中 $S = (0, 0, 1)$、$\vc{d}_1 = (\frac{3}{2}, 1, -1)$ 和 $\vc{d}_2 = (0, 1, 2)$。
我们可以用高斯
消元法消去变量 $t_1$ 和 $t_2$,将其化为显式形式。为说明如何
操作,先把方程组改写,使待消去的
变量位于最左侧,即
\begin{equation}
\begin{cases}
\frac{3}{2} &\bs t_1 \class{hidden}{+2t_2}= x,\\
&\bs t_1 \class{hidden}{2}+ t_2 = y,\\
-&\bs t_1 + 2 t_2 = z - 1.\\
\end{cases}
\end{equation}
(5.40)
为便于进行,将顶行移到底部,得到
\begin{equation}
\begin{cases}
&\bs t_1 \class{hidden}{2}+ t_2 = y,\\
-&\bs t_1 + 2 t_2 = z - 1,\\
\frac{3}{2} &\bs t_1 \class{hidden}{+2t_2}= x.\\
\end{cases}
\end{equation}
(5.41)
为消去第二行中的 $t_1$,将上面两行相加。为
消去最后一行中的 $t_1$,将第一行乘以
$\frac{3}{2}$ 后,再减去最后一行,得到
\begin{equation}
\begin{cases}
\begin{array}{rl}
t_1 + & \bsfem t_2 = y,\\
3 & \bsfem t_2 = y + z - 1,\\
\frac{3}{2} & \bsfem t_2 = \frac{3}{2}y - x.\\
\end{array}
\end{cases}
\end{equation}
(5.42)
通过从中间行减去最后一行的两倍,消去中间行中的 $t_2$,即
\begin{equation}
\begin{cases}
\begin{array}{rl}
t_1 \class{hidden}{2}+ t_2 & \bsfem = y,\\
3 t_2 & \bsfem = y + z - 1,\\
0 & \bsfem= y + z - 1 - 2(\frac{3}{2}y - x).\\
\end{array}
\end{cases}
\end{equation}
(5.43)
最后一行化简为 $2x - 2y +z - 1 = 0$,这正是方程的隐式
形式。从隐式转为显式则
更容易。令 $y=t_1$ 且 $z = t_2$,得到方程组
\begin{equation}
\begin{cases}
\begin{array}{rl}
2x - 2t_1 +t_2 + -1 &\bsfem = 0,\\
y &\bsfem = t_1,\\
z &\bsfem = t_2,
\end{array}
\end{cases}
\end{equation}
(5.44)
它可以改写为
\begin{equation}
\begin{cases}
\begin{array}{rlll}
x &\bsfem = \frac{1}{2} + t_1 -\frac{1}{2}t_2, \\
y &\bsfem = \class{hidden}{\frac{1}{2} } +t_1, \\
z &\bsfem = \class{hidden}{\frac{1}{2} + t1 \frac{1}{2}} + t_2.
\end{array}
\end{cases}
\end{equation}
(5.45)
这现在是显式形式,即 $P(t_1, t_2) = \hat{S} + t_1\hat{\vc{d}}_1 + t_2 \hat{\vc{d}}_2$,其中
$\hat{S}=(\frac{1}{2},0,0)$、$\hat{\vc{d}}_1 = (1, 1, 0)$
和 $\hat{\vc{d}}_2 = (-\frac{1}{2}, 0, 1)$。注意,这个显式
形式与我们起初的
(
式 (5.39) )并不相同,即
$\hat{S} \neq S$、$\hat{\vc{d}_1} \neq \vc{d}_1$ 和 $\hat{\vc{d}_2}\neq \vc{d}_2$。然而两者表示同一个。原因
很简单:同一个可以有多种不同的
参数化。这在
图 5.14 中有所展示,其中点 $S$ 以及向量
$\vc{d}_1$ 和 $\vc{d}_2$ 以红色标出,表示我们示例中使用的。
然而,也可以选用另一点
$\hat{S}$ 以及另外两个向量 $\hat{\vc{d}}_1$、$\hat{\vc{d}}_2$
(以蓝色标出)来表示同一个。
前面各节已给出的示例,
并在可能时给出几何解释。在
下一节中,我们将阐述高斯
消元法为何有效的理论。
5.7.1 高斯消元法则
让我们回到例子
方程组 (5.16) ,即
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
3 & \bs x_2 - 6 & \bs x_3 = -21, \\
2 x_1 + 4 & \bs x_2 - 2 & \bs x_3 = \hid{-}16, \\
- x_1 - 7 & \bs x_2 + 2 & \bs x_3 = -27. \\
\end{array}
\end{cases}
\end{equation}
(5.46)
利用,我们在
(5.19) 中得到方程组,其解为 $\vc{x} =(x_1,x_2,x_3) = (4, 5, 6)$。但我们如何确信这
也是上面原方程组的解?当然可以把解
代入验证。将解 $\vc{x}$ 代入上面的方程组得
\begin{equation}
\begin{cases}
\begin{array}{rrrrl}
3 \cdot & \bs 5 - 6 \cdot & \bs 6 = & \bstwo 15 - 36 & = -21, \\
2\cdot 4 + 4 \cdot & \bs 5 - 2 \cdot & \bs 6 = & \bstwo 8 + 20 - 12 & = \hid{-}16, \\
- 4 - 7 \cdot & \bs 5 + 2 \cdot & \bs 6 = & \bstwo -4 -35 + 12 & = -27, \\
\end{array}
\end{cases}
\end{equation}
(5.47)
结果完全吻合。然而,尽管这个具体例子已经
得到验证,我们仍希望有一个证明,说明
永远不会改变方程组的解。
此处引入蕴含 $\Rightarrow$ 与等价 $\Leftrightarrow$ 的概念很有用。
若第一个方程组的每个解
也是第二个方程组的解,我们就说第一个方程组蕴含第二个方程组。若这种关系双向成立,则称两个等价。
因此我们可以写
\begin{equation}
\begin{cases}
\begin{array}{rrrrrl}
1 x_1 & \bsfem +& \bsfem 2 x_2 & \bsfem = 1, \\
2 x_1 & \bsfem +& \bsfem 5 x_2 & \bsfem = 7, \\
\end{array}
\end{cases}
\Leftrightarrow
\begin{cases}
\begin{array}{rrrrrl}
1 x_1 & \bsfem +& \bsfem 2 x_2 & \bsfem = 1, \\
& \bsfem +& \bsfem 1 x_2 & \bsfem = 5, \\
\end{array}
\end{cases}
\end{equation}
(5.48)
来表示第二个方程组的解集与第一个方程组的解集完全相同。
但我们如何确信在对方程组进行变换时,的解不会改变?
下面的定理给出了答案;为方便读者,此处再次陈述
定理 5.1 。
定理 5.2:
高斯消元法则
若我们执行下列操作,方程组的解保持不变:
交换两个方程的顺序,
将一个方程乘以常数 $\neq 0$,或
将一个方程加上另一方程的倍数。
定理 5.2 中的第一条规则
允许交换两个方程的顺序。不难理解,简单地
重排方程顺序不会改变方程组的
解,即
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
a_{11} x & \bsfem \, + a_{12} y & \bsfem \, + a_{13} z & \bsfem \, = b_1 , \\
a_{21} x & \bsfem \, + a_{22} y & \bsfem \, + a_{23} z & \bsfem \, = b_2 ,
\end{array}
\end{cases}
\Leftrightarrow
\begin{cases}
\begin{array}{rrrl}
a_{21} x & \bsfem \, + a_{22} y & \bsfem \, + a_{23} z & \bsfem \, = b_2 , \\
a_{11} x & \bsfem \, + a_{12} y & \bsfem \, + a_{13} z & \bsfem \, = b_1 .
\end{array}
\end{cases}
\end{equation}
(5.49)
下一条规则允许我们将一个方程乘以一个不等于
$0$ 的常数。由代数可知,将方程两边
同时乘以非零常数不会改变该方程的解,
因而也不会影响方程组的解。
\begin{equation}
\begin{cases}
\begin{array}{rrrll}
a_{11} x & \bsfem \, + a_{12} y & \bsfem \, + a_{13} z & \bsfem \, = b_1 , & \bsfem \, \, \, (i) \\
a_{21} x & \bsfem \, + a_{22} y & \bsfem \, + a_{23} z & \bsfem \, = b_2 , & \bsfem \, \, \, (ii)
\end{array}
\end{cases}
\Leftrightarrow
\begin{cases}
\begin{array}{rrrll}
ka_{11} x & \bsfem \, + ka_{12} y & \bsfem \, + ka_{13} z & \bsfem \, = kb_1 , & \bsfem \, \, \, (i') = k (i)\\
a_{21} x & \bsfem \, + a_{22} y & \bsfem \, + a_{23} z & \bsfem \, = b_2 . & \bsfem \, \, \, (ii') = (ii)
\end{array}
\end{cases}
\end{equation}
(5.50)
注意,我们可以将 $(i')$ 除以 $k$ 来恢复原方程组。
因此 $(i), (i)$ 的每个解都是 $(i'), (i')$ 的解,反之亦然。
另一方面,乘以零会改变
解。例如,$(x,y) = (2, 3)$ 不满足
方程
\begin{equation}
x + y = 1, \, \, \, (i)
\end{equation}
(5.51)
但它满足方程
\begin{equation}
0\cdot (x + y) = 0 \cdot 1. \, \, \, \, (i') = 0 (i)
\end{equation}
(5.52)
此处 $(i)$ 的每个解都是 $(i')$ 的解,但 $(i')$ 的解未必都是 $(i)$ 的解。
我们无法从 $(i')$ 恢复方程 $(i)$。
第三条规则允许我们将另一行的倍数加到
某一行上。假设解 $(x, y, z)$ 满足方程组
\begin{equation}
\begin{cases}
\begin{array}{rrrll}
a_{11} x & \bsfem \, + a_{12} y & \bsfem \, + a_{13} z & \bsfem \, = b_1, & \bsfem \, \, \, (i)\\
a_{21} x & \bsfem \, + a_{22} y & \bsfem \, + a_{23} z & \bsfem \, = b_2, & \bsfem \, \, \, (ii)\\
a_{31} x & \bsfem \, + a_{32} y & \bsfem \, + a_{33} z & \bsfem \, = b_3. & \bsfem \, \, \, (iii)\\
\end{array}
\end{cases}
\end{equation}
(5.53)
将第一行的 $k$ 倍加到
第二行,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrrll}
a_{11} x & \bsfem \, + a_{12} y & \bsfem \, + a_{13} z & \bsfyra = & \bsfem b_1, & \bsfem \, \, \, (i')=(i) \\
(a_{21}+ka_{11}) x & \bsfem \, + (a_{22}+ka_{12}) y & \bsfem \, + (a_{23}+ka_{13}) z & \bsfyra = & \bsfem b_2 + k b_1, & \bsfem \, \, \, (ii') = (ii)+k(i)\\
a_{31} x & \bsfem \, + a_{32} y & \bsfem \, + a_{33} z & \bsfyra = & \bsfem b_3. & \bsfem \, \, \, (iii') = (iii) \\
\end{array}
\end{cases}
\end{equation}
(5.54)
由于这里只使用了标准代数规则(例如,在方程两边同时加上同一常数,这不会改变
方程本身),
原
方程组 (5.53) 的解 $(x,y,z)$ 必然
也是上面
方程组 (5.54) 的解。
重要的是,我们可以将第一行 (i') 的 $-k$ 倍加到第二行 (ii'),从而从新
方程组 (5.54) 恢复原
方程组 (5.53) 。
因此
方程组 (5.54) 的每个解
也必然是上面
方程组 (5.53) 的解。
因此我们已经证明两个方程组等价。
$\square$
5.7.2 一般情形
本章已给出的示例,它们
要么无解,要么恰有一个解,要么有无穷多
解。本节将讨论一般情形,并严格
证明确实如此。
定理 5.3:
线性方程组的解
方程组要么
无解,或
恰有一个解,
无穷多解。
一个一般的 方程组形如
\begin{equation}
\begin{cases}
\begin{array}{rrrrrl}
a_{11} x_1 + & \bs a_{12} x_2 + & \bs a_{13} x_3 + & \bs \ldots + & \bs a_{1M} x_M & \bs = b_1,\\
a_{21} x_1 + & \bs a_{22} x_2 + & \bs a_{23} x_3 + & \bs \ldots + & \bs a_{2M} x_M & \bs = b_2,\\
a_{31} x_1 + & \bs a_{32} x_2 + & \bs a_{33} x_3 + & \bs \ldots + & \bs a_{3M} x_M & \bs = b_3,\\
& & & & & \bsfem \vdots\\
a_{N1} x_1 + & \bs a_{N2} x_2 + & \bs a_{N3} x_3 + & \bs \ldots + & \bs a_{NM} x_M & \bs = b_N,\\
\end{array}
\end{cases}
\end{equation}
(5.55)
其中 $a_{kl}$ 和 $b_k$ 是已知常数,$x_k$ 是未知变量。我们首先处理第一个变量 $x_1$。有两种可能情况。要么所有系数 $a_{i1}$ 都为零。那么我们就无法再对这个变量做任何操作。在
例 5.5 中我们会更详细地描述这种情况。更典型的情况是至少有一个系数 $a_{i1}$ 非零。此时,利用 的第一法则,总可以重新排列方程,化为如上且满足 $a_{11}\neq 0$ 的方程组。然后可以将 $-(a_{21}/a_{11})$ 倍的第一行加到第二行,将 $-(a_{31}/a_{11})$ 倍的第一行加到第三行,依此类推,从而除第一个方程外从所有方程中消去 $x_1$。将新的常数记为 $a'_{kl}$ 和 $b'_k$,得到
\begin{equation}
\begin{cases}
\begin{array}{rl}
a_{11} x_1 + & \bs a_{12} x_2 + & \bs a_{13} x_3 + & \bs \ldots & \bsfem + a_{1M} x_M & \bs = b_1,\\
& \bs a'_{22} x_2 + & \bs a'_{13} x_3 + & \bs \ldots & \bsfem + a'_{2M} x_M & \bs = b'_2,\\
& \bs a'_{32} x_2 + & \bs a'_{33} x_3 + & \bs \ldots & \bsfem + a'_{3M} x_M & \bs = b'_3,\\
& & & & & \bsfem \vdots\\
& \bs a'_{N2} x_2 + & \bs a'_{N3} x_3 + & \bs \ldots & \bsfem + a'_{NM} x_M & \bs = b'_N.\\
\end{array}
\end{cases}
\end{equation}
(5.56)
经过这一步,$x_1$ 前的系数仅在第一个方程中非零,或者它们全部为零。
现在,同样的程序可应用于带撇常数构成的较小方程组,即
(5.56) 中所有不涉及 $x_1$ 的行。同样有两种情况。要么所有这些方程中,我们要消去的变量 $x_2$ 的系数都为零;要么至少有一个方程中变量 $x_2$ 的系数非零。经重新排序和消元后,要么所有方程中变量 $x_2$ 的系数都为零,要么恰有一个方程中变量 $x_2$ 的系数非零。
这一过程持续进行,直到不再含有未知变量的方程。
最后,可能剩下 $0 = 0$ 型的方程。这些方程可以直接删去。
有三种可能的结果。
第一种情况是若至少有一个 $0 = \hat{b}_{i} \neq 0$ 型的方程,
则方程组无解。一个例子见
方程组 (5.33) 。
对于接下来的讨论,我们假设不属于这种情况。
第二种情况是所得方程组呈 ,即
\begin{equation}
\begin{cases}
\begin{array}{rl}
\hat{a}_{11} x_1 + & \bs \hat{a}_{12} x_2 + & \bs \hat{a}_{13} x_3 + & \bs \ldots + & \bsfem \hat{a}_{1M} x_M & \bs = \hat{b}_1,\\
& \bs \hat{a}_{22} x_2 + & \bs \hat{a}_{13} x_3 + & \bs \ldots + & \bsfem \hat{a}_{2M} x_M & \bs = \hat{b}_2,\\
& & \bs \hat{a}_{33} x_3 + & \bs \ldots + & \bsfem \hat{a}_{3M} x_M & \bs = \hat{b}_3,\\
& & & & & \bsfem \vdots\\
& & & & \bsfem \hat{a}_{MM} x_M & \bs = \hat{b}_M,\\
\end{array}
\end{cases}
\end{equation}
(5.57)
其中 $\hat{a}_{kl}$ 和 $\hat{b}_k$ 是经过一整轮高斯消元法后的常数。此时,变量 $x_M$ 可以精确求出,
这一结果又可用于从倒数第二个方程求出 $x_{M-1}$,依此类推。因此方程组有唯一解。
第三种可能是消元后方程个数少于未知数个数,例如
\begin{equation}
\begin{cases}
\begin{array}{rl}
\hat{a}_{11} x_1 + & \bs \hat{a}_{12} x_2 + & \bs \hat{a}_{13} x_3 + & \bs \hat{a}_{14} x_4 + & \bsfem \hat{a}_{15} x_M & \bs = \hat{b}_1,\\
& & \bs \hat{a}_{23} x_3 + & \bs \hat{a}_{24} x_4 + & \bsfem \hat{a}_{25} x_5 & \bs = \hat{b}_2,\\
& & & \bs \hat{a}_{34} x_4 + & \bsfem \hat{a}_{35} x_5 & \bs = \hat{b}_3.\\
\end{array}
\end{cases}
\end{equation}
(5.58)
如本例所示,有 $3$ 个方程在变量 $x_1$、$x_3$ 和 $x_4$ 前有非零首元系数,共涉及 $3$ 个变量。
事实上,其余两个变量,即 $x_2$ 和 $x_5$,没有任何约束。
于是可令 $x_2 = t_1$、$x_5 = t_2$,再求出其余变量。本例中
\begin{equation}
x_4 = \frac{1}{\hat{a}_{34}}(\hat{b}_3 -\hat{a}_{35} t_{2}) . \\
\end{equation}
(5.59)
此后,其余变量(本例中为 $x_1$ 和 $x_3$)可以求出。由于解依赖于一组变量 $\{t_1, t_2\}$,而它们可取任意值,
我们有无穷多
解。
因此,方程组要么无解,要么有唯一解,要么有无穷多解。
$\square$
注意,对于无穷多解的情形,了解解集中有多少自由变量也很有意思。换个说法,就是解集的维数是多少。这由 $\rank$ 的概念来刻画,
将在
第 8 章 中说明。
例 5.5:
系数为零
如上证明中所述,有时在进行 时,某个变量
在所有剩余方程中的系数都可能变为零。此时
可能只需跳过一步,本例即说明了这一点,
\begin{equation}
\begin{cases}
\begin{array}{rrrrrrrl}
x_1 & \bfm + & \bfm x_2 & \bfm + & \bfm 2 x_3 & \bfm + & \bfm 3 x_4 & \bfm = 1, \\
2 x_1 & \bfm + & \bfm 2 x_2 & \bfm + & \bfm 4 x_3 & \bfm + & \bfm 7 x_4 & \bfm = 1, \\
3 x_1 & \bfm + & \bfm 3 x_2 & \bfm + & \bfm 6 x_3 & \bfm + & \bfm 10 x_4 & \bfm = 2. \\
\end{array}
\end{cases}
\end{equation}
(5.60)
我们将第一方程的 $-2$ 倍加到第二方程,从而在第二 中消去 $x_1$;又将第一方程的 $-3$ 倍加到最后一个方程,从而在第三 中消去 $x_1$。于是得到
\begin{equation}
\begin{cases}
\begin{array}{rrrrrrrl}
x_1 & \bfm + & \bfm x_2 & \bfm + & \bfm 2 x_3 & \bfm + & \bfm 3 x_4 & \bfm = 1, \\
& & & & & \bfm & \bfm x_4 & \bfm = -1, \\
& & & & & \bfm & \bfm x_4 & \bfm = -1. \\
\end{array}
\end{cases}
\end{equation}
(5.61)
通常消去 $x_1$ 后,下一步会
尝试消去 $x_2$。但本例中
第二个和第三个
中 $x_2$ 前的系数都为零。于是我们直接跳过,转而处理下一个变量
$x_3$。这里也是如此,因此我们跳到最后一个变量
$x_4$。消去它后只得到方程 $0=0$,于是可将方程组改写为
\begin{equation}
\begin{cases}
\begin{array}{rrrrrrrl}
x_1 & \bfm + & \bfm x_2 & \bfm + & \bfm 2 x_3 & \bfm + & \bfm 3 x_4 & \bfm = 1, \\
& & & & & \bfm & \bfm x_4 & \bfm = -1. \\
\end{array}
\end{cases}
\end{equation}
(5.62)
由最后一个方程可见 $x_4 = -1$。我们令 $x_2 = s$ 和 $x_3 = t$,再将它们代入上方方程,
\begin{equation}
x_1 + s + 2t + 3(-1) = 1,
\end{equation}
(5.63)
由此可得
\begin{equation}
x_1 = -s - 2t + 4.
\end{equation}
(5.64)
综上所述,我们有
\begin{equation}
\begin{cases}
\begin{array}{rllll}
x_1 =& \bstre - & \bs s -2 \bs & t \bs & +4,\\
x_2 =& \bstre & \bs s, \bs & \bs & \\
x_3 =& \bstre & \bs \bs & t, \bs & \\
x_4 =& \bstre & \bs \bs & \bs & -1.\\
\end{array}
\end{cases}
\end{equation}
(5.65)
本节我们将介绍 和 ,它们是
代数中两个重要概念。不过,我们先从
开始,这是另一个也时常用到的概念。定义如下。
定义 5.1:
线性组合
向量 $\vc{u}$ 是向量 $\vc{v}_1,\dots,\vc{v}_n$ 的 ,当
$\vc{u}$ 可表示为
\begin{equation}
\vc{u} = k_1\vc{v}_1 + k_2\vc{v}_2 + \dots + k_n \vc{v}_n = \sum_{i=1}^{n} k_i \vc{v}_i,
\end{equation}
(5.66)
其中 $k_1, k_2, \dots, k_n$ 为标量值。
对于 记法
(
定义 2.5 ),例如我们曾经看到
$\vc{w}= w_x \vc{e}_1+w_y \vc{e}_2+w_z \vc{e}_3$。也就是说,
三维向量 $\vc{w}$ 是
向量 $\vc{e}_1$、$\vc{e}_2$ 和 $\vc{e}_3$ 的 ,标量值分别为 $w_x$、$w_y$ 和 $w_z$。
利用 的定义,我们现在来考察
和 的向量组。
定义 5.2:
线性无关与线性相关
向量组 $\vc{v}_1,\dots,\vc{v}_n$ 称为 ,若方程
\begin{equation}
k_1\vc{v}_1 + k_2 \vc{v}_2 + \dots + k_n \vc{v}_n = \vc{0},
\end{equation}
(5.67)
仅 有唯一解
\begin{equation}
k_1 = k_2 = \dots = k_n =0.
\end{equation}
(5.68)
若存在至少一个其他解,则该向量组 。
例 5.6:
标准基
三维 由 向量
\begin{align}
\vc{e}_x & = (1,0,0), \\
\vc{e}_y & = (0,1,0), \\
\vc{e}_z & = (0,0,1).
\end{align}
(5.69)
要判断它们是否 ,可针对此情形列出
式 (5.67) ,
\begin{equation}
k_1\vc{e}_x + k_2\vc{e}_y + k_3\vc{e}_z = \vc{0}.
\end{equation}
(5.70)
现在,若改用 记法(
定义 2.5 ),
我们得到
\begin{align}
\vc{0} &= k_1\vc{e}_x + k_2\vc{e}_y + k_3\vc{e}_z =
k_1 \begin{pmatrix}1\\ 0 \\ 0\end{pmatrix} +
k_2 \begin{pmatrix}0\\ 1 \\ 0\end{pmatrix} +
k_3 \begin{pmatrix}0\\ 0 \\ 1\end{pmatrix} \\
&=
\begin{pmatrix}k_1\\ 0 \\ 0\end{pmatrix} +
\begin{pmatrix}0\\ k_2 \\ 0\end{pmatrix} +
\begin{pmatrix}0\\ 0 \\ k_3\end{pmatrix}
= \begin{pmatrix}k_1\\ k_2 \\ k_3\end{pmatrix}.
\end{align}
(5.71)
于是得到 $(k_1, k_2, k_3) = (0,0,0)$,这证明
是 的。
定理 5.4:
线性组合与线性相关
向量组 $\vc{v}_1, \vc{v}_2, \dots, \vc{v}_n$ 中的一个向量 $\vc{v}_1, \vc{v}_2, \dots, \vc{v}_n$ 可表示为其余向量的 ,当且仅当 该向量组 。
由 的定义
(
定义 5.2 )
可知,若向量组 ,则方程
\begin{equation}
k_1\vc{v}_1 + k_2\vc{v}_2 + \dots + k_n \vc{v}_n = \vc{0}
\end{equation}
(5.72)
有解,其中至少有一个 $k_1, k_2, \dots k_n$ 不为
零。假设最后一个值 $k_n$ 就是这样一个非零
值。(我们总可以通过重新编号指标使之为真。)
于是可将第 $n$ 项移到另一边
\begin{equation}
k_1\vc{v}_1 + k_2\vc{v}_2 + \dots + k_{n-1} \vc{v}_{n-1} = - k_n \vc{v}_n,
\end{equation}
(5.73)
由于 $k_n$ 不为零,我们可以除以 $-k_n$ 并交换两边,得到
\begin{equation}
\vc{v}_n = -\frac{k_1}{k_n}\vc{v}_1 - \dots - \frac{k_{n-1}}{k_n} \vc{v}_{n-1}.
\end{equation}
(5.74)
可见,我们已将向量 $\vc{v}_n$ 写成了其余向量的 。
反向证明更简单。假设其中一个向量可表示为其余向量的 。重新编号后,设它为向量 $\vc{v}_n$。于是得到
\begin{equation}
\vc{v}_n = a_1\vc{v}_1 + a_2\vc{v}_2 + \dots + a_{n-1} \vc{v}_{n-1}.
\end{equation}
(5.75)
将 $\vc{v}_n$ 项移到另一边,得到
\begin{equation}
0 = a_1\vc{v}_1 + a_2\vc{v}_2 + \dots + a_{n-1} \vc{v}_{n-1} - 1\vc{v}_n,
\end{equation}
(5.76)
再取 $k_1 = a_1, k_2 = a_2, \dots k_{n-1} = a_{n-1}, k_n = -1$,我们就得到该方程的一个解
\begin{equation}
k_1\vc{v}_1 + k_2\vc{v}_2 + \dots + k_{n-1} \vc{v}_{n-1} - k_n\vc{v}_n = 0
\end{equation}
(5.77)
其中并非所有 $k_j$ 都为零,因为 $k_n$ 等于 $-1$。这意味着向量组 $\vc{v}_1, \vc{v}_2, \dots \vc{v}_n$ 是 的。
$\square$
例 5.7:
两个向量 $\vc{u} = (1, 2, 3)$ 和 $\vc{v} = (2, 4, 6)$ 是 的。这是因为 $\vc{v}$ 可据 $\vc{v} = 2\vc{u}$ 表示为 $\vc{u}$ 的 。
例 5.8:
三个向量 $\vc{u} = (1, 2, 3)$、$\vc{v} = (2, 4, 6)$ 和 $\vc{w} = (1, 0, 7)$ 是 的。这是因为 $\vc{v}$ 可据 $\vc{v} = 2\vc{u} + 0\vc{w}$ 表示为 $\vc{u}$ 和 $\vc{w}$ 的 。由此可以得出结论:向已经 的向量组中添加向量,永远不可能使新向量组变为 。
例 5.9:
单个向量 $\vc{v} = (0, 0, 0)$ 是 的。这由
定义 5.2 可得,因为 $k_1\vc{v} = \vc{0}$ 对 $k_1$ 的非零值成立,例如 $k_1 = 5$。同理,仅由一个非 组成的集合是 的。
例 5.10:
判断三个向量 $\vc{u} = (1, 2, 3)$、$\vc{v} = (2, 3, 4)$、$\vc{w} = (-1, 0, 1)$ 是否 。
没有明显办法看出这些向量是 的。例如,没有向量等于 $(0, 0, 0)$,也没有向量是另一个向量的简单倍数。我们回到定义:这些向量 ,当且仅当
\begin{equation}
k_1 \begin{pmatrix}1\\ 2 \\ 3\end{pmatrix} +
k_2 \begin{pmatrix}2\\ 3 \\ 4\end{pmatrix} +
k_3 \begin{pmatrix}-1\\ 0 \\ 1\end{pmatrix} =
\begin{pmatrix}0\\ 0 \\ 0\end{pmatrix}
\end{equation}
(5.78)
仅有解 $(k_1, k_2, k_3) = (0, 0, 0)$。现在三个分量各自给出一个方程,从而得到方程组
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ k_3 \bsfem & = 0,\\
2 k_1 \bsfem & + \ 3 k_2 \bsfem & & = 0,\\
3 k_1 \bsfem & + \ 4 k_2 \bsfem & + \ k_3 \bsfem & = 0.\\
\end{array}
\end{cases}
\end{equation}
(5.79)
从第二、第三个方程中消去 $k_1$,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ \hid{2} k_3 \bsfem & = 0,\\
& k_2 \bsfem & - \ 2 k_3 \bsfem & = 0,\\
& 2 k_2 \bsfem & - \ 4 k_3 \bsfem & = 0.\\
\end{array}
\end{cases}
\end{equation}
(5.80)
现在若我们尝试从第三个方程中消去 $k_2$,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ \hid{2} k_3 \bsfem & = 0,\\
& k_2 \bsfem & - \ 2 k_3 \bsfem & = 0,\\
& & 0 \bsfem & = 0.\\
\end{array}
\end{cases}
\end{equation}
(5.81)
该方程组是欠定的(underdetermined),有无穷多解。令 $k_3 = t$ 并代入第二个方程得 $k_2 = 2t$,再将这两个值代入第一个方程得
\begin{equation}
k_1 + \ 4 t - \ t = 0,
\end{equation}
(5.82)
可化简为 $k_1 = -3t$。由于 $t$ 可以非零,这三个向量是 的。例如取 $t = 1$,得 $k_1 = -3$、$k_2 = 2$ 和 $k_3 = 1$,代入
式 (5.78) 得
\begin{equation}
-3 \begin{pmatrix}1\\ 2 \\ 3\end{pmatrix}
+2 \begin{pmatrix}2\\ 3 \\ 4\end{pmatrix} +
1 \begin{pmatrix}-1\\ 0 \\ 1\end{pmatrix} =
\begin{pmatrix}0\\ 0 \\ 0\end{pmatrix},
\end{equation}
(5.83)
将前两个向量移到右边,可见 $\vc{w} = 3\vc{u} - 2\vc{v}$。
若我们改换最后一个向量为 $\vc{w}' = (-1, 0, 2)$,则得到如下方程组
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \hid{2}k_3 \bsfem & = 0,\\
2 k_1 \bsfem & + \ 3 k_2 \bsfem & & = 0,\\
3 k_1 \bsfem & + \ 4 k_2 \bsfem & + 2k_3 \bsfem & = 0.\\
\end{array}
\end{cases}
\end{equation}
(5.84)
消去 $k_1$ 得
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ \hid{2} k_3 \bsfem & = 0,\\
& k_2 \bsfem & - \ 2 k_3 \bsfem & = 0,\\
& 2 k_2 \bsfem & - \ 5 k_3 \bsfem & = 0.\\
\end{array}
\end{cases}
\end{equation}
(5.85)
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ \hid{2} k_3 \bsfem & = 0,\\
& k_2 \bsfem & - \ 2 k_3 \bsfem & = 0,\\
& & k_3 \bsfem & = 0.\\
\end{array}
\end{cases}
\end{equation}
(5.86)
最后一个方程给出 $k_3 = 0$,代入第二个方程得 $k_2 = 0$,再将这两个值代入最上方方程得 $k_1=0$。于是 $(k_1, k_2, k_3) = (0, 0, 0)$ 是唯一解,向量 $\vc{u}$、$\vc{v}$ 和 $\vc{w}'$ 因此是 的。
定理 5.5:
基定理
中的两个向量 $\vc{u}$ 和 $\vc{v}$ 构成一个 ,当且仅当它们 。
三维空间中的三个向量 $\vc{u}$、$\vc{v}$ 和 $\vc{w}$ 构成一个 ,当且仅当它们 。
中的三个或更多向量总是 的。
三维空间中的四个或更多向量总是 的。
前两条定理是双向的,因此我们用 $\Rightarrow$ 标记正向证明,用 $\Leftarrow$ 标记反向证明。
1 $\Rightarrow$:假设 $\vc{u}$ 和 $\vc{v}$ 。
定理 5.4 给出 $\vc{u}$ 不能表示为 $\vc{v}$ 的 ,即 $\vc{u} \neq \lambda \vc{v}$,同理 $\vc{v} \neq \lambda \vc{u}$。这意味着 $\vc{u}$ 和 $\vc{v}$ 不平行,于是由
定理 2.4 可知它们在 中构成一个 。
1 $\Leftarrow$:假设 $\vc{u}$ 和 $\vc{v}$ 在 中构成一个 。我们现在证明这意味着 $\vc{u}$ 和 $\vc{v}$ 。假设它们并非 ,却仍构成一个 ,即表达式 $x_u \vc{u} + x_v \vc{v}$ 可以到达 中的每一点。由于它们 ,
定理 5.4 指出我们可以写出 $\vc{u} = \lambda \vc{v}$ 或 $\vc{v} = \lambda\vc{u}$。进一步假设我们可以将 $\vc{u}$ 写为 $\vc{u} = \lambda \vc{v}$(这总可以通过交换 $\vc{u}$ 和 $\vc{v}$ 的标签来实现)。假设我们要用 $\vc{w} = x_u \vc{u} + x_v \vc{v}$ 在这个 下描述新向量 $\vc{w}$。这等于 $\vc{w} = x_u \lambda \vc{v} + x_v \vc{v} = (x_u \lambda + x_v) \vc{v} = \mu \vc{v}$,其中 $\mu$ 是等于 $(x_u \lambda + x_v)$ 的标量。这意味着只有与 $\vc{v}$ 平行的向量 $\vc{w}$ 才能用 $x_u \vc{u} + x_v \vc{v}$ 来描述,因此 $\vc{u}$、$\vc{v}$ 不能成为整个平面的 。
2 $\Rightarrow$:
定理 2.5 指出,若不存在同时平行于 $\vc{u}$、$\vc{v}$ 和 $\vc{w}$ 的 ,则这三个向量在空间中构成一个 。
假设存在一个与三个向量都平行的 $\pi$。由于它与 $\vc{u}$ 和 $\vc{v}$ 平行,它可以写为
\begin{equation}
\pi: \vc{p} + s\vc{u} + t\vc{v},
\end{equation}
(5.87)
其中 $\vc{p}$ 是 上的一点,$s$ 和 $t$ 是标量。若 $\pi$ 平行于 $\vc{w}$,这意味着若 中有一点 $\vc{q}$,则点 $\vc{q} + \vc{w}$ 也在该 中。$\vc{q}$ 在该 中意味着存在两个标量 $s_1$ 和 $t_1$,使得
\begin{equation}
\vc{q} = \vc{p} + s_1\vc{u} + t_1\vc{v},
\end{equation}
(5.88)
而 $\vc{q} + \vc{w}$ 在该 中意味着存在两个标量 $s_2$ 和 $t_2$,使得
\begin{equation}
\vc{q} + \vc{w} = \vc{p} + s_2\vc{u} + t_2\vc{v}.
\end{equation}
(5.89)
若我们将第一个方程从第二个方程中减去,得到
\begin{equation}
\vc{w} = (s_2-s_1)\vc{u} + (t_2-t_1)\vc{v}.
\end{equation}
(5.90)
因此 $\vc{w}$ 可表示为 $\vc{u}$ 和 $\vc{v}$ 的 ,据
定理 5.4 这意味着这些向量并非 。因此,若 $\vc{u}$、$\vc{v}$ 和 $\vc{w}$ ,则不可能存在同时平行于这三个向量的 。于是,由
定理 2.5 可知,三个 的向量 $\vc{u}$、$\vc{v}$、$\vc{w}$ 在空间中构成一个 。
2 $\Leftarrow$:假设 $\vc{u}$、$\vc{v}$ 和 $\vc{w}$ 在空间中构成一个 。我们现在证明这意味着 $\vc{u}$、$\vc{v}$ 和 $\vc{w}$ 。假设它们并非 ,却仍构成一个 ,即表达式 $x_u \vc{u} + x_v \vc{v} + x_w \vc{w}$ 可以到达空间中的每一点。由于它们 ,
定理 5.4 指出我们至少可以将其中一个向量写为另两个向量的 。设其中一个为 $\vc{u}$(否则重新命名向量),我们现在可以将 $\vc{u}$ 写为 $\vc{u} = \lambda_v \vc{v} + \lambda_w \vc{w}$。现在我们要用 $\vc{q} = x_u \vc{u} + x_v \vc{v} + x_w \vc{w}$ 在这个 下描述 $\vc{q}$。代入 $\vc{u}$ 的 表达式得 $\vc{q} = x_u (\lambda_v \vc{v} + \lambda_w \vc{w}) + x_v \vc{v} + x_w \vc{w} = (x_u \lambda + x_v) \vc{v} + (x_u \lambda_w + x_w) \vc{w} = \mu_v \vc{v} + \mu_w \vc{w}$,其中 $\mu_v$ 和 $\mu_w$ 是标量。这意味着只有与 $\vc{v}$ 和 $\vc{w}$ 所张成的 平行的向量 $\vc{q}$ 才能用 $x_u \vc{u} + x_v \vc{v} + x_w \vc{w}$ 来描述,因此 $\vc{u}$、$\vc{v}, \vc{w}$ 不能成为整个的 。
因此,它们 。
3:假设 $\vc{u}$、$\vc{v}$ 和 $\vc{w}$ 是 中的向量。先考察 $\vc{u}$ 和 $\vc{v}$。若它们 ,即平行,则整个向量组 $\vc{u}$、$\vc{v}$、$\vc{w}$ 也 ,证明完毕。然而,若 $\vc{u}$ 和 $\vc{v}$ ,则据 (1) 它们在 中构成一个 。这意味着 $\vc{w}$ 可表示为
4:第 4 条的证明与第 3 条相同。
\begin{equation}
\vc{w} = \lambda_1 \vc{u} + \lambda_2 \vc{v}
\end{equation}
(5.91)
对某个 $\lambda_1, \lambda_2$。这可以写为
\begin{equation}
\lambda_1 \vc{u} + \lambda_2 \vc{v} + (-1)\vc{w} = 0
\end{equation}
(5.92)
据
定义 5.2 ,这意味着三个向量 ,因为 $k_1 = \lambda_1$、$k_2 = \lambda_2$、$k_3 = -1$ 满足
式 (5.67) 。
$\square$
本节将介绍张成的概念。在讨论一组向量作为 能“占据”向量空间的多少时,这一概念很有用。我们从定义开始。
定义 5.3:
张成
$\R^n$ 中的向量组 $\{\vc{v}_1,\dots,\vc{v}_q\}$ 称为张成 $\R^n$,若方程
\begin{equation}
k_1\vc{v}_1 + k_2 \vc{v}_2 + \dots + k_q \vc{v}_q = \vc{u},
\end{equation}
(5.93)
对于
每个 向量 $\vc{u}$ 都至少有一个解。
例 5.11:
判断三个向量 $\vc{u} = (1, 2, 3)$、$\vc{v} = (2, 3, 4)$ 和 $\vc{w} = (-1, 0, 1)$ 是否张成 $\R^3$。
我们利用定义来检验
\begin{equation}
k_1 \begin{pmatrix}1\\ 2 \\ 3\end{pmatrix} +
k_2 \begin{pmatrix}2\\ 3 \\ 4\end{pmatrix} +
k_3 \begin{pmatrix}-1\\ 0 \\ 1\end{pmatrix} =
\begin{pmatrix}u_1\\ u_2 \\ u_3\end{pmatrix}
\end{equation}
(5.94)
对于每个 $\vc{u}= (u_1, u_2, u_3)$ 都至少有一个解。
现在三个分量各自给出一个方程,从而得到方程组
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ k_3 \bsfem & = u_1,\\
2 k_1 \bsfem & + \ 3 k_2 \bsfem & & = u_2,\\
3 k_1 \bsfem & + \ 4 k_2 \bsfem & + \ k_3 \bsfem & = u_3.\\
\end{array}
\end{cases}
\end{equation}
(5.95)
从第二、第三个方程中消去 $k_1$,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ \hid{2} k_3 \bsfem & = u_1,\\
& k_2 \bsfem & - \ 2 k_3 \bsfem & = 2u_1-u_2,\\
& 2 k_2 \bsfem & - \ 4 k_3 \bsfem & = 3 u_1-u_3.\\
\end{array}
\end{cases}
\end{equation}
(5.96)
现在若我们尝试从第三个方程中消去 $k_2$,得到
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ \hid{2} k_3 \bsfem & = u_1,\\
& k_2 \bsfem & - \ 2 k_3 \bsfem & = 2 u_1-u_2,\\
& & 0 \bsfem & = u_1-2 u_2+u_3.\\
\end{array}
\end{cases}
\end{equation}
(5.97)
该方程组并非对每个 $\vc{u} = (u_1, u_2, u_3)$ 都有解。事实上,只有当向量落在 $u_1-2 u_2+u_3 = 0$ 所定义的 中时才有解。因此这三个向量不张成 $\R^3$。
若我们改换最后一个向量为 $\vc{w}' = (-1, 0, 2)$,则得到如下方程组
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \hid{2}k_3 \bsfem & = u_1,\\
2 k_1 \bsfem & + \ 3 k_2 \bsfem & & = u_2,\\
3 k_1 \bsfem & + \ 4 k_2 \bsfem & + 2k_3 \bsfem & = u_3.\\
\end{array}
\end{cases}
\end{equation}
(5.98)
消去 $k_1$ 得
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ \hid{2} k_3 \bsfem & = u_1,\\
& k_2 \bsfem & - \ 2 k_3 \bsfem & = 2 u_1-u_2,\\
& 2 k_2 \bsfem & - \ 5 k_3 \bsfem & = 3 u_1-u_3.\\
\end{array}
\end{cases}
\end{equation}
(5.99)
\begin{equation}
\begin{cases}
\begin{array}{rrrl}
k_1 \bsfem & + \ 2 k_2 \bsfem & - \ \hid{2} k_3 \bsfem & = u_1,\\
& k_2 \bsfem & - \ 2 k_3 \bsfem & = 2 u_1-u_2,\\
& & k_3 \bsfem & = u_1-2 u_2+u_3.\\
\end{array}
\end{cases}
\end{equation}
(5.100)
该方程对所有 $\vc{u} = (u_1, u_2, u_3)$ 都可解。因此这三个向量张成 $\R^3$。
最后一个方程给出 $k_3 = u_1-2 u_2+u_3$,代入第二个方程得 $k_2 = 4u_1-5u_2+2u_3$,再将这两个值代入最上方方程得 $k_1=-6 u_1 + 8 u_2 - 3 u_3$。于是我们得到唯一解
\begin{equation}
\begin{cases}
\begin{array}{lrrr}
k_1 & = -6 u_1 \bsfem & + \ 8 u_2 \bsfem & - \ 3 u_3 & \bsfem\\
k_2 & = 4 u_1 \bsfem & - \ 5 u_2 \bsfem & + \ 2 u_3 & \bsfem\\
k_3 & = \hid{1} u_1 \bsfem & - \ 2 u_2 \bsfem & + \ \hid{1} u_3 & \bsfem\\
\end{array}
\end{cases}
\end{equation}
(5.101)
对每个 $\vc{u} = (u_1, u_2, u_3)$ 都成立。
定理 5.6:
基的条件
向量组 $\{\vc{u}_1, \vc{u}_2, \ldots, \vc{u}_k\}$ 是 $\R^n$ 中的 ,当且仅当这些向量 且张成 $\R^n$。
假设向量组 $\vc{u}_1, \vc{u}_2, \ldots, \vc{u}_q$ 是 $\R^n$ 的 。则据
定义 2.10 ,对每个 $\vc{u}$,方程
$k_1\vc{v}_1 + k_2 \vc{v}_2 + \dots + k_q \vc{v}_q= \vc{u}$ 都有解,因此据
定义 5.3 这些向量张成 $\R^n$。
要证明这些向量 ,我们注意到方程
$ \sum_{i=1}^q k_i \vc{v}_i = \vc{0}$ 有一个解 $k_1=0, k_2=0, \ldots, k_q=0$。据 的定义
(
定义 2.10 ),该解是唯一的。这证明这些向量 。
为完成反向证明,我们假设向量组 $\vc{u}_1, \vc{u}_2, \ldots, \vc{u}_q$
张成 $\R^n$ 且 。我们需要证明
$\sum_{i=1}^q k_i \vc{v}_i = \vc{u}$ 对每个 $\vc{u}$ 都恰有一个解。由于这些向量张成 $\R^n$,对每个 $\vc{u}$ 都至少有一个解。假设有两个解 $(k_1, k_2, \ldots, k_q)$ 和
$(k^\prime_1, k^\prime_2, \ldots, k^\prime_q)$。若我们将方程
$\sum_{i=1}^q k^\prime_i \vc{v}_i = \vc{u}$ 从 $\sum_{i=1}^q k_i \vc{v}_i = \vc{u}$ 中减去,得到
$\sum_{i=1}^q (k_i-k^\prime_i) \vc{v}_i = \vc{0}$。由于这些向量 (
定义 5.2 ),我们有
$(k_i-k^\prime_i) = 0$,但这给出 $k_i=k^\prime_i$,因此两个解相同。
$\square$
假设我们在 中有一个 ,即两个不平行 向量 $\vc{e}_1$ 和 $\vc{e}_2$。
此外,假设我们还有另一对不平行向量 $\hat{\vc{e}}_1, \hat{\vc{e}}_2$,它们也构成一个 。
正如我们上面所见,这两个向量现在可以用前两个向量表示为
\begin{gather}
\hat{\vc{e}}_1 = x_{11} \vc{e}_1 + x_{21} \vc{e}_2,\\
\hat{\vc{e}}_2 = x_{12} \vc{e}_1 + x_{22} \vc{e}_2.
\end{gather}
(5.102)
现在取任意向量 $\vc{u}$,它可以用第一个 以坐标 $(u_1, u_2)$ 表示为
\begin{gather}
\vc{u} = u_1 \vc{e}_1 + u_2 \vc{e}_2 .\\
\end{gather}
(5.103)
同一向量也可以用第二个 以坐标 $(\hat{u}_1, \hat{u}_2)$ 表示为
\begin{gather}
\vc{u} = \hat{u}_1 \hat{\vc{e}}_1 + \hat{u}_2 \hat{\vc{e}}_2.\\
\end{gather}
(5.104)
将
式 (5.102) 代入
式 (5.104) ,得到
\begin{gather}
\vc{u} = \hat{u}_1 (x_{11} \vc{e}_1 + x_{21} \vc{e}_2) + \hat{u}_2 (x_{12} \vc{e}_1 + x_{22} \vc{e}_2),
\end{gather}
(5.105)
可以整理为
\begin{gather}
\vc{u} = (x_{11} \hat{u}_1 + x_{12} \hat{u}_2 ) \vc{e}_1 + (x_{21}\hat{u}_1 + x_{22}\hat{u}_2 ) \vc{e}_2.
\end{gather}
(5.106)
然而,由于给定 下向量的坐标是唯一确定的,
式 (5.106) 中 $\vc{e}_1$ 前的数 $(x_{11} \hat{u}_1 + x_{12} \hat{u}_2)$ 必须与
式 (5.103) 中 $\vc{e}_1$ 前的数 $u_1$ 相同,$u_2$ 亦然。这总结为
\begin{gather}
u_1 = x_{11} \hat{u}_1 + x_{12} \hat{u}_2, \\
u_2 = x_{21}\hat{u}_1 + x_{22}\hat{u}_2.
\end{gather}
(5.107)
因此请注意,
式 (5.102) 中 向量之间关系的方程与
上面坐标之间的方程类似,但有两个重要区别:帽号换到了另一边,行变成了
列(例如行 $x_{11} x_{12}$ 变成了列)。
我们将在
第 6 章 中回到 变换,该章讨论矩阵这一主题。
弹出帮助:
$n$ 维列向量 $\vc{v}$ 是相对于一组表示的,由 $n$ 个标量值组成的列构成。向量元素有时记作 $v_1$、$v_2$、…、$v_n$。对于二维和三维向量,有时也使用 $v_x$、$v_y$ 和 $v_z$。记法为
\begin{equation}
\underbrace{
\vc{u} =
\begin{pmatrix}
u_x
\end{pmatrix}
=
\begin{pmatrix}
u_1
\end{pmatrix}}_{\text{1D vector}},
\spc\spc
\underbrace{
\vc{v} =
\begin{pmatrix}
v_x \\
v_y
\end{pmatrix}
=
\begin{pmatrix}
v_1 \\
v_2
\end{pmatrix}}_{\text{2D vector}},
\spc\spc
\underbrace{
\vc{w} =
\begin{pmatrix}
w_x \\
w_y \\
w_z
\end{pmatrix}
=
\begin{pmatrix}
w_1 \\
w_2 \\
w_3
\end{pmatrix}}_{\text{3D vector}},
\end{equation}
其中 $\vc{u} = u_x \vc{e}_1$、$\vc{v} = v_x \vc{e}_1 + v_y \vc{e}_2$ 和 $\vc{w} = w_x \vc{e}_1 + w_y \vc{e}_2 + w_z \vc{e}_3$。注意 $\vc{e}_i$ 是向量。
在我们的行文中,也使用简写记法 $\vc{w} = \bigl(w_1,w_2,w_3\bigr)$,其含义与上式相同(注意向量元素之间的逗号)。不过行向量的元素之间没有逗号。
弹出帮助:
$n$ 维的标准有向量 $\vc{e}_i$,其元素全为零,只有第 $i$ 个元素为一。例如对于 $n=2$,有 $\vc{e}_1=(1,0)$ 和 $\vc{e}_2=(0,1)$;对于 $n=3$,有 $\vc{e}_1=(1,0,0)$、$\vc{e}_2=(0,1,0)$ 和 $\vc{e}_3=(0,0,1)$。像往常一样,我们有时用 $\vc{e}_x$、$\vc{e}_y$ 和 $\vc{e}_z$ 代替 $\vc{e}_1$、$\vc{e}_2$ 和 $\vc{e}_3$。