03. Bigger matrices

03. Bigger matrices

Bigger matrices

Just as a 2-by-2 matrix defines a transformation of the plane, an m -by- n matrix defines a transformation 𝐑 n 𝐑 m . An m -by- n matrix is a rectangular array of numbers with m rows and n columns.

Example:

( a b c d e f ) is a 2-by-3 matrix.

The transformation 𝐑 n 𝐑 m associated to an m -by- n matrix M is the map v M v where:

  • v = ( x 1 x 2 x n )

  • M = ( M 11 M 12 M 1 n M 21 M 22 M 2 n M m 1 M m 2 M m n )

  • M v is the vector whose j th entry is obtained by multiplying the j th row of M into the column vector v , that is M v = ( M 11 x 1 + M 12 x 2 + + M 1 n x n M 21 x 1 + M 22 x 2 + + M 2 n x n M m 1 x 1 + M m 2 x 2 + + M m n x n )

This vector M v has height m because there are m rows of M to multiply into the vector v .

For example, ( a b c d e f g h i ) ( x y z ) = ( a x + b y + c z d x + e y + f z g x + h y + i z ) shows how a 3-by-3 matrix eats a vector of height 3 and outputs a vector of height 3.

Example:

Take M = ( cos θ - sin θ 0 sin θ cos θ 0 0 0 1 ) . We get M v = ( x cos θ - y sin θ x sin θ + y cos θ z ) . We see that this is a rotation of 3-dimensional space which fixes the z -axis and rotates by θ in the x y -plane. We call it a rotation by θ about the z -axis.

Example:

Take M = ( 1 0 0 0 1 0 ) . We need to feed M a vector of height 3; it will output a vector of height 2. In other words, M defines a transformation 𝐑 3 𝐑 2 . What is the transformation? ( 1 0 0 0 1 0 ) ( x y z ) = ( x y ) . This is the projection to the x y -plane (which squishes the z -axis to the origin).

Example:

Take M = ( 1 0 0 1 0 0 ) . This gives a map 𝐑 2 𝐑 𝟑 : ( 1 0 0 1 0 0 ) ( x y ) = ( x y 0 ) This is the inclusion map of the 2-dimensional x y -plane into 3-dimensional space (putting it at height zero).

3D space containing the xy-plane

These rectangular (nonsquare) matrices change the dimension of the space we're working with, e.g. map from a lower to a higher dimensional space or vice versa. You might wonder why we matrices which are bigger than 3-by-3, given that we live in a 3-dimensional universe. In fact:

  • the theory of special relativity treats space and time on an equal footing, and the Lorentz transformations, which describe all the weird relativistic effects like time dilation and length contraction, mix up space and time, and are given by 4-by-4 matrices.

  • in statistics, data is often represented as a vector of samples; the more samples you have, the bigger the dimension of the vector you need to encode them.

  • More examples

    Example:

    Take M = ( 1 1 2 0 0 1 ) . This defines a map 𝐑 2 𝐑 3 : M ( x y ) = ( x + y 2 x y ) . What does this map "look like"? Its image (the set of points in 3d which have the form M v for some v 𝐑 2 ) is a plane. To visualise the plane, we and draw the images of the x - and y -axes in 𝐑 2 :

    • The x -axis (vectors of the form ( x 0 ) ) goes to the set of vectors ( x 2 x 0 ) .

    • The y -axis (vectors of the form ( 0 y ) ) goes to the set of vectors ( y 0 y ) .

    The image of M is the unique plane containing these two lines.

    Plane in 3D
    Example:

    Take M = ( 1 0 - 1 0 1 - 1 ) . This defines a map 𝐑 3 𝐑 2 : ( 1 0 - 1 0 1 - 1 ) ( x y z ) = ( x - z y - z ) . What does this map look like? Let's imagine it's projecting from 3-dimensional space onto the x y -plane (by including 𝐑 2 into 𝐑 3 as the x y -plane). The points ( x y 0 ) on the x y -plane go to ( x y ) (i.e. they stay where they are). The point ( 0 0 1 ) on the z -axis goes to ( - 1 - 1 ) . This means that everything is being projected onto the x y -plane; the projection is along straight line rays which point in the ( - 1 - 1 - 1 ) -direction (because to get from ( 0 0 1 ) to ( - 1 - 1 0 ) you have to go backwards 1 in each of the x , y and z directions. This map is therefore a projection.

    Projection in (-1,-1,-1)-direction to xy-plane

    This line along which we're projecting has a name: it's called the kernel of M . More on this later.