[Linear Algebra] Lecture 3

Author

SEOYEON CHOI

Published

February 16, 2024

학습 목표

How do I multiply 2 matrices?

1 regulation way

\(\begin{bmatrix} \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot \\ \ a_{31} & \cdot & \cdot \end{bmatrix} \begin{bmatrix} \cdot & \cdot & \cdot & b_{14} \\ \cdot & \cdot & \cdot & \cdot \\ \ \cdot & \cdot & \cdot & \cdot \end{bmatrix} =\begin{bmatrix} \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \\ \ \cdot & \cdot & \cdot & c_{34} \end{bmatrix}\)

\(c_{34}\) = (row 3 of \(A\)) \(\cdot\) (column 4 of \(B\)) \(\to\) \(a_{31}\) of row 3 \(\times\) \(b_{14}\) of column 4 then \(c_{34}\) entry

\(= a_{31}b_{14} + a_{32}b_{24} + a_{33}b_{34} + \dots = \sum^n_{k=1} a_{3k}b_{k4}\)

\(A_{m \times n} B_{n \times p} = C_{m \times p}\)

한 row와 한 column을 곱해서 한 entry를 구하는 법

2 column way

\(\begin{bmatrix} \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot \\ \ \cdot & \cdot & \cdot \end{bmatrix} \begin{bmatrix} col1 \\ col1 \\ col1 \end{bmatrix} =\begin{bmatrix} Acol1 \\ Acol1 \\ Acol1 \end{bmatrix}, \begin{bmatrix} \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot \\ \ \cdot & \cdot & \cdot \end{bmatrix} \begin{bmatrix} col2 \\ col2 \\ col2 \end{bmatrix} =\begin{bmatrix} Acol2 \\ Acol2 \\ Acol2 \end{bmatrix}, \begin{bmatrix} \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot \\ \ \cdot & \cdot & \cdot \end{bmatrix} \begin{bmatrix} col3 \\ col3 \\ col3 \end{bmatrix} =\begin{bmatrix} Acol3 \\ Acol3 \\ Acol3 \end{bmatrix}\)

\(A_{m \times n} B_{n \times p} = C_{m \times p}\)

col \(\to\) columns of C are combinations of columns of A

A 행렬과 한 column씩 곱해서 구하는 법

3 row way

\(\begin{bmatrix} row1 & row1 & row1 \end{bmatrix} \begin{bmatrix} \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \end{bmatrix} =\begin{bmatrix} row1B & row1B & row1B & row1B \\ \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \end{bmatrix}, \begin{bmatrix} row2 & row2 & row2 \end{bmatrix} \begin{bmatrix} \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \end{bmatrix} =\begin{bmatrix} row2B & row2B & row2B & row2B \\ \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \end{bmatrix}, \begin{bmatrix} row3 & row3 & row3 \end{bmatrix} \begin{bmatrix} \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \end{bmatrix} =\begin{bmatrix} row3B & row3B & row3B & row3B \\ \cdot & \cdot & \cdot & \cdot \\ \cdot & \cdot & \cdot & \cdot \end{bmatrix}\)

\(A_{m \times n} B_{n \times p} = C_{m \times p}\)

row \(\to\) rows of C are combinations of rows of B

B 행렬과 한 row씩 곱해서 구하는 법

4 column \(\times\) row

column of A \(\times\) row of B

\(m \times 1\) and \(1 \times p = m \times P\)

ex) \(\begin{bmatrix} 2 \\ 3 \\ 4 \end{bmatrix} \begin{bmatrix} 1 & 6 \end{bmatrix} = \begin{bmatrix} 2 & 12 \\ 3 & 18 \\ 4 & 24\end{bmatrix}\)

\(3 \times 1\) \(1 \times 2\) = \(3 \times 2\)

$AB = $Sum of (Columns of A) (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}\)row1 \(+ \begin{bmatrix} 7 \\ 8 \\ 9 \end{bmatrix} \begin{bmatrix} 0 & 0 \end{bmatrix}\)row2

A column과 B row를 product곱해서 구하는 법

All those rows lie on the same line.

\(\begin{bmatrix} A_1 & A_2 \\ A_3 & A_4 \end{bmatrix} \begin{bmatrix} B_1 & B_2 \\ B_3 & B_4 \end{bmatrix} = \begin{bmatrix} A_1B_1 +A_2B_3 & A_1B_2 + A_2B_4 \\ A_3B_1 + A_4B_3 & A_3B_2+A_4B_4\end{bmatrix}\)

블락 곱

단위행렬(Identity matrix)을 만들수 있는 역행렬(Invertible matrix)을 가진 행렬의 특징: nonsingular

\(\to\) singular하면 역행렬이 없겠지?

\(A^{-1} A = I = AA^{-1}\)

If this matrix exists, how would you find this??

Note

역행렬 없는 예시

singular case, no inverse \(\to\) \(A = \begin{bmatrix} 1 & 3 \\ 2 & 6 \end{bmatrix}\)

square matrix has no invert.

If you can find a vector \(X\) with \(AX = 0\), \(X \ne 0\)

if \(X = \begin{bmatrix} 3 \\ -1 \end{bmatrix}\), \(\begin{bmatrix} 1 & 3 \\ 2 & 6 \end{bmatrix} \begin{bmatrix} 3 \\ -1 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix}\)

\(\begin{bmatrix} 1 & 3 \\ 2 & 7 \end{bmatrix}\) Is it invertible?

\(\begin{bmatrix} 1 & 3 \\ 2 & 7 \end{bmatrix} \begin{bmatrix} a & c \\ b & d \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\)

\(A A^{-1} = I\)

\(A\) \(\times\) column j of \(A^{-1}\) = column j of \(I\)

Gause-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}\)

A 행렬과 I 행렬로 long matrix로 만들기

\(\begin{bmatrix} A I\end{bmatrix}\)

\(\begin{bmatrix} 1 & 3 & 1 & 0 \\ 2 & 7 & 0 & 1 \end{bmatrix}\)

\(\begin{bmatrix} 2 & 6 & 2 & 0 \\ 2 & 7 & 0 & 1 \end{bmatrix}\) 이렇게 2배해서 빼기

\(\begin{bmatrix} 1 & 3 & 1 & 0 \\ 0 & 1 & -2 & 1 \end{bmatrix}\)

\(\begin{bmatrix} 1 & 3 & 1 & 0 \\ 0 & 3 & -6 & 3 \end{bmatrix}\) 이렇게 3배해서 빼기

\(\begin{bmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 7 & -3 \end{bmatrix}\)

\(\begin{bmatrix} I A^{-1}\end{bmatrix}\) \(\to\) Gause-Jordan idea

\(\begin{bmatrix} 7 & -3 \\ -2 & 1 \end{bmatrix} \begin{bmatrix} 1 & 3 \\ 2 & 7 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\)

\(A^{-1}A = I\)

\(E \begin{bmatrix} A I \end{bmatrix} = \begin{bmatrix} I A^{-1} \end{bmatrix}\)

\(\therefore EA =I, E = A^{-1}\) state of gausian elimination