06. Matrix multiplication, 3
06. Matrix multiplication, 3
Multiplying bigger matrices
(0.00) Suppose A is an mbyn matrix (m rows and n columns) and B is an nbyp matrix (n rows and p columns). To save our sanity, suppose m = 2, n = 3, p = 4: A equals A_{1 1}, A_{1 2}, A_{1 3}; A_{2 1}, A_{2 2}, A_{2 3} and B equals B_{1 1}, B_{1 2}, B_{1 3}, B_{1 4}; B_{2 1}, B_{2 2}, B_{2 3}, B_{2 4}; B_{3 1}, B_{3 2}, B_{3 3}, B_{3 4}.
(2.36) I claim that there's an obvious way to define A B given everything we've seen so far.

To get the top left entry of A B, we multiply the top row of A into the first column of B, giving A_{1 1} B_{1 1} + A_{1 2} B_{2 1} + A_{1 3} B_{3 1}.

To get the next entry along, we multiply the top row of A into the second column of B.

We keep going: to get the entry of A B in the ith row and the jth column, we multiply the ith row of A into the jth column of B.
This means we end up with 2 rows (same number as A) and 4 columns (same number as B).
(4.38) You might ask: what happens if A is mbyn and B is kbyp but n is not equal to k? For example: A_{1 1}, A_{1 2}; A_{2 1}, A_{2 2} times B_{1 1}, B_{1 2} doesn't make any sense: the rows of A have length 2 and the columns of B have height 1, so we can't multiply rows into columns.
(6.13) This is reasonable: A defines a transformation from R 2 to R 2 and B defines a transformation from R 2 to R, so while you can define B times A From R 2 to R 2 to R, you have no way of composing the transformations as A B (the domain of A is not the target of B).
(8.15) As an exercise, do the following multiplications: the 3by3 matrix 0, 0, 1; 1, 0, 0; 0, 1, 0 times the 3by1 matrix x; y; z the 2by3 matrix 1, 2, 3; minus 1, a half, 0 times the 3by2 matrix 2, minus 3; minus 1, 0; 0, 1 the 1by4 matrix 1, minus 1, 1, minus 1 times the 4by1 matrix 1; 2; 3; 4 the 4by1 matrix 1; 2; 3; 4 times the 1by4 matrix 1, minus 1, 1, minus 1. (see the video for solutions).