06. Matrix multiplication, 3

06. Matrix multiplication, 3

Multiplying bigger matrices

(0.00) Suppose A is an m -by- n matrix ( m rows and n columns) and B is an n -by- p matrix ( n rows and p columns). To save our sanity, suppose m = 2 , n = 3 , p = 4 : A = ( A 11 A 12 A 13 A 21 A 22 A 23 ) , B = ( B 11 B 12 B 13 B 14 B 21 B 22 B 23 B 24 B 31 B 32 B 33 B 34 ) .

(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 11 B 11 + A 12 B 21 + A 13 B 31 .

  • 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 i th row and the j th column, we multiply the i th row of A into the j th 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 m -by- n and B is k -by- p but n k ? For example: ( A 11 A 12 A 21 A 22 ) ( B 11 B 12 ) 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 𝐑 2 𝐑 2 and B defines a transformation 𝐑 2 𝐑 , so while you can define B A : 𝐑 2 𝐑 2 𝐑 , 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: ( 0 0 1 1 0 0 0 1 0 ) ( x y z ) ( 1 2 3 - 1 1 / 2 0 ) ( 2 - 3 - 1 0 0 1 ) ( 1 - 1 1 - 1 ) ( 1 2 3 4 ) ( 1 2 3 4 ) ( 1 - 1 1 - 1 ) (see the video for solutions).