视频课程入下:
2. Elimination with Matrices.
2.1 消元法求解
例题如下:
{ x + 2 y + z = 2 3 x + 8 y + z = 12 4 y + z = 2 \begin{cases} x +2y+z = 2 \\ 3x + 8y+z = 12 \\ 4y+z=2 \end {cases} ⎩ ⎨ ⎧x+2y+z=23x+8y+z=124y+z=2
将方程组左侧的系数用矩阵的形式表示,这个方程组如下:
[ 1 2 3 3 8 1 0 4 1 ] A ∗ [ x y z ] X = [ 2 12 2 ] b \underset{\text{A}}{\begin{bmatrix} 1&2&3\\3&8&1\\0&4&1\end{bmatrix}}*\underset{\text{X}}{\begin{bmatrix} x\\y\\z\end{bmatrix}}=\underset{\text{b}}{\begin{bmatrix} 2\\12\\2\end{bmatrix}} A 130284311 ∗X xyz =b 2122
对系数矩阵A进行消元:
- r o w 2 − 3 ∗ r o w 1 row_2-3*row_1 row2−3∗row1,使用A的第二行减去第一行的3倍,获得A1
- r o w 3 − 2 ∗ r o w 2 row_3-2*row_2 row3−2∗row2,使用A1的第三行减去第二行的2倍,获得A2
[ 1 2 1 3 8 1 0 4 1 ] A → ① [ 1 2 1 0 2 − 2 0 4 1 ] A1 → ② [ 1 2 1 0 2 − 2 0 0 5 ] A2 \underset{\text{A}}{\begin{bmatrix} 1&2&1\\3&8&1\\0&4&1\end{bmatrix}}\xrightarrow{①}\underset{\text{A1}}{\begin{bmatrix} 1&2&1\\0&2&-2\\0&4&1\end{bmatrix}}\xrightarrow{②}\underset{\text{A2}}{\begin{bmatrix} 1&2&1\\0&2&-2\\0&0&5\end{bmatrix}} A 130284111 ①A1 1002241−21 ②A2 1002201−25
此时,方程组的系数矩阵化简完成,现在将等行右边的结果向量b进行相同的操作:
[ 2 12 2 ] b ⟶ [ 2 6 2 ] b1 ⟶ [ 2 6 − 10 ] b2 \underset{\text{b}}{\begin{bmatrix} 2\\12\\2\end{bmatrix}}\longrightarrow\underset{\text{b1}}{\begin{bmatrix} 2\\6\\2\end{bmatrix}}\longrightarrow\underset{\text{b2}}{\begin{bmatrix} 2\\6\\-10\end{bmatrix}} b 2122 ⟶b1 262 ⟶b2 26−10
所以原方程组就变成了
{ x + 2 y + z = 2 3 x + 8 y + z = 12 4 y + z = 2 ⟶ { x + 2 y + z = 2 2 y − 2 z = 6 5 z = − 10 \begin{cases} x +2y+z = 2 \\ 3x + 8y+z = 12 \\ 4y+z=2 \end {cases}\longrightarrow\begin{cases} x +2y+z = 2 \\ 2y-2z = 6 \\ 5z=-10 \end {cases} ⎩ ⎨ ⎧x+2y+z=23x+8y+z=124y+z=2⟶⎩ ⎨ ⎧x+2y+z=22y−2z=65z=−10
从而求解出来方程组:
{ x = 2 y = 1 z = − 2 \begin{cases} x = 2 \\ y = 1 \\ z = -2 \end {cases} ⎩ ⎨ ⎧x=2y=1z=−2
2.2 矩阵乘法
列变换:
[ c o l 1 c o l 2 c o l 3 ] ∗ [ x y z ] = x ∗ c o l 1 + y ∗ c o l 2 + z ∗ c o l 3 \begin{bmatrix} col_1&col_2&col_3\end{bmatrix}*\begin{bmatrix} x\\y\\z\end{bmatrix}=x*col_1+y*col_2+z*col_3 [col1col2col3]∗ xyz =x∗col1+y∗col2+z∗col3
行变换:
[ x y z ] ∗ [ r o w 1 r o w 2 r o w 3 ] = x ∗ r o w 1 + y ∗ r o w 2 + z ∗ r o w 3 \begin{bmatrix} x&y&z\end{bmatrix}*\begin{bmatrix} row_1\\row_2\\row_3\end{bmatrix}=x*row_1+y*row_2+z*row_3 [xyz]∗ row1row2row3 =x∗row1+y∗row2+z∗row3
所以2.1中的例题系数矩阵消元就可以用矩阵的乘法表示:
[ 1 0 0 0 0 1 0 − 2 1 ] E 32 [ 1 0 0 − 3 1 0 0 0 1 ] E 21 [ 1 2 1 3 8 1 0 4 1 ] A = [ 1 2 1 0 2 − 2 0 0 5 ] U \underset{E_{32}}{\begin{bmatrix} 1&0&0\\0&0&1\\0&-2&1\end{bmatrix}}\underset{E_{21}}{\begin{bmatrix} 1&0&0\\-3&1&0\\0&0&1\end{bmatrix}}\underset{\text{A}}{\begin{bmatrix} 1&2&1\\3&8&1\\0&4&1\end{bmatrix}}=\underset{\text{U}}{\begin{bmatrix} 1&2&1\\0&2&-2\\0&0&5\end{bmatrix}} E32 10000−2011 E21 1−30010001 A 130284111 =U 1002201−25
简写就可以写作 E 32 ∗ ( E 21 ∗ A ) = U E_{32}*(E_{21}*A)=U E32∗(E21∗A)=U, ( E 32 ∗ E 21 ) ∗ A = U (E_{32}*E_{21})*A=U (E32∗E21)∗A=U,结合律适用矩阵乘法。
2.3 置换矩阵
行交换:
[ 0 1 1 0 ] ∗ [ a b c d ] = [ c d a b ] \begin{bmatrix} 0&1\\1&0\end{bmatrix}*\begin{bmatrix} a&b\\c&d\end{bmatrix}=\begin{bmatrix} c&d\\a&b\end{bmatrix} [0110]∗[acbd]=[cadb]
列交换
[ a b c d ] ∗ [ 0 1 1 0 ] = [ b a d c ] \begin{bmatrix} a&b\\c&d\end{bmatrix}*\begin{bmatrix} 0&1\\1&0\end{bmatrix}=\begin{bmatrix} b&a\\d&c\end{bmatrix} [acbd]∗[0110]=[bdac]
2.4 逆矩阵
[ 1 0 0 3 1 0 0 0 1 ] E − 1 ∗ [ 1 0 0 − 3 1 0 0 0 1 ] E = [ 1 0 0 0 1 0 0 0 1 ] I \underset{E^{-1}}{\begin{bmatrix} 1&0&0\\3&1&0\\0&0&1\end{bmatrix}}*\underset{\text{E}}{\begin{bmatrix} 1&0&0\\-3&1&0\\0&0&1\end{bmatrix}}=\underset{\text{I}}{\begin{bmatrix} 1&0&0\\0&1&0\\0&0&1\end{bmatrix}} E−1 130010001 ∗E 1−30010001 =I 100010001