05. Matrix multiplication, 2

05. Matrix multiplication, 2

Examples

We're going to do some examples of matrix multiplication.

Example:

Consider the 90 degree rotation matrix M = ( 0 - 1 1 0 ) . We have M 2 = ( 0 - 1 1 0 ) ( 0 - 1 1 0 ) = ( - 1 0 0 - 1 ) .

This makes sense: two 90 degree rotations compose to give a 180 degree rotation, which sends every point ( x y ) to its opposite point ( - x - y ) .

Example:

More generally, if R α = ( cos α - sin α sin α cos α )     R β = ( cos β - sin β sin β cos β ) are two rotations then the composite is R α R β = ( cos α - sin α sin α cos α ) ( cos β - sin β sin β cos β ) = ( cos α cos β - sin α sin β - cos α sin β - sin α cos β sin α cos β + cos α sin β - sin α sin β + cos α cos β ) = ( cos ( α + β ) - sin ( α + β ) sin ( α + β ) cos ( α + β ) ) = R α + β . (using trigonometric addition formulas). This is what we expect, of course: rotating by β and then α amounts to rotating by α + β .

Example:

Let I = ( 1 0 0 1 ) be the identity matrix and M be any matrix. Then I M = ( 1 0 0 1 ) ( M 11 M 12 M 21 M 22 ) = ( M 11 M 12 M 21 M 22 ) = M . Similarly, M I = M . As you can see, the identity matrix really plays the role of the number 1 here.

Example:

Let A = ( 1 0 0 0 ) and B = ( 0 1 0 0 ) . Then A B = ( 0 1 0 0 ) but B A = ( 0 0 0 0 ) . This shows that the order in which we multiply matrices matters: A B B A . So matrix multiplication is not commutative!

As an exercise, can you think of a matrix B which does not commute with A = ( 1 1 0 1 ) ?