求矩阵秩的方法:
- 高斯消元法:通过行变换将矩阵化为行阶梯形矩阵,然后数非零行的数量。
- LU分解:通过分解矩阵成上下三角矩阵,计算非零对角元素的数量。
- SVD分解:通过奇异值分解,计算非零奇异值的数量。
- 行列式法:检查所有可能的子矩阵行列式,寻找最大的非零子矩阵。
求逆矩阵的方法:
- 高斯-约当消去法(Gauss-Jordan Elimination):将增广矩阵 [ A ∣ I ] [A | I] [A∣I]化为 [ I ∣ A − 1 ] [I | A^{-1}] [I∣A−1]。
- 伴随矩阵法(Adjugate Matrix Method):通过计算伴随矩阵和行列式求逆矩阵。
- LU分解:通过上下三角矩阵分解求逆矩阵。
- SVD分解:通过奇异值分解求逆矩阵。
- Cholesky分解:适用于正定矩阵,通过分解求逆矩阵。
这些方法各有其优点和适用场景,根据具体问题选择合适的方法。
用高斯消元法求三阶矩阵的秩
假设我们有矩阵 A A A:
A = ( 1 2 3 2 4 6 1 1 1 ) A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 1 & 1 \end{pmatrix} A= 121241361
步骤:
-
用第二行减去第一行的2倍:
A ′ = ( 1 2 3 0 0 0 1 1 1 ) A' = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 1 & 1 & 1 \end{pmatrix} A′= 101201301 -
用第三行减去第一行:
A ′ ′ = ( 1 2 3 0 0 0 0 − 1 − 2 ) A'' = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 0 & -1 & -2 \end{pmatrix} A′′= 10020−130−2
此时行阶梯形矩阵中有2个非零行,因此矩阵 A A A的秩为2。
用行列式法求三阶矩阵的秩
假设我们有同样的矩阵 A A A:
A = ( 1 2 3 2 4 6 1 1 1 ) A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 1 & 1 \end{pmatrix} A= 121241361
步骤:
-
计算 3 × 3 3 \times 3 3×3矩阵的行列式:
det ( A ) = 1 ∣ 4 6 1 1 ∣ − 2 ∣ 2 6 1 1 ∣ + 3 ∣ 2 4 1 1 ∣ \text{det}(A) = 1 \begin{vmatrix} 4 & 6 \\ 1 & 1 \end{vmatrix} - 2 \begin{vmatrix} 2 & 6 \\ 1 & 1 \end{vmatrix} + 3 \begin{vmatrix} 2 & 4 \\ 1 & 1 \end{vmatrix} det(A)=1 4161 −2 2161 +3 2141
det ( A ) = 1 ( 4 ⋅ 1 − 6 ⋅ 1 ) − 2 ( 2 ⋅ 1 − 6 ⋅ 1 ) + 3 ( 2 ⋅ 1 − 4 ⋅ 1 ) \text{det}(A) = 1 (4 \cdot 1 - 6 \cdot 1) - 2 (2 \cdot 1 - 6 \cdot 1) + 3 (2 \cdot 1 - 4 \cdot 1) det(A)=1(4⋅1−6⋅1)−2(2⋅1−6⋅1)+3(2⋅1−4⋅1)
det ( A ) = 1 ( − 2 ) − 2 ( − 4 ) + 3 ( − 2 ) \text{det}(A) = 1 (-2) - 2 (-4) + 3 (-2) det(A)=1(−2)−2(−4)+3(−2)
det ( A ) = − 2 + 8 − 6 = 0 \text{det}(A) = -2 + 8 - 6 = 0 det(A)=−2+8−6=0 -
行列式为0,表示矩阵 A A A的秩小于3。我们需要检查所有 2 × 2 2 \times 2 2×2子矩阵:
∣ 1 2 2 4 ∣ = 1 ⋅ 4 − 2 ⋅ 2 = 0 \begin{vmatrix} 1 & 2 \\ 2 & 4 \end{vmatrix} = 1 \cdot 4 - 2 \cdot 2 = 0 1224 =1⋅4−2⋅2=0
∣ 1 3 1 1 ∣ = 1 ⋅ 1 − 3 ⋅ 1 = − 2 \begin{vmatrix} 1 & 3 \\ 1 & 1 \end{vmatrix} = 1 \cdot 1 - 3 \cdot 1 = -2 1131 =1⋅1−3⋅1=−2
∣ 2 3 4 6 ∣ = 2 ⋅ 6 − 3 ⋅ 4 = 0 \begin{vmatrix} 2 & 3 \\ 4 & 6 \end{vmatrix} = 2 \cdot 6 - 3 \cdot 4 = 0 2436 =2⋅6−3⋅4=0
找到一个非零子矩阵,表示矩阵的秩为2。
用增广矩阵法求三阶矩阵的逆矩阵
假设我们有矩阵 B B B:
B = ( 2 − 1 0 − 1 2 − 1 0 − 1 2 ) B = \begin{pmatrix} 2 & -1 & 0 \\ -1 & 2 & -1 \\ 0 & -1 & 2 \end{pmatrix} B= 2−10−12−10−12
步骤:
-
构建增广矩阵 [ B ∣ I ] [B | I] [B∣I]:
( 2 − 1 0 ∣ 1 0 0 − 1 2 − 1 ∣ 0 1 0 0 − 1 2 ∣ 0 0 1 ) \begin{pmatrix} 2 & -1 & 0 & | & 1 & 0 & 0 \\ -1 & 2 & -1 & | & 0 & 1 & 0 \\ 0 & -1 & 2 & | & 0 & 0 & 1 \end{pmatrix} 2−10−12−10−12∣∣∣100010001 -
通过高斯-约当消去法将其化为 [ I ∣ B − 1 ] [I | B^{-1}] [I∣B−1]:
( 1 0 0 ∣ 3 4 1 2 1 4 0 1 0 ∣ 1 2 1 1 2 0 0 1 ∣ 1 4 1 2 3 4 ) \begin{pmatrix} 1 & 0 & 0 & | & \frac{3}{4} & \frac{1}{2} & \frac{1}{4} \\ 0 & 1 & 0 & | & \frac{1}{2} & 1 & \frac{1}{2} \\ 0 & 0 & 1 & | & \frac{1}{4} & \frac{1}{2} & \frac{3}{4} \end{pmatrix} 100010001∣∣∣43214121121412143
得到矩阵 B B B的逆矩阵为:
B − 1 = ( 3 4 1 2 1 4 1 2 1 1 2 1 4 1 2 3 4 ) B^{-1} = \begin{pmatrix} \frac{3}{4} & \frac{1}{2} & \frac{1}{4} \\ \frac{1}{2} & 1 & \frac{1}{2} \\ \frac{1}{4} & \frac{1}{2} & \frac{3}{4} \end{pmatrix} B−1= 43214121121412143
用伴随矩阵法求三阶矩阵的逆矩阵
假设我们有同样的矩阵 B B B:
B = ( 2 − 1 0 − 1 2 − 1 0 − 1 2 ) B = \begin{pmatrix} 2 & -1 & 0 \\ -1 & 2 & -1 \\ 0 & -1 & 2 \end{pmatrix} B= 2−10−12−10−12
步骤:
-
计算矩阵的行列式:
det ( B ) = 2 ∣ 2 − 1 − 1 2 ∣ − ( − 1 ) ∣ − 1 − 1 0 2 ∣ + 0 \text{det}(B) = 2 \begin{vmatrix} 2 & -1 \\ -1 & 2 \end{vmatrix} - (-1) \begin{vmatrix} -1 & -1 \\ 0 & 2 \end{vmatrix} + 0 det(B)=2 2−1−12 −(−1) −10−12 +0
det ( B ) = 2 ( 4 − 1 ) − ( − 1 ) ( − 2 ) \text{det}(B) = 2 (4 - 1) - (-1)(-2) det(B)=2(4−1)−(−1)(−2)
det ( B ) = 2 ⋅ 3 − 2 = 4 \text{det}(B) = 2 \cdot 3 - 2 = 4 det(B)=2⋅3−2=4 -
计算伴随矩阵(Cofactor Matrix的转置):
adj ( B ) = ( ∣ 2 − 1 − 1 2 ∣ − ∣ − 1 − 1 − 1 2 ∣ ∣ − 1 2 − 1 2 ∣ − ∣ − 1 0 − 1 2 ∣ ∣ 2 0 0 2 ∣ − ∣ 2 − 1 0 − 1 ∣ ∣ − 1 0 2 − 1 ∣ − ∣ 2 − 1 − 1 − 1 ∣ ∣ 2 − 1 − 1 2 ∣ ) \text{adj}(B) = \begin{pmatrix} \begin{vmatrix} 2 & -1 \\ -1 & 2 \end{vmatrix} & -\begin{vmatrix} -1 & -1 \\ -1 & 2 \end{vmatrix} & \begin{vmatrix} -1 & 2 \\ -1 & 2 \end{vmatrix} \\ -\begin{vmatrix} -1 & 0 \\ -1 & 2 \end{vmatrix} & \begin{vmatrix} 2 & 0 \\ 0 & 2 \end{vmatrix} & -\begin{vmatrix} 2 & -1 \\ 0 & -1 \end{vmatrix} \\ \begin{vmatrix} -1 & 0 \\ 2 & -1 \end{vmatrix} & -\begin{vmatrix} 2 & -1 \\ -1 & -1 \end{vmatrix} & \begin{vmatrix} 2 & -1 \\ -1 & 2 \end{vmatrix} \end{pmatrix} adj(B)= 2−1−12 − −1−102 −120−1 − −1−1−12 2002 − 2−1−1−1 −1−122 − 20−1−1 2−1−12 -
计算每个代数余子式:
∣ 2 − 1 − 1 2 ∣ = 4 − 1 = 3 \begin{vmatrix} 2 & -1 \\ -1 & 2 \end{vmatrix} = 4 - 1 = 3 2−1−12 =4−1=3
− ∣ − 1 − 1 − 1 2 ∣ = − ( − 1 ( 2 ) − ( − 1 ) ( − 1 ) ) = − ( − 2 − 1 ) = 3 -\begin{vmatrix} -1 & -1 \\ -1 & 2 \end{vmatrix} = -(-1(2) - (-1)(-1)) = -(-2 - 1) = 3 − −1−1−12 =−(−1(2)−(−1)(−1))=−(−2−1)=3
∣ − 1 2 − 1 2 ∣ = − 1 ( 2 ) − 2 ( − 1 ) = − 2 + 2 = 0 \begin{vmatrix} -1 & 2 \\ -1 & 2 \end{vmatrix} = -1(2) - 2(-1) = -2 + 2 = 0 −1−122 =−1(2)−2(−1)=−2+2=0
− ∣ − 1 0 − 1 2 ∣ = − ( − 1 ( 2 ) − 0 ( − 1 ) ) = − ( − 2 ) = 2 -\begin{vmatrix} -1 & 0 \\ -1 & 2 \end{vmatrix} = -(-1(2) - 0(-1)) = -(-2) = 2 − −1−102 =−(−1(2)−0(−1))=−(−2)=2
∣ 2 0 0 2 ∣ = 4 \begin{vmatrix} 2 & 0 \\ 0 & 2 \end{vmatrix} = 4 2002 =4
− ∣ 2 − 1 0 − 1 ∣ = − ( 2 ( − 1 ) − 0 ) = 2 -\begin{vmatrix} 2 & -1 \\ 0 & -1 \end{vmatrix} = -(2(-1) - 0) = 2 − 20−1−1 =−(2(−1)−0)=2
∣ − 1 0 2 − 1 ∣ = ( − 1 ) ( − 1 ) − 0 = 1 \begin{vmatrix} -1 & 0 \\ 2 & -1 \end{vmatrix} = (-1)(-1) - 0 = 1 −120−1 =(−1)(−1)−0=1
− ∣ 2 − 1 − 1 − 1 ∣ = − ( − 2 + 1 ) = 1 -\begin{vmatrix} 2 & -1 \\ -1 & -1 \end{vmatrix} = -(-2 + 1) = 1 − 2−1−1−1 =−(−2+1)=1
∣ 2 − 1 − 1 2 ∣ = 4 − 1 = 3 \begin{vmatrix} 2 & -1 \\ -1 & 2 \end{vmatrix} = 4 - 1 = 3 2−1−12 =4−1=3 -
转置得到伴随矩阵:
adj ( B ) = ( 3 2 1 3 4 1 0 2 3 ) \text{adj}(B) = \begin{pmatrix} 3 & 2 & 1 \\ 3 & 4 & 1 \\ 0 & 2 & 3 \end{pmatrix} adj(B)= 330242113 -
计算逆矩阵:
B − 1 = 1 det ( B ) adj ( B ) = 1 4 ( 3 2 1 3 4 1 0 2 3 ) = ( 3 4 1 2 1 4 3 4 1 1 4 0 1 2 3 4 ) B^{-1} = \frac{1}{\text{det}(B)} \text{adj}(B) = \frac{1}{4} \begin {pmatrix} 3 & 2 & 1 \\ 3 & 4 & 1 \\ 0 & 2 & 3 \end{pmatrix} = \begin{pmatrix} \frac{3}{4} & \frac{1}{2} & \frac{1}{4} \\ \frac{3}{4} & 1 & \frac{1}{4} \\ 0 & \frac{1}{2} & \frac{3}{4} \end{pmatrix} B−1=det(B)1adj(B)=41 330242113 = 4343021121414143
通过这些简单的例子和步骤,可以清楚地了解如何用高斯消元法、行列式法求矩阵秩,以及用增广矩阵和伴随矩阵法求逆矩阵。