Last time, we learned how to multiply two matrices. In this section, we can finally put this into applications. The first application we will do is the elementary matrices.
Remember the way we solve the linear system? We use Gaussian elimination. Let’s look at an example and see if we can understand the process from a new point of view.
Assume we are going to solve the below system:
The way we solve it is to do some row operation, namely, you take one row in the matrix and replace it with a modified version of it or you swap two rows. There are two ways to modify the rows, which is adding and multiplying. Let’s take a look at one row operation.
Now think about this: We learned the way of multiplying matrix and vector, the multiplication transformed that vector to another vector. So, can we write the above transformation as a matrix & matrix multiplication?
Let’s look at the columns before and after transform:
The “transformation” only made x value to be a half and leaved the y value, so if we are going to write the “transformation”, it should be:
We can check it by multiplying the two matrices:
Great, now we know that we can describe the row operation as a specific matrix multiplied on it. Actually, there is a name for that type of matrix, it is called elementary matrix. We can try to write down more elementary matrix in 2d and see what they look like.
Say we want to add the second row to the first row and replace the first one, what should we do?
We first start with an identity matrix. For 2d, the matrix will be a \(2\times2\) matrix.
Now let’s replace the first row:
Similarly, we can describe the swapping using elementary matrix:
For now, the elementary matrix is just a fancy way to write down the row operation of matrices. But why do we need such way to describe row operation? Let’s look at one of the applications of row operation, the Gaussian elimination.
Remember we solve linear system \(A\pmb{x}=\pmb{b}\) using the Gaussian elimination? What if we rewrite all the row operation to elementary matrices? We start with writing the augmented matrix:
Then we did some row operations to make the matrix to be the identity matrix:
At the same time, we do the same operations onn the vector \(\pmb{b}\):
If you take all the elementary matrice and multiply all of them together, we get:
Notice the definition of a matrix’s inverse is:
So, the matrix \(E_{total}\) is exactly the inverse matrix of \(A\)! Once we know that, we can replace the elementary matrices into \(A^{-1}\):
Well, this is exactly the method we used in the inverse matrix unit. Great! Let’s see if we can do more.
The second time that we used the row operation is to find the inverse of a matrix. Back then, we didn’t explain why the method work, now we learned the elementary matrices, we can see what actually happens.
To find the inverse, we first place the matrix and the identity matrix with the same size together:
Then we do Gaussian elimination for both sides. The goal is to make the left side of the augmented matrix be an identity matrix.
We can write the row operation as multiple elementary matrices:
Again, it is obvious that \(E_nE_{n-1}...E_2E_1 =A^{-1}\) so if we do the same row operations on the right side of augmented matrix(the identity matrix), we will get:
That is why we end up with the inverse of matrix \(A\).