第 08 章
解 Ax = b:特解加零空间,以及秩决定一切
先把增广矩阵消元,零行给出可解条件;再令自由变量为零求出一个特解,加上零空间的全部向量就是通解。秩 r 与 m、n 的关系决定了解的个数。
Solving Ax = b: Particular Solution Plus Nullspace, and What Rank Decides
Eliminate the augmented matrix; zero rows give the solvability condition. Set free variables to zero for a particular solution, then add the nullspace. The relation between r, m, and n fixes the number of solutions.
篇内目录
- The complete theory of
- Timeline
- The example: same matrix as last time
- Augmented matrix and elimination
- Choose a that satisfies it
- Particular solution: set all free variables to zero
- General solution: particular plus nullspace
- Why adding is valid
- The geometry
- Rank decides the number of solutions
- Case 1: full column rank
- Case 2: full row rank
- Case 3: full rank square
- Case 4: general and
- Summary table
- Takeaways
- Check your understanding
- How it connects
这一讲要彻底解决
完整流程只有三步:
- 用消元判断是否有解;
- 若有解,求一个特解;
- 加上零空间,得到全部解。
这套结构会贯穿整门课,因为所有线性方程的解集都是「一个特解 + 零空间」。
时间轴
| 时间 | 内容 |
|---|---|
| 1:35 | 可解条件: 的关系 |
| 3:20 | 增广矩阵 |
| 6:16 | 消元后的右端 |
| 7:52 | 求特解 |
| 12:44 | 哪些是自由变量 |
| 14:16 | 回代得到特解 |
| 15:42 | 求全部解 |
| 17:17 | 特解加零空间 |
| 21:14 | 解集的几何图像 |
| 22:16 | 解集不是子空间 |
| 24:57 | 一般情形:、秩 |
| 26:14 | 主元数不超过 |
| 27:35 | 满列秩: 或 个解 |
| 28:33 | 满行秩:无穷多解 |
| 31:06 | 秩为 的例子 |
| 35:42 | 每行都有主元 |
| 37:00 | 自由变量的个数 |
| 41:54 | 可解条件 |
| 45:53 | 无穷多解的原因 |
例子:沿用上一讲的矩阵
第三行是第一行与第二行之和。对左端做「第一行 + 第二行」得到第三行,所以对右端做同样的组合,必须得到 :
这就是可解条件。下面看消元如何自动发现它。
增广矩阵与消元
第一步:,:
第二步::
最后一行是
这正是上面猜到的条件。
一句话总结: 如果左端行的某个组合得到零行,右端同一组合就必须得到零,否则方程组无解。
取一个满足条件的
取 ,因为 。消元后右端变成
方程组化为
特解:自由变量全部取零
主元列是第 1、3 列,自由变量是 。令
剩下的方程是
回代:
所以一个特解是
代回原方程可验证 。「自由变量取零」只是为了方便;任何满足方程的解都可以当特解。
通解:特解 + 零空间
上一讲求出零空间的两个特殊解:
于是全部解是
为什么可以这样加
所以零空间里的任何向量加到特解上,仍然是解。反过来,若 与 都是解,则
所以 在零空间里。通解就是特解加上零空间,没有别的。
几何图像
- 零空间是 中一个过原点的二维子空间;
- 解集是把这个平面平移到经过 。
所以解集是一个不过原点的平面,不是子空间。这也解释了为什么 ()的解集不能是向量空间:它不含零向量。
秩决定解的个数
设 是 ,秩为 。永远有
秩等于主元个数,也等于主元列数。自由变量个数是 。
情况一:满列秩
每一列都有主元,没有自由变量:
所以若 有解,解唯一;否则无解。解的个数是 0 或 1。
例子(高瘦矩阵):
两列独立,最简行阶梯形是
四个方程、两个未知数,所以并不是每个 都有解。取 (两列之和),唯一解是 。
情况二:满行秩
每一行都有主元,消元不会产生零行,因此对任意 都有解。
自由变量有 个,所以:
- 若 ,解有无穷多个;
- 若 ,退化为情况三。
例子:把上面的矩阵转置,
最简行阶梯形是 ,有两个自由变量,解总是无穷多。
情况三:满秩方阵
此时 ,矩阵可逆:
- 零空间只有零向量;
- 对每个 都有唯一解。
例子:
对任意 ,解唯一。
情况四:一般情形 且
既可能有零行(限制 ),又有自由变量(解不唯一)。因此解的个数是0 或无穷多,绝不会恰好一个。
汇总表
| 秩的条件 | 最简行阶梯形 | 解的个数 |
|---|---|---|
| 恰好 1 个 | ||
| 0 或 1 个 | ||
| 无穷多个 | ||
| 0 或无穷多个 |
一句总结:秩告诉你解的结构,矩阵的具体元素只告诉你解的具体数值。
本讲结论
- 可解条件:消元后的零行对应的右端也必须为零;等价地,。
- 特解:令所有自由变量为 ,回代求主元变量。
- 通解:,其中 取遍零空间。
- 解集是零空间的一次平移,不过原点,因此不是子空间。
- 满列秩:0 或 1 个解;满行秩:总是无穷多解;满秩方阵:恰好 1 个解;一般情形:0 或无穷多。
理解检验
1. 对 ,验证消元后的右端是 ,并求特解。
参考答案:消元两步对右端的作用是 ,,所以右端变为 。对应的方程组是
令自由变量 ,由第二式 ,代回第一式 。特解为 。
2. 为什么「特解 + 零空间」覆盖了全部解?给出两个方向的论证。
参考答案:设 是任一特解。 方向一(充分性):对任意 ,
所以每个 都是解。 方向二(必要性):若 也是解,则
即 ,也就是 。两个方向合起来说明解集恰为 ,没有遗漏。
3. 一个 矩阵可能有几个解?取决于什么?
参考答案:,所以 或 。若 (满列秩),没有自由变量,,但四个方程可能矛盾,因此解的个数是 或 。若 ,消元会出现零行,可能因右端条件不满足而无解;一旦有解,自由变量个数 ,解有无穷多个。所以可能的结果是 、 或无穷多——具体取决于秩 以及 是否落在列空间 中。
4. 一个 矩阵可能无解吗?为什么?
参考答案:可能,但只在 时。此时消元会出现零行,右端必须满足相应的相容条件,否则无解。反例:
两行相同而右端不同,显然无解。若 (满行秩),每行都有主元、没有零行,则对任意 都有解,且因 有两个自由变量,解总是无穷多。
5. 用秩的条件解释:为什么可逆方阵对每个 都有唯一解?
参考答案:可逆方阵满足 。 意味着消元不产生零行,所以任何 都不会触发矛盾,必有解; 意味着没有自由变量,零空间只有零向量,所以解唯一。两者合起来:对每个 恰有一个解 。
与前后课的关系
这一讲完成了线性方程组的完整理论。下一讲转向线性无关、基与维数,把「秩」「自由变量」「零空间维数」这些计数问题统一起来。
The complete theory of
Three steps:
- use elimination to decide whether a solution exists;
- if it does, find one particular solution;
- add the nullspace to get all solutions.
This structure recurs throughout the course, because every linear solution set is "one particular solution plus a nullspace".
Timeline
| Time | Topic |
|---|---|
| 1:35 | The condition on for solvability |
| 3:20 | The augmented matrix |
| 6:16 | The right-hand side after elimination |
| 7:52 | Finding a particular solution |
| 12:44 | Identifying the free variables |
| 14:16 | Back substitution gives the particular solution |
| 15:42 | Finding all solutions |
| 17:17 | Particular plus null space |
| 21:14 | Plotting the solution set |
| 22:16 | The solution set is not a subspace |
| 24:57 | An matrix of rank |
| 26:14 | At most pivots |
| 27:35 | Full column rank: zero or one solution |
| 28:33 | Full row rank: infinitely many solutions |
| 31:06 | An example of rank one |
| 35:42 | Every row has a pivot |
| 37:00 | Counting free variables |
| 41:54 | The solvability condition |
| 45:53 | Why the solution is always infinite |
The example: same matrix as last time
Row three is the sum of rows one and two. Applying "row one + row two" to the left side gives row three, so the same combination of the right side must give zero:
That is the solvability condition. Elimination should discover it.
Augmented matrix and elimination
Step one: , :
Step two: :
The last row reads
Exactly the predicted condition.
One-sentence summary: If a combination of the left-hand rows gives a zero row, the same combination of the right-hand side must give zero, or there is no solution.
Choose a that satisfies it
Take , since . Elimination turns the right side into
The system reduces to
Particular solution: set all free variables to zero
Pivots are in columns 1 and 3, so the free variables are . Set
The remaining equations are
Back-substitute:
So a particular solution is
Substitute into the original system to verify . Setting free variables to zero is only a convenience; any solution can serve as the particular one.
General solution: particular plus nullspace
From the previous lecture, two special nullspace vectors are
All solutions are
Why adding is valid
Conversely, if and are both solutions, then
so lies in the nullspace. The general solution is the particular solution plus the nullspace, and nothing else.
The geometry
- The nullspace is a two-dimensional subspace of through the origin;
- the solution set is that plane translated so it passes through .
So the solution set is a plane not through the origin, hence not a subspace. This is why the solution set of with cannot be a vector space: it does not contain zero.
Rank decides the number of solutions
Let be with rank . Always
Rank is the number of pivots and the number of pivot columns. The number of free variables is .
Case 1: full column rank
Every column has a pivot, so there are no free variables:
If has a solution, it is unique; otherwise there is none. Zero or one solution.
Example (tall and thin):
The two columns are independent, and the reduced form is
Four equations, two unknowns, so not every is solvable. With (the sum of the columns), the unique solution is .
Case 2: full row rank
Every row has a pivot, so elimination produces no zero rows, and every is solvable.
There are free variables, so:
- if , there are infinitely many solutions;
- if , this reduces to case 3.
Example: transpose the matrix above,
The reduced form is ; two free variables, always infinitely many solutions.
Case 3: full rank square
Now and the matrix is invertible:
- the nullspace contains only zero;
- every has exactly one solution.
Example:
For any , the solution is unique.
Case 4: general and
There can be zero rows (restricting ) and free variables (solutions not unique). So the count is zero or infinitely many, never exactly one.
Summary table
| Rank condition | Reduced form | Number of solutions |
|---|---|---|
| exactly one | ||
| zero or one | ||
| infinitely many | ||
| zero or infinitely many |
One sentence: rank tells you the structure of the solution set; the actual entries only tell you the numbers.
Takeaways
- Solvability: each zero row in the reduced form must have a zero on the right; equivalently, .
- Particular solution: set all free variables to zero and back-substitute.
- General solution: , with ranging over the nullspace.
- The solution set is a translate of the nullspace; it misses the origin, so it is not a subspace.
- Full column rank: zero or one. Full row rank: always infinitely many. Full square rank: exactly one. General: zero or infinitely many.
Check your understanding
1. For , verify that elimination produces and find the particular solution.
Reference answer: Elimination acts on the right-hand side as and , so the right side becomes . The system is
Set the free variables . The second equation gives ; back-substitution gives . So .
2. Why does "particular plus nullspace" cover every solution? Prove both directions.
Reference answer: Let be any particular solution. Sufficiency: for any ,
so every is a solution. Necessity: if is also a solution, then
so , i.e. . Together the two directions show the solution set is exactly , with nothing missing.
3. How many solutions can a matrix have? What does it depend on?
Reference answer: Here , so either or . If (full column rank) there are no free variables and , but four equations may still contradict each other, so the count is or . If , elimination produces a zero row, which may make the system inconsistent; once it is consistent, the number of free variables is , so there are infinitely many solutions. Hence the possibilities are , , or infinitely many — determined by the rank and by whether lies in the column space .
4. Can a matrix be unsolvable? Why or why not?
Reference answer: Yes, but only when . Then elimination creates a zero row, and the right-hand side must satisfy the corresponding compatibility condition. Counterexample:
The two rows coincide while the right-hand entries differ, so there is no solution. If (full row rank), every row has a pivot and no zero row appears, so every is solvable; and since there are two free variables, so the solution is always infinite.
5. Use the rank conditions to explain why an invertible square matrix has a unique solution for every .
Reference answer: An invertible square matrix has . The condition means elimination produces no zero row, so no can create a contradiction — a solution always exists. The condition means there are no free variables and the nullspace is trivial, so the solution is unique. Together: exactly one solution for every , namely .
How it connects
This lecture completes the theory of linear systems. The next turns to linear independence, bases, and dimension, unifying the counting questions around rank, free variables, and nullspace dimension.