Professor Dave here, let’s work with matrices.
Now that we know how to represent systems of linear equations with matrices, we need
to learn about what to do with these matrices that will allow us to solve these systems.
We want to find out whether a system has zero, one, or infinitely many solutions, and if
there is one solution, we want to find precisely what it is.
What are some techniques that we can use to do this?
The main strategy that we will use involves manipulating the system to produce a new system
of equations with the same solution as the original one, but is much easier to solve.
How can we do this?
Actually, this is still the same concept that we learned in algebra.
We can manipulate the equations in a system in any way we want that is algebraically valid,
meaning we can do anything we want to an equation as long as we do it to both sides of the equation.
Say we have the following system of two linear equations, four X plus six Y equals negative
two, and five X minus three Y equals eight.
Let’s go ahead and generate the corresponding augmented matrix, which will be two by three,
with four, six, and negative two in the first row, and five, negative three, eight in the
second row.
One option available to us is to take any equation and multiply or divide by some number.
How about we take the first equation and divide everything by two?
This shouldn’t change the equation, or the system, because everything will be in the
same proportion.
We can also just do this to each term in the first row of our matrix, but just for clarity,
let’s do both of these things so that we have equations to look at while we do matrix
operations.
Dividing through, we get two X plus three Y equals negative one, and we alter our matrix
accordingly.
We can multiply or divide any equation in this manner, or the corresponding row, by
any number we want except for zero.
The reason we divided by two is simple.
Because now we can use another technique.
We can take any two equations in the system and add or subtract them to produce another
valid equation that will be part of the system.
This is another technique we learned in algebra.
Now with the matrix, we want to retain the dimensions of the matrix, so let’s say we
decide that we want to add the two rows together, let’s do so and replace the second row with
our result.
We can achieve this by adding the values in the first row to the values in the second
row below.
To five we add two, and get seven.
To negative three we add three, and get zero.
To eight we add negative one, and get seven.
So to summarize, we can add or subtract any two rows to generate a new row without affecting
the solution to the system.
Combining this with the previous technique, where we could multiply or divide any row
by some number, we can actually add or subtract any multiple of any row to any multiple of
any other row to get a new row, or even simply swap two rows without changing any of the
values, all without affecting the solution to the system.
This opens up a lot of possibilities for what to do with a system of equations.
Now, take a look at what we are left with in the second row.
Seven, zero, seven.
This is the same as the equation seven X plus zero Y equals seven.
This is trivial to solve, X equals one.
Plugging that into any other equation, we end up with negative one for Y, and we have
solved the system.
So as we can see, the key is getting rows with zeroes in them.
If we took this row and divided by seven, we would get one, zero, one, and then we don’t
even have to use any equations, the matrix spits out the answer.
So the goal for any linear system is to write out the augmented matrix and do elementary
row operations until each row has a one in one of the columns and zeroes in the rest,
except for the rightmost column, which will give us the value for the variable that corresponds
to the position where the one is located.
When we perform this on a matrix alone, this technique is called Gauss-Jordan elimination.
Let’s go through one full example together.
Take the following equations: X plus two Y plus three Z equals one, two X plus four Y
plus seven Z equals two, and three X plus seven Y plus eleven Z equals eight.
Let’s go ahead and construct our augmented matrix, which will be a three by four matrix,
since we have three equations and three unknowns.
Now, what elementary row operations jump out at us?
There are plenty of ways we could do this.
One thing we could notice is that the coefficients in the first column are one, two, and three.
What if we subtract both the first and second row from the third row, to get a new third row?
Three minus two minus one is zero.
Seven minus four minus two is one.
Eleven minus seven minus three is one.
And eight minus two minus one is five.
Getting a zero is always productive, so that was a good start.
What next?
Let’s say we notice that the first two coefficients in the first row are precisely half the corresponding
second row coefficients, so what we can do is subtract twice the first row from the second
row, to get a new second row.
So two minus twice one is two minus two, or zero.
Four minus twice two is four minus four, or zero.
Seven minus twice three is seven minus six, or one.
And two minus twice one is two minus two, or zero.
That was a very productive move, because we have just solved for one of the variables.
Z must be equal to zero.
Now we are in great shape to solve for X and Y.
Let’s subtract the second row from the third row to get a new third row, because that will
get rid of this one in the third position, and now we have zero, one, zero, five.
That means Y must be equal to five.
And now it’s easy to finish things off, because we have two variables isolated.
The first row minus twice the third will give us one, zero, three, negative nine, and then
from that we can subtract three times the second row, to get one, zero, zero, negative nine.
Just for the sake of aesthetic let’s swap the position of the second and third rows
so that we have the ones along the diagonal, and that leaves us with our solution spelled
out for us nice and easy.
X is negative nine, Y is five, and Z is zero.
Once again, we could have ended up with no solutions if the system was inconsistent,
or we also could have ended up with infinitely many solutions, but in this case, we got just one.
There is a way to tell how many solutions there are once Gauss-Jordan elimination is
complete, which will be the case once the matrix is in reduced row-echelon form, which
can be abbreviated this way.
A matrix is in reduced row-echelon form when any row with non-zero entries has a one as
its first entry.
This is called a leading one.
Wherever there is a leading one, all the other entries in that column are zero.
And for any row with a leading one, there is a leading one in the row above that is
further to the left.
Once we have a matrix in this form, Gauss-Jordan elimination is complete, and we can look at
the rank of this matrix.
The rank is the number of leading ones.
If the rank is equal to the number of columns in the coefficient matrix, the system has
at most one solution, meaning this will typically result in a unique solution.
If the rank is less than the number of columns in the coefficient matrix, the system has
either infinitely many solutions, or none, if the rank of the coefficient matrix is less
than the rank of the augmented matrix.
So as we can see, elementary row operations are no different than what we learned in algebra,
it is just that we are applying them to a matrix, and getting a solution for the system
that does not require manipulating equations, by using Gauss-Jordan elimination.
This may seem arbitrary right now, but as we proceed through linear algebra, we will
learn about all kinds of things we can do with matrices, so let’s move forward and
continue expanding our understanding of these, right after we check comprehension.