Calculate $AB.$
$$A=\left[\begin{matrix}3 &4\\0 &-1\end{matrix}\right]\quad\text{and}\quad B=\left[\begin{matrix}-1 &4\\-3&1\end{matrix}\right]. $$ Thanks!
Calculate $AB.$
$$A=\left[\begin{matrix}3 &4\\0 &-1\end{matrix}\right]\quad\text{and}\quad B=\left[\begin{matrix}-1 &4\\-3&1\end{matrix}\right]. $$ Thanks!
While it is easy enough to explain the mechanics and chug through it... better to understand the why's.
When you multiply a vector by matrix.
$\begin{bmatrix} 3&4\\0&-1\end{bmatrix}\begin{bmatrix} -1\\-3 \end {bmatrix} = \begin{bmatrix} 3\\0 \end {bmatrix}(-1) + \begin{bmatrix} 4\\-1 \end {bmatrix}(-3) = \begin {bmatrix} -15\\3 \end{bmatrix}$
Think of the matrix as a function. The first column of the matrix tells you where you are mapping the first principal component and the second column tells you where you are mapping the second component.
If you multiply two matrices together, this is a composition of functions.
Mechancially, though, you map the first column as above, then you map the second column similarly.
$\begin{bmatrix} 3&4\\0&-1\end{bmatrix}\begin{bmatrix} 4\\1 \end {bmatrix} = \begin{bmatrix} 3\\0 \end {bmatrix}(4) + \begin{bmatrix} 4\\-1 \end {bmatrix}(1) = \begin {bmatrix} 16\\-1 \end{bmatrix}$
$\begin{bmatrix} 3&4\\0&-1\end{bmatrix}\begin{bmatrix} -1&4\\-3&1 \end {bmatrix} = \begin {bmatrix} -15&16\\3&-1 \end{bmatrix}$
Now if you just want an algorithm... "run along and dive in"
Run along the first row vector, and dive into the first column vector $(3)(-1) + (4)(-3)=-15$ for the first entry.
And each other entry is a corresponding product of row and column.