矩阵乘法(行操作)
如果有:
E
=
[
1
0
0
−
2
1
0
0
0
1
]
A
=
[
2
4
−
2
4
9
−
3
−
2
−
3
7
]
E= \left[ \begin{matrix} 1 & 0 & 0 \\ -2 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} \right] \space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space A= \left[ \begin{matrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{matrix} \right]
E=⎣⎡1−20010001⎦⎤ A=⎣⎡24−249−3−2−37⎦⎤
求EA=Y
思维转变:EA看成E对A的行进行操作
step1:
[
1
0
0
0
0
1
]
[
2
4
−
2
4
9
−
3
−
2
−
3
7
]
\left[ \begin{matrix} 1 & 0 & 0 \\ & & \\ 0 & 0 & 1 \end{matrix} \right] \left[ \begin{matrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{matrix} \right]
⎣⎡100001⎦⎤⎣⎡24−249−3−2−37⎦⎤
等价于A的第一行和第三行不变
(1)
[
2
4
−
2
−
2
−
3
7
]
\left[ \begin{matrix} 2 & 4 & -2 \\ & & \\ -2 & -3 & 7 \end{matrix} \right]\tag{1}
⎣⎡2−24−3−27⎦⎤(1)
step2:
[
−
2
1
0
]
[
2
4
−
2
4
9
−
3
−
2
−
3
7
]
\left[ \begin{matrix} & & \\ -2& 1 &0 \\ & & \end{matrix} \right] \left[ \begin{matrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{matrix} \right]
⎣⎡−210⎦⎤⎣⎡24−249−3−2−37⎦⎤
等价于A的 row1*(-2)+row2=new row2
(2)
(
2
,
4
,
−
2
)
∗
(
−
2
)
( 2,4,-2)*(-2)\tag{2}
(2,4,−2)∗(−2)(2)
(3)
(
4
,
9
,
−
3
)
∗
(
1
)
( 4,9,-3)*(1)\tag{3}
(4,9,−3)∗(1)(3)
(4)
(
2
)
+
(
3
)
=
n
e
w
r
o
w
2
−
>
[
0
1
1
]
(2)+(3)=new\space row 2\space\space->\space\left[ \begin{matrix} & & \\ 0& 1 &1 \\ & & \end{matrix} \right]\tag{4}
(2)+(3)=new row2 −> ⎣⎡011⎦⎤(4)
step3:
(
1
)
+
(
4
)
=
[
2
4
−
2
0
1
1
−
2
−
3
7
]
(1)+(4)=\left[ \begin{matrix} 2 & 4 &-2 \\ 0& 1 &1 \\ -2&-3 & 7 \end{matrix} \right]
(1)+(4)=⎣⎡20−241−3−217⎦⎤
- 例子:
如果有:
A
=
[
1
2
3
4
5
6
7
8
9
]
X
=
[
1
1
1
1
1
1
1
1
1
]
A= \left[ \begin{matrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7&8 &9 \end{matrix} \right] \space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space X= \left[ \begin{matrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 &1 \end{matrix} \right]
A=⎣⎡147258369⎦⎤ X=⎣⎡111111111⎦⎤
求AX=Y
step1:
[
1
2
3
]
[
1
1
1
1
1
1
1
1
1
]
\left[ \begin{matrix} 1 & 2 & 3 \\ & & \\ & & \end{matrix} \right] \left[ \begin{matrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 &1 \end{matrix} \right]
⎣⎡123⎦⎤⎣⎡111111111⎦⎤
等价于A的 row1*1+row2*2+row3*3=new row1
(1)
(
1
,
1
,
1
)
∗
(
1
)
( 1,1,1)*(1)\tag{1}
(1,1,1)∗(1)(1)
(2)
(
1
,
1
,
1
)
∗
(
2
)
( 1,1,1)*(2)\tag{2}
(1,1,1)∗(2)(2)
(3)
(
1
,
1
,
1
)
∗
(
3
)
( 1,1,1)*(3)\tag{3}
(1,1,1)∗(3)(3)
(4)
(
1
)
+
(
2
)
+
(
3
)
=
[
6
6
6
]
(1)+(2)+(3)= \left[ \begin{matrix} 6& 6& 6 \\ & & \\ & & \end{matrix} \right]\tag{4}
(1)+(2)+(3)=⎣⎡666⎦⎤(4)
step2:
同理
(5)
[
4
5
6
]
[
1
1
1
1
1
1
1
1
1
]
=
[
15
15
15
]
\left[ \begin{matrix} & & \\ 4 & 5 & 6 \\ & & \end{matrix} \right] \left[ \begin{matrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 &1 \end{matrix} \right] =\left[ \begin{matrix} & & \\ 15 & 15 & 15 \\ & & \end{matrix} \right] \tag{5}
⎣⎡456⎦⎤⎣⎡111111111⎦⎤=⎣⎡151515⎦⎤(5)
(6) [ 7 8 9 ] [ 1 1 1 1 1 1 1 1 1 ] = [ 24 24 24 ] \left[ \begin{matrix} & & \\ & & \\ 7& 8&9 \end{matrix} \right] \left[ \begin{matrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 &1 \end{matrix} \right] =\left[ \begin{matrix} & & \\ & & \\ 24& 24&24 \end{matrix} \right] \tag{6} ⎣⎡789⎦⎤⎣⎡111111111⎦⎤=⎣⎡242424⎦⎤(6)
求
得
:
Y
=
[
6
6
6
15
15
15
24
24
24
]
求得:Y=\left[ \begin{matrix} 6& 6& 6 \\ 15 & 15 &15 \\ 24& 24&24 \end{matrix} \right]
求得:Y=⎣⎡615246152461524⎦⎤
矩阵乘法(列操作)
- 两个矩阵AE相乘,看成E对A进行列变换
如果有:
A = [ 2 4 − 2 4 9 − 3 − 2 − 3 7 ] E = [ 1 0 0 − 2 1 0 0 0 1 ] A= \left[ \begin{matrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{matrix} \right]\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space E= \left[ \begin{matrix} 1 & 0 & 0 \\ -2 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} \right] A=⎣⎡24−249−3−2−37⎦⎤ E=⎣⎡1−20010001⎦⎤
求AE=Y
step1:
E
=
[
1
0
0
−
2
1
0
0
0
1
]
=
[
E
1
E
2
E
3
]
E=\left[ \begin{array}{c|c|c} 1 & 0 & 0 \\ -2 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right] = \left[ \begin{matrix} & & \\ E1& E2& E3 \\ & & \end{matrix} \right]
E=⎣⎡1−20010001⎦⎤=⎣⎡E1E2E3⎦⎤
A
E
=
[
A
E
1
A
E
2
A
E
3
]
AE=\left[ \begin{matrix} & & \\ AE1& AE2& AE3 \\ & & \end{matrix} \right]
AE=⎣⎡AE1AE2AE3⎦⎤
step2:
A
E
1
=
[
2
4
−
2
4
9
−
3
−
2
−
3
7
]
[
1
−
2
0
]
AE1= \left[ \begin{matrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{matrix} \right] \left[ \begin{matrix} 1 \\ -2 \\ 0 \end{matrix} \right]
AE1=⎣⎡24−249−3−2−37⎦⎤⎣⎡1−20⎦⎤
看成A的列向量的线性组合:
(1)
[
2
4
−
2
]
∗
1
+
[
4
9
−
3
]
∗
(
−
2
)
+
[
−
2
−
3
7
]
∗
0
=
[
−
6
−
14
4
]
\left[ \begin{matrix} 2 \\ 4 \\ -2 \end{matrix} \right] *1+ \left[ \begin{matrix} 4 \\ 9 \\ -3 \end{matrix} \right]*(-2)+ \left[ \begin{matrix} -2 \\ -3 \\ 7 \end{matrix} \right]*0= \left[ \begin{matrix} -6 \\ -14 \\ 4 \end{matrix} \right]\tag{1}
⎣⎡24−2⎦⎤∗1+⎣⎡49−3⎦⎤∗(−2)+⎣⎡−2−37⎦⎤∗0=⎣⎡−6−144⎦⎤(1)
step3:
同理:
(2)
A
E
2
=
[
2
4
−
2
4
9
−
3
−
2
−
3
7
]
[
0
1
0
]
=
[
4
9
−
3
]
AE2= \left[ \begin{matrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{matrix} \right] \left[ \begin{matrix} 0 \\ 1 \\ 0 \end{matrix} \right] = \left[ \begin{matrix} 4 \\ 9 \\ -3 \end{matrix} \right] \tag{2}
AE2=⎣⎡24−249−3−2−37⎦⎤⎣⎡010⎦⎤=⎣⎡49−3⎦⎤(2)
(3) A E 3 = [ 2 4 − 2 4 9 − 3 − 2 − 3 7 ] [ 0 0 1 ] = [ − 2 − 3 7 ] AE3= \left[ \begin{matrix} 2 & 4 & -2 \\ 4 & 9 & -3 \\ -2 & -3 & 7 \end{matrix} \right] \left[ \begin{matrix} 0 \\ 0 \\ 1 \end{matrix} \right] = \left[ \begin{matrix} -2 \\ -3 \\ 7 \end{matrix} \right] \tag{3} AE3=⎣⎡24−249−3−2−37⎦⎤⎣⎡001⎦⎤=⎣⎡−2−37⎦⎤(3)
求得:
Y = ( 1 ) + ( 2 ) + ( 3 ) = [ A E 1 A E 2 A E 3 ] = [ − 6 4 − 2 − 14 9 − 3 4 − 3 7 ] Y=(1)+(2)+(3)= \left[ \begin{matrix} & & \\ AE1& AE2& AE3 \\ & & \end{matrix} \right] = \left[ \begin{matrix} -6 & 4 & -2 \\ -14 & 9 & -3 \\ 4 & -3 & 7 \end{matrix} \right] Y=(1)+(2)+(3)=⎣⎡AE1AE2AE3⎦⎤=⎣⎡−6−14449−3−2−37⎦⎤