📚 The Inverse Matrix by Gaussian Elimination | 用高斯消元法求逆矩阵
s of linear equations, computer graphics, and data science. Gaussian elimination (or Gauss– d 3×3 matrices, the underlying row operations, and what happens when a matrix is singular.
求一个方阵的逆矩阵是线性代数中的一项基本运算,在求解线性方程组、计算机图形学和数据科学中具有广泛的应用。高斯消元法(或称高斯–若尔当消元法)提供了一种系统的方法,通过将矩阵与单位矩阵一起化为简化行阶梯形,来求出逆矩阵(如果存在)。本复习指南将逐步讲解求逆过程,涵盖2×2和3×3矩阵,底层行操作,以及当矩阵是奇异矩阵时的情况。
1. What is a Matrix Inverse? | 什么是逆矩阵?
For a square matrix A of size n × n, its inverse is denoted by A⁻¹ and satisfies the equation A A⁻¹ = A⁻¹ A = I, where I is the n × n identity matrix. Not all square matrices have an inverse; a matrix that possesses an inverse is called invertible or non‑singular. The inverse essentially reverses the transformation represented by A.
对于一个 n × n 的方阵 A,其逆矩阵记作 A⁻¹,满足 A A⁻¹ = A⁻¹ A = I,其中 I 是 n × n 的单位矩阵。不是所有方阵都有逆矩阵;拥有逆矩阵的矩阵称为可逆矩阵或非奇异矩阵。逆矩阵实质上逆转了 A 所代表的变换。
we want to isolate a variable in a matrix equation, for instance in solving AX = B for X.
如果把矩阵看作将一个向量映射到另一个向量,那么乘上逆矩阵就能将向量恢复到原来的位置。当我们需要在矩阵方程中解出某个变量时(例如从 AX = B 解出 X),这一性质至关重要。
2. Gaussian and Gauss–Jordan Elimination | 高斯消元法与高斯–若尔当消元法
Gaussian elimination transforms a matrix into row echelon form by forward elimination, and then back‑substitution can be used to solve a system. Gauss–Jordan elimination goes one step further: it uses additional row operations to obtain reduced row echelon form (RREF), where every leading entry is 1 and is the only non‑zero entry in its column. When we attach the identity matrix and reach RREF, the right half automatically becomes A⁻¹.
高斯消元法通过前向消元将矩阵化为行阶梯形,然后可以用回代法求解方程组。高斯–若尔当消元法则更进一步:它使用额外的行变换得到简化行阶梯形(RREF),其中每个主元都是1,且是其所在列中唯一的非零元素。当我们将单位矩阵附加在右侧并化为 RREF 时,右侧部分自动变成 A⁻¹。
The process essentially records all the elementary row operations that turn A into I; those same operations applied to I produce the inverse. This is why the augmented matrix method is so powerful.
这个过程本质上记录了将 A 变成 I 的所有初等行变换;把这些相同的操作施加到单位矩阵上就得到了逆矩阵。这就是增广矩阵方法如此强大的原因。
3. The Augmented Matrix [A | I] | 增广矩阵 [A | I]
The starting point for finding the inverse by elimination is to write the square matrix A and the identity matrix of the same size side by side, separated by a vertical line. This combined array is called the augmented matrix, typically denoted [A | I].
用消元法求逆矩阵的起点,是将方阵 A 与同阶的单位矩阵并排写在一起,中间用一条竖线隔开。这个组合阵列称为增广矩阵,通常记作 [A | I]。
For a 2×2 matrix A = [[a, b], [c, d]], the augmented matrix is:
对于 2×2 矩阵 A = [[a, b], [c, d]],增广矩阵为:
| a | b | 1 | 0 |
| c | d | 0 | 1 |
The goal is to perform row operations until the left block becomes the identity matrix. The right block will then be A⁻¹.
目标是通过行变换使左侧分块变成单位矩阵。届时右侧分块就是 A⁻¹。
4. Elementary Row Operations | 初等行变换
There are three types of elementary row operations that are allowed because they do not change the solution set of the associated linear system, and they preserve the equivalence of the augmented matrix:
共有三种允许使用的初等行变换,因为它们不改变相关线性方程组的解集,并且保持增广矩阵的等价性:
- Swap two rows (Rᵢ ↔ Rⱼ).
- Multiply a row by a non‑zero constant (Rᵢ → kRᵢ, k ≠ 0).
- Add a multiple of one row to another row (Rᵢ → Rᵢ + kRⱼ).
- 交换两行 (Rᵢ ↔ Rⱼ)。
- 将一行乘以一个非零常数 (Rᵢ → kRᵢ, k ≠ 0)。
- 将一行的倍数加到另一行上 (Rᵢ → Rᵢ + kRⱼ)。
These operations are applied to the entire row of the augmented matrix, affecting both the A block and the I block simultaneously. The sequence of operations must bring the left block from A all the way to I.
这些操作施加于增广矩阵的整行,同时影响 A 分块和 I 分块。这一连串操作必须将左侧分块从 A 一路化为 I。
5. Worked Example: 2×2 Matrix | 解题示例:2×2 矩阵
Let A = [[2, 1], [5, 3]]. First write the augmented matrix [A | I]:
设 A = [[2, 1], [5, 3]]。首先写出增广矩阵 [A | I]:
| 2 | 1 | 1 | 0 |
| 5 | 3 | 0 | 1 |
Step 1: Make the top‑left entry 1 by multiplying row 1 by 1/2.
步骤1:将第一行乘以 1/2,使左上角元素变为1。
R₁ → (1/2)R₁: [1, 0.5 | 0.5, 0]
Step 2: Eliminate the 5 below the pivot by subtracting 5 times the new row 1 from row 2.
步骤2:用行2减去5倍的新行1,消去主元下方的5。
R₂ → R₂ − 5R₁: [0, 0.5 | −2.5, 1]
Step 3: Scale row 2 to make its leading entry 1.
步骤3:将行2乘以2,使主元变为1。
R₂ → 2R₂: [0, 1 | −5, 2]
Step 4: Eliminate the 0.5 above the new pivot by subtracting 0.5×R₂ from R₁.
步骤4:用行1减去0.5倍的行2,消去新主元上方的0.5。
R₁ → R₁ − 0.5R₂: [1, 0 | 3, −1]
The left block is now I, so the right block is A⁻¹ = [[3, −1], [−5, 2]].
此时左侧分块已为 I,因此右侧分块就是 A⁻¹ = [[3, −1], [−5, 2]]。
6. Worked Example: 3×3 Matrix – Forming the Augmented Matrix and First Steps | 解题示例:3×3 矩阵 – 构造增广矩阵及初步行变换
onsider the matrix A = [[1, 2, 3], [0, 1, 4], [5, 6, 0]]. Begin with the augmented matrix:
考虑矩阵 A = [[1, 2, 3], [0, 1, 4], [5, 6, 0]]。从增广矩阵开始:
| 1 | 2 | 3 | 1 | 0 | 0 |
| 0 | 1 | 4 | 0 | 1 | 0 |
| 5 | 6 | 0 | 0 | 0 | 1 |
ready 1. The first target is the entry below it in row 3, which is 5. Apply R₃ → R₃ − 5R₁:
行1的主元已经是1。第一个目标是行3中位于其下方的元素5。执行 R₃ → R₃ − 5R₁:
R₃ → R₃ − 5R₁ ⇒ [0, −4, −15 | −5, 0, 1]
The matrix now is:
此时矩阵为:
| 1 | 2 | 3 | 1 | 0 | 0 |
| 0 | 1 | 4 | 0 | 1 | 0 |
| 0 | −4 | −15 | −5 | 0 | 1 |
e pivot in row 2 is 1, which is good. Next, eliminate the −4 below it using R₃ → R₃ + 4R₂.
行2的主元是1,很好。接下来用 R₃ → R₃ + 4R₂ 消去下方的 −4。
R₃ → R₃ + 4R₂ ⇒ [0, 0, 1 | −5, 4, 1]
7. Worked Example: 3×3 Matrix – Completing the Elimination | 解题示例:3×3 矩阵 – 完成消元
Now the matrix is in row echelon form. We proceed backwards to reach RREF. The pivot in row 3 is 1. Clear the entries above it in column 3.
现在矩阵已化为行阶梯形。我们回头继续,达到简化行阶梯形。行3的主元是1。消去第3列中该主元上方的元素。
Apply R₂ → R₂ − 4R₃:
执行 R₂ → R₂ − 4R₃:
R₂ → R₂ − 4R₃ ⇒ [0, 1, 0 | 20, −15, −4]
Apply R₁ → R₁ − 3R₃:
执行 R₁ → R₁ − 3R₃:
R₁ → R₁ − 3R₃ ⇒ [1, 2, 0 | 16, −12, −3]
Finally, eliminate the 2 in row 1, column 2 using R₁ → R₁ − 2R₂.
最后,用 R₁ → R₁ − 2R₂ 消去行1、列2中的2。
R₁ → R₁ − 2R₂ ⇒ [1, 0, 0 | −24, 18, 5]
The left block is now I₃. The right block gives A⁻¹:
左侧分块已化为 I₃。右侧分块就是 A⁻¹:
| −24 | 18 | 5 |
| 20 | −15 | −4 |
| −5 | 4 | 1 |
s A⁻¹ = [[−24, 18, 5], [20, −15, −4], [−5, 4, 1]]. This can be verified by multiplication.
因此 A⁻¹ = [[−24, 18, 5], [20, −15, −4], [−5, 4, 1]]。这可以通过矩阵乘法来验证。
8. Verifying the Inverse | 验证逆矩阵
ation with the original matrix will confirm whether the calculations were correct. Even a small arithmetic error can lead to a wrong inverse.
一旦得到候选逆矩阵,一定要验算 A A⁻¹ = I 以及 A⁻¹ A = I。在 2×2 的情况下,与原始矩阵直接相乘即可确认计算是否正确。哪怕一个小小的算术错误都会导致错误的逆矩阵。
riginal A by the computed inverse yields the identity matrix. This step is often required in IB examination questions to demonstrate understanding.
在上述 3×3 例子中,将原始 A 与计算出的逆矩阵相乘会得到单位矩阵。在 IB 考题中,常常要求进行这一步以展示对概念的理解。
9. Singular Matrices: When Elimination Breaks Down | 奇异矩阵:当消元法失效时
zeros appears in the left block before reaching the identity, the matrix is singular (non‑invertible). For instance, A = [[1, 2], [2, 4]].
并非所有方阵都有逆矩阵。如果高斯消元过程中左侧分块在化为单位矩阵之前出现全零行,则该矩阵是奇异矩阵(不可逆)。例如 A = [[1, 2], [2, 4]]。
Form the augmented matrix and subtract 2R₁ from R₂:
构造增广矩阵并执行 R₂ → R₂ − 2R₁:
[1, 2 | 1, 0] → [0, 0 | −2, 1]
ble to obtain the identity. This indicates that det(A) = 0 and the inverse does not exist.
此时左侧分块出现零行,不可能得到单位矩阵。这表明 det(A) = 0,逆矩阵不存在。
10. From Inverse to Solving Linear Systems | 从逆矩阵到解线性方程组
atrix. For example, given the system 2x + y = 3, 5x + 3y = 7, we can express it as A[x, y]ᵀ = [3, 7]ᵀ. Using the inverse found earlier, [x, y]ᵀ = [[3, −1], [−5, 2]] [3, 7]ᵀ = [2, −1]ᵀ.
如果 A 可逆,则 AX = B 的唯一解是 X = A⁻¹B。这是逆矩阵的直接应用。例如,给定方程组 2x + y = 3, 5x + 3y = 7,可表示为 A[x, y]ᵀ = [3, 7]ᵀ。利用前面求出的逆矩阵,得 [x, y]ᵀ = [[3, −1], [−5, 2]] [3, 7]ᵀ = [2, −1]ᵀ。
This method is especially efficient when the same coefficient matrix is used with several different constant vectors. Instead of performing elimination repeatedly, one simply multiplies the inverse by each new vector.
当同一个系数矩阵需要搭配多个不同的常数向量时,该方法尤为高效。无需重复进行消元,只需将逆矩阵依次与每个新向量相乘即可。
<
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图