Visualizing Matrix Multiplication
In our college, we were often taught Linear Algebra as some bunch of algorithms. We were given some predefined steps to calculate a determinant of a matrix or a strange way to multiply matrices. We were never told why the procedure works the way it does, or what it means geometrically to do it.
In this post, we will be understanding what “multiplying” one matrix with another means. I have already talked about determinants which you can refer to in
Matrix multiplication can be taught of as a linear transformation of one or more vectors.
Let’s start with a simple example, consider the following matrix equation AX=B:
Here, A is called the Transformation matrix . Transformation matrix defines the basis vectors for the subspace in which we transform the vector X .
In our example, we transform the vector X in a 2D space whose basis vectors are the two column vectors of A resulting in the vector on the right hand side of the equation.
This is X initially(before transformation) in a 2D space that is defined by the standard basis vectors
This is X defined by column vectors of transformation matrix A(After Transformation)
The vector [1, 2] is transformed to [-1,-2] by the transformation matrix A.
This is what matrix multiplication means, we transform a vector(vectors if X is an augmentation of 2 or more vectors ) from a subspace defined by standard basis vectors to a subspace defined by the column vectors in the transformation matrix
Multiplying matrices of different dimensions :
If the transformation matrix is not square, we transform X to an another dimension. For example,
The 3 dimensional vector X is transformed into the 2 dimensional vector B defined by the three column vectors of A. In this process, some vectors collapse into the origin. These vectors together are called the “Null Space”