[Linear Algebra] 4. Matrix multiplication as composition

2022. 3. 12. 12:36Mathematics/Linear Algebra

Linear transformation is completely determined by where the basis vectors($\mathbf{\hat{i}}$ and $\mathbf{\hat{j}}$) land.

Matrix multiplication

Let's describe the effect of applying one transformation and then another. The overall effect is a new distinct linear transformation, called composition of the two separate transformations. Like any other linear transformation, it can be described with a matrix, by following $\mathbf{\hat{i}}$ and $\mathbf{\hat{j}}$.

How to describe new linear transformation by matrix? If you have vector $\mathbf{\vec{x}}$, and apply it through $A$ linear transformation, then apply to $B$ linear transformation. 1). Multiply $\mathbf{\vec{x}}$ by $A$ matrix ($\mathsf{M1}$) then 2). multipy that on $B$ matrix ($\mathsf{M2}$). But, whatever the result is, it will be the same as just applying new composition matrix ($\mathsf{M3}$).

$$
\underset{\mathsf{M2}}{\begin{bmatrix}a & b \\ c & d\end{bmatrix}}
\underset{\mathsf{M1}}{\begin{bmatrix}e & f \\ j & h\end{bmatrix}}
\underset{\mathbf{\vec{x}}}{\begin{bmatrix}x \\ y\end{bmatrix}}
=
\underset{\mathsf{M3}}{\begin{bmatrix}i & j \\ k & l\end{bmatrix}}
\underset{\mathbf{\vec{x}}}{\begin{bmatrix}x \\ y\end{bmatrix}}
$$

It's reasonable to call this new matrix ($\mathsf{M3}$), the product of the original two matrices.

Always remember, that multiplying two matrices like this has the geometric meaning of applying one transformation then another.

But to find its composition matrix, we need to use the numerical entries in each matrix. 1). figure out where $\mathbf{\hat{i}}$ and $\mathbf{\hat{j}}$ go after applying $\mathsf{M1}$. (the new coordinates of $\mathbf{\hat{i}}$ and $\mathbf{\hat{j}}$ are columns of $\mathsf{M1}$), then 2). to see what happens after applying $\mathsf{M2}$, multiply the $\mathsf{M2}$ by each columns of $\mathsf{M1}$.

$$
\underset{\mathsf{M2}}{\begin{bmatrix}a & b \\ c & d\end{bmatrix}}
\underset{\mathsf{M1}}{\begin{bmatrix}e & f \\ g & h\end{bmatrix}}
=
\underset{\mathsf{M3}}{\begin{bmatrix}? & ? \\ ? & ?\end{bmatrix}}
$$

$$
\begin{bmatrix}a & b \\ c & d\end{bmatrix}
\begin{bmatrix}e \\ g\end{bmatrix}
=
e \begin{bmatrix}a \\ c\end{bmatrix} +
g \begin{bmatrix}b \\ d\end{bmatrix}
=
\begin{bmatrix}a \times e + b \times g \\ c \times e + d \times g\end{bmatrix}
$$

$$
\begin{bmatrix}a & b \\ c & d\end{bmatrix}
\begin{bmatrix}f \\ h\end{bmatrix}
=
f \begin{bmatrix}a \\ c\end{bmatrix} +
h \begin{bmatrix}b \\ d\end{bmatrix}
=
\begin{bmatrix}a \times f + b \times h \\ c \times f + d \times h\end{bmatrix}
$$

$$
\underset{\mathsf{M2}}{\begin{bmatrix}a & b \\ c & d\end{bmatrix}}
\underset{\mathsf{M1}}{\begin{bmatrix}e & f \\ g & h\end{bmatrix}}
=
\underset{\mathsf{M3}}{\begin{bmatrix}a \times e + b \times g & a \times f + b \times h \\ c \times e + d \times g & c \times f + d \times h\end{bmatrix}}
$$

 

 

Let's think more about matrix mulitiplication calculating process. 

더보기

first matrix calculating process is $\mathbf{\hat{i}} \rightarrow e\mathbf{\hat{i}} + g\mathbf{\hat{j}}, \ \ \mathbf{\hat{j}} \rightarrow f\mathbf{\hat{i}} + h\mathbf{\hat{j}}$.


so let's think different way about second matrix calculating process like below.

$$
\mathbf{\hat{i}_\text{land}} \rightarrow a\mathbf{\hat{i}_\text{land}} + c\mathbf{\hat{j}_\text{land}}, \ \
\mathbf{\hat{j}_\text{land}} \rightarrow b\mathbf{\hat{i}_\text{land}} + d\mathbf{\hat{j}_\text{land}} \quad
\left(\mathbf{\hat{i}_\text{land}} = e\mathbf{\hat{i}} + g\mathbf{\hat{j}}, \ \mathbf{\hat{j}_\text{land}} = f\mathbf{\hat{i}} + h\mathbf{\hat{j}}\right)
$$

$$
a\mathbf{\hat{i}_\text{land}} + c\mathbf{\hat{j}_\text{land}}
=
a \begin{bmatrix} e \\ g \end{bmatrix} + c \begin{bmatrix} f \\ h \end{bmatrix}
=
\begin{bmatrix}a \times e + c \times f \\ a \times g + c \times h\end{bmatrix}
$$

$$
b\mathbf{\hat{i}_\text{land}} +d\mathbf{\hat{j}_\text{land}}
=
b\begin{bmatrix} e \\ g\end{bmatrix} + d\begin{bmatrix} f \\ h\end{bmatrix}
=
\begin{bmatrix}b \times e + d \times f \\ b \times g + d \times h\end{bmatrix}
$$

$$
\begin{bmatrix}a & b \\ c & d\end{bmatrix}
\begin{bmatrix}e & f \\ g & h\end{bmatrix}
=
\begin{bmatrix}a \times e + c \times f & b \times e + d \times f \\ a \times g + c \times h & b \times g + d \times h\end{bmatrix}
$$

This calculating process makes nonsense result. For example, we all know that $\begin{bmatrix}e & f \\ g & h\end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix}$ and $\begin{bmatrix} e \\ g \end{bmatrix}$ is equal, but $\begin{bmatrix}a & b \\ c & d\end{bmatrix} \begin{bmatrix}e & f \\ g & h\end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix}$ and $\begin{bmatrix}a & b \\ c & d\end{bmatrix} \begin{bmatrix} e \\ g \end{bmatrix}$ is not equal. Because former $\begin{bmatrix}a & b \\ c & d\end{bmatrix}$ use $\mathbf{\hat{i}_\text{land}}$, $\mathbf{\hat{j}_\text{land}}$ as basis vectors and latter $\begin{bmatrix}a & b \\ c & d\end{bmatrix}$ use $\mathbf{\hat{i}}$, $\mathbf{\hat{j}}$ as basis vectors. So to make them equal, we have to use the same basis vectors($\mathbf{\hat{i}}$ and $\mathbf{\hat{j}}$). Additionally, $\mathbf{\hat{i}_\text{land}}$ and $\mathbf{\hat{j}_\text{land}}$ might not be a basis vectors.