Matrix Multiplication(Regular Way)
행렬을 곱하는 방법 4가지를 소개합니다.
$\begin{bmatrix}
& & \\
a_{31} & a_{32} & ---\\
& &
\end{bmatrix}$ $\begin{bmatrix}
& b_{14} & \\
& b_{24} & \\
& \mid &
\end{bmatrix} =$ $\begin{bmatrix}
& & \\
& c_{34} & \\
& &
\end{bmatrix} $
A는 m x n 행렬
B는 n x p 행렬
C = AB, m x p 행렬일 때
$c_{34}$ = (row3 of A) x (colum 4 of B) = $a_{31}b_{14} + a_{32}b_{24} + ...$ = $\sum_{k=1}^{n}a_{3k}b_{k4}$
A의 3행과 B의 4열의 벡터의 내적 (dot product)라고 볼 수 있습니다.
row x col = scalar
Matrix Multiplication(Column Way)
$\begin{bmatrix}
& & \\
& & \\
& &
\end{bmatrix}$ $\begin{bmatrix}
\mid& \mid& \\
\mid& \mid& \\
\mid& \mid&
\end{bmatrix}=$ $\begin{bmatrix}
\mid & \mid& \\
\mid & \mid& \\
\mid & \mid&
\end{bmatrix} $
A는 m x n 행렬
B는 n x p 행렬
C = AB, m x p 행렬일 때
C의 1st column은 A x (col1 of B)
즉, Columns of C는 combinations of columns of A
Matrix Multiplication(Row Way)
$\begin{bmatrix}
& & \\
- & - & -\\
& &
\end{bmatrix}$ $\begin{bmatrix}
-&- &- \\
-& -&- \\
-& -&-
\end{bmatrix}=$ $\begin{bmatrix}
& & \\
-& -&- \\
& &
\end{bmatrix}$
A는 m x n 행렬
B는 n x p 행렬
C = AB, m x p 행렬일 때
Rows of C는 combinations of Rows of B
Matrix Multiplication(Column x row)
Column of A X row of B
A는 m x 1 행렬
B는 1 x p 행렬
$\begin{bmatrix}
2\\3
\\ 4
\end{bmatrix}\begin{bmatrix}
1 & 6
\end{bmatrix}=$ $\begin{bmatrix}
2 & 12\\
3 & 18\\
4 & 24
\end{bmatrix}$
여기서 중요한 사실은
최종 행렬의 모든 row는 B의 row의 배수 (같은 line)이고 모든 column은 A의 column의 배수 (같은 line)라는 점입니다.
column x row의 경우 위와 같은 특별한 행렬이 만들어지는 것을 기억합니다.
이를 응용해서
AB = Sum of (cols of A) x (rows of B)
$\begin{bmatrix}
2 & 7\\
3 & 8\\
4 & 9
\end{bmatrix}\begin{bmatrix}
1 & 6\\
0 & 0
\end{bmatrix}$ $= \begin{bmatrix}
2\\3
\\4
\end{bmatrix}\begin{bmatrix}
1 & 6
\end{bmatrix}$ $+ \begin{bmatrix}
7\\8
\\9
\end{bmatrix}\begin{bmatrix}
0 & 0
\end{bmatrix}$
행렬의 Block화
$\begin{bmatrix}
A_{1} & \mid & A_{2}\\
- & - & -\\
A_{3} & \mid & A_{4}
\end{bmatrix}$ $\begin{bmatrix}
B_{1} & \mid & B_{2}\\
- & - & -\\
B_{3} & \mid & B_{4}
\end{bmatrix}=$ $\begin{bmatrix}
& \mid & \\
- & - & -\\
& \mid &
\end{bmatrix}$
행렬 안에서 block을 지정합니다.
결과의 (1,1) block은 $A_{1}B_{1}+A_{2}B_{3}$입니다.
Inverses(Square Matrices)
$A^{-1}A = I = AA^{-1}$
정방 행렬 (Square Matrix)의 경우 앞에 곱하나 뒤에 곱하나 그 결과가 같습니다.
$A^{-1}$이 존재하면
invertible, nonsingular 입니다.
Singular Case No Inverse
$A = \begin{bmatrix}
1 &3 \\
2& 6
\end{bmatrix}$
A가 역행렬을 가지지 않는다는 걸 어떻게 알 수 있을까요?
Vector $\textbf{x} \neq \textbf{0}$인 $A\textbf{x} = \textbf{0}$에 따라 역행렬의 유무를 알 수 있습니다.
예를 들면 위의 행렬 A에서
$A\textbf{x} =$ $\begin{bmatrix}
1 & 3\\
2 & 6
\end{bmatrix}\begin{bmatrix}
3\\-1
\end{bmatrix}=$ $\begin{bmatrix}
0\\0
\end{bmatrix}$
$\textbf{x} =$ $\begin{bmatrix}
3\\-1
\end{bmatrix}$인데
$A^{-1}$이 존재하면 $\textbf{x} =$ $\begin{bmatrix}
0\\0
\end{bmatrix}$이 되어서 모순됩니다.
$A^{-1}$ 구하기
$\begin{bmatrix}
1 & 3\\
2 & 7
\end{bmatrix}$ $\begin{bmatrix}
a & b\\
c & d
\end{bmatrix}=$ $\begin{bmatrix}
1 & 0\\
0 & 1
\end{bmatrix}$
A = $\begin{bmatrix}
1 & 3\\
2 & 7
\end{bmatrix}$
$A^{-1}$ = $\begin{bmatrix}
a & b\\
c & d
\end{bmatrix}$
$I$ = $\begin{bmatrix}
1 & 0\\
0 & 1
\end{bmatrix}$
A x column j of $A^{-1}$ = column j of I
Gauss-Jordan(Solve 2 equations at once)
가우스 요르단 방법을 이용하여 역행렬을 구해보겠습니다.
$\begin{bmatrix}
1 & 3\\
2 & 7
\end{bmatrix}$ $\begin{bmatrix}
a\\b
\end{bmatrix} =$ $\begin{bmatrix}
1\\0
\end{bmatrix}$
$\begin{bmatrix}
1 & 3\\
2 & 7
\end{bmatrix}$ $\begin{bmatrix}
c\\d
\end{bmatrix} =$ $ \begin{bmatrix}
0\\1
\end{bmatrix}$
$\begin{bmatrix}
1 & 3 & \mid & 1 & 0\\
2 & 7 & \mid & 0 & 1
\end{bmatrix}\rightarrow$ $\begin{bmatrix}
1 & 3 & \mid & 1 & 0\\
0 & 1 & \mid & -2 & 1
\end{bmatrix}\rightarrow $ $\begin{bmatrix}
1 & 0 & \mid & 7 & -3\\
0 & 1 & \mid & -2 & 1
\end{bmatrix}$
가우스 소거법에서는 A to U면 마무리되었지만 Jordan은 아래에서 위쪽으로 소거를 더 진행하였습니다.
처음에 $A$ | $I$로 시작하고 $I$ | $A^{-1}$로 변환되었습니다.
검산해보면
$\begin{bmatrix}
1 & 3 \\
2 & 7
\end{bmatrix}$ $\begin{bmatrix}
7 & -3 \\
-2 & 1
\end{bmatrix} =$ $\begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix}$ 맞습니다.
Inverse와 E와의 관계
$\square \begin{bmatrix}
A \mid I
\end{bmatrix} =$ $\begin{bmatrix}
I \mid ?
\end{bmatrix} $
네모 안에는 Elimination에서 했던 것을 떠올려보면 E's가 들어갑니다.
?는 $A^{-1}$입니다.
즉, $EA = I$는 $E = A^{-1}$라는 것을 말해줍니다.
'선형대수(Gilbert Strang)' 카테고리의 다른 글
Lecture 6: Column Space and Null Space (0) | 2019.11.19 |
---|---|
Lecture 5: Transposes, permutations, spaces R^n (0) | 2019.11.06 |
Lecture 4: Factorization into A = LU (1) | 2019.11.04 |
Lecture 2: Elimination with matrices (0) | 2019.10.30 |
Lecture 1: The geometry of linear equations (0) | 2019.10.29 |
댓글