Solving a system of equations at once, by simply augmenting the matrix and applying elementary row operations to both sides.
The familliar basic process:
e.g.:
We can solve it using gaussian elimination by hand, by eliminating variables, until only one is left:
Now we can solve for :
For :
And for :
Gaussian elimination with matrices
Representing systems of equations as matrices is how every computer solves them.
e.g. continuing with the example from the introduction, we can pull out the coefficients into a matrix:
Now again, we want to eliminate variables from the equation.
is our first so called pivot. We want to knock out from the second equation / row by subtracting times the first row:
We apply the same operations to the vector , which we carry along with us in the augmented matrix.
Step is done and there’s nothing to do in step as is already .
Now clearing out (subtracting times the newly obtained second from the third row):
We now have an upper triangular matrix in row echelon form, with three pivot columns along the main diagonal. And we have a new vector after the elimination.
The determinant of this matrix would be the product of the main diagonal.
Gaussian elimination vs Gauss-Jordan
Gaussian elimination → row echelon form.
Gauss-Jordan → reduced row echelon form.
RREF lets you read off solutions directly (no back-substitution) and compute inverses (by doing , because for invertible matrices, RREF of is see below).
Here we just do Gaussian elimination + back-substitution:
Now we do “back-substitution” of the values into a system of equations:
And solve the S.O.E. in reverse order:
The steps we took can be expressed as multiplying with some elimination matrix (elementary matrix) :
Column operations are not allowed, as they would change the equations we are trying to solve.
Finding the Inverse with Gauss-Jordan elimination
Link to originalComputing inverses via RREF
For invertible , the RREF of the augmented matrix is :
where .
This is the Gauss-Jordan algorithm: apply row operations to until the left side becomes ; the right side becomes .
Gauss-Jordan
A is invertible, since is positive / the vectors are pointing in different directions.
Now finding the Inverse is just like solving two systems of linear equations!
By the gauss-jordan method, we can solve them at once, by augmenting the matrix, i.e. carrying the right side of the equations with us / applying the same elimination steps to it. Our goal is to transform into . By the end of the elimination, the augmented part will have turned into the inverse matrix:
So we applied an elimination to , such that turns into the inverse, so by definition, is the inverse:
We discovered it step by step, as we multiplied the partial ‘s with the identity.
My first intuition was to view it like this:
Link to original
It’s just like the usual transformations when solving equations
(, just imagine matrices being divisible).
References
Gilbert Strang OCW lecture Lecture 2: Elimination with matrices