04. Matrix multiplication, 1

04. Matrix multiplication, 1

Composing transformations

Recall that a 2-by-2 matrix defines for us a transformation of the plane. Suppose we are given two matrices A = ( A 11 A 12 A 21 A 22 ) , B = ( B 11 B 12 B 21 B 22 ) . They each define a transformation of the plane. What happens if we first do the transformation associated to B , and then do the transformation associated to A ?

We get a new transformation associated to a new matrix, which we call A ⁢ B . A ⁢ ( B ⁢ ( v ) ) = ( A 11 A 12 A 21 A 22 ) ⁢ ( B 11 B 12 B 21 B 22 ) ⁢ ( x y ) = ( A 11 A 12 A 21 A 22 ) ⁢ ( B 11 ⁢ x + B 12 ⁢ y B 21 ⁢ x + B 22 ⁢ y ) = ( A 11 ⁢ B 11 ⁢ x + A 11 ⁢ B 12 ⁢ y + A 12 ⁢ B 21 ⁢ x + A 12 ⁢ B 22 ⁢ y A 21 ⁢ B 11 ⁢ x + A 21 ⁢ B 12 ⁢ y + A 22 ⁢ B 21 ⁢ x + A 22 ⁢ B 22 ⁢ y ) = ( A 11 ⁢ B 11 + A 12 ⁢ B 21 A 11 ⁢ B 12 + A 12 ⁢ B 22 A 21 ⁢ B 11 + A 22 ⁢ B 21 A 21 ⁢ B 12 + A 22 ⁢ B 22 ) ⁢ ( x y ) = : ( A B ) v

Definition:

Given matrices A = ( A 11 A 12 A 21 A 22 ) , and B = ( B 11 B 12 B 21 B 22 ) , we define the matrix product A ⁢ B = ( A 11 ⁢ B 11 + A 12 ⁢ B 21 A 11 ⁢ B 12 + A 12 ⁢ B 22 A 21 ⁢ B 11 + A 22 ⁢ B 21 A 21 ⁢ B 12 + A 22 ⁢ B 22 ) .

Mnemonic

How on earth can we remember this formula? Here is a mnemonic. Just like when we act on a vector using a matrix, we can think of the entries of A ⁢ B as "multiplying a row of A into a column of B ". More specifically, to get the i ⁢ j th entry of A ⁢ B (i.e. i th row and j th column) we multiply the i th row of A into the j th column of B :

Mnemonic for matrix multiplication