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=(A11A12A13A21A22A23),B=(B11B12B13B14B21B22B23B24B31B32B33B34).

(2.36) I claim that there's an obvious way to define AB given everything we've seen so far.

  • To get the top left entry of AB , we multiply the top row of A into the first column of B , giving A11B11+A12B21+A13B31 .

  • 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 AB 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 nk ? For example: (A11A12A21A22)(B11B12) 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 BA:𝐑2𝐑2𝐑 , you have no way of composing the transformations as AB (the domain of A is not the target of B ).

(8.15) As an exercise, do the following multiplications: (001100010)(xyz) (123-11/20)(2-3-1001) (1-11-1)(1234) (1234)(1-11-1) (see the video for solutions).