 In the previous video, we learned about Gaussian elimination and how this can be used to solve a system of equations by row reducing the augmented matrix to an echelon form and then you solve the corresponding system of equation from the echelon form using the technique of back substitution. Now a variant of Gaussian eliminations, what's known as Gauss-Jordan elimination, for which the idea behind Gauss-Jordan elimination is that row reducing is an effective tool to form an echelon form, but if we want an echelon form the row reduced echelon form is the most desirable echelon form. It'll be unique and once it's once you have it the problem is basically over with and so can we not just get any echelon form but how do you get the row reduced echelon form? So Gauss-Jordan elimination comes in what we call two phases. We call the first one the forward phase and the second one the backwards phase. The forward phase is essentially just Gaussian elimination. You row reduce the matrix until it's an echelon form, always focusing on getting zeros below the pivots and you work left to right. The backwards phase works very similarly but in the backwards phase we will rescale our pivots so that they're one, we don't do that in the forward phase, we rescale the pivots so that they're one and then we start making zeros form above the pivot positions but this time we work right to left, hence why we call it forward and backwards. In English we read left to right and so therefore that's the forward phase and right to left is the backwards phase from this from the English language perspective. And so let's an example of how one might do that. Consider the following augment in matrix A. It has a four by four coefficient matrix illustrated here on the screen. If we look for the leftmost column that will be the first column it typically is. We have a zero in this position and so one of the best ways to get a non-zero entry in the pivot position would just be to interchange. That's typically why we use the interchange operation to get a non-zero entry in the pivot position. I'm gonna pick the second row for the following reasons. I mean the fourth row has a zero in it so that wouldn't help us. And honestly when it comes to multiplying I'd rather have a one than a three so I think the one's a little bit more preferable here. So the first row of the new matrix was the second row of the first matrix and then the first row of the first matrix is the second row of the second matrix. So those are gonna swap roles right there. Now looking at our pivot position again here we want to zero out everything below which that only remains there's only something non-zero in the third row right there. So to give it of the three in the third row we're gonna replace row three with row three minus three times row one. You'll notice one times negative three is a negative three. Those will cancel out. We'll get a negative three again. We're gonna get a negative six, two times negative three, four times negative three is a negative 12 and then three times negative three is a negative nine. Combine those things together. Notice that the three minus three will cancel. Given this is zero that's to be expected. Seven minus three is gonna give us a four. Negative six and negative six actually gives you a negative 12 not a zero double check that one. And then eight minus 12 gives us a negative four and one minus nine is a negative eight. So we replace the rows there and so that then takes care of our first column. Everything below it's now a zero. So ignoring the first that the the pivot the first pivot row in the first pivot column we didn't look for the next pivot which the leftmost column will be now the second column. This puts us a pivot position in the two-two position. It's non-zero so that's great. So let's start zeroing things out below it. To give it of the four that's below the one I'm gonna take row three and subtract from it four times row two and to give it of the negative one right here I just need to add to row four row two. And so notice you was gonna see I'm actually gonna do two elementary row operations at the same time. If you have to add two rows together that is acceptable. You don't want to do too much all at once but doing these simultaneous row replacements is not gonna be as long as you're right down. I don't think it's gonna be doing demanding too much of you so feel free to do that. Again if you write the super scripts I think that really helps you avoid some common arithmetic mistakes here. So if we take row two and times it by negative four we get minus four. We get positive 12. We get positive four and then we're going to get positive eight like so. If we do row row two time we just added right so plus one minus three minus one and then minus two. So when we combine some things together let's do row three first. That cancels that cancels that cancels and that cancels. You'll now notice we have a row of zeros which is perfectly acceptable. Notice this is not a contradiction we don't have zeros on the left equaling something non-zero on the right so this is not evidence that the system is inconsistent because if it wasn't consistent we could stop because we know there's no solution. This is actually an identity. This identity basically tells us nothing. It doesn't tell us anything. The system could still be inconsistent for all we know. This isn't gonna be helpful for we're just gonna throw zeros at the bottom. That's why we throw rows of zeros at the bottom because they're not extremely useful in helping us determine the system of equations here. As for the fourth row right the ones will cancel out the threes also cancel out but no cancellation out here four minus one is a three and then negative four negative two is a negative six like so. So then we have a one one there we have to look for the next pivot position right. If we ignore the columns and rows that have pivots in them this right here is the sub matrix we now have to consider. The first column right here is a column of zero so we're gonna go to the next column over and so our next pivot position is going to be in the three four position but we need something non-zero here so interchange rows three and four and now we're gonna see that our matrix looks like the following. So notice that by requiring we have something non-zero in our pivot positions that automatically put that row of zeros at the bottom that's gonna that's to be expected when you work on these type of exercises. At this moment the matrix is now in echelon form. If you wanted to solve the system of equations by Gaussian elimination this is the moment which you would break and then you would start looking at the system of equations x one plus two x two plus two x three plus four x four is equal to three x two minus three x three minus x four equals negative two and then you're gonna get that three x four equals negative six you get zero over zero which really means you don't even need it it doesn't add anything to your system there it doesn't take anything away and so then you could solve that system by back substitution that would be perfectly fine that's how you solve it using Gaussian elimination we want to do Gauss Jordan elimination which means we've now finished the forward phase this is the forward phase of the algorithm to go to the backwards phase we've now identified all of our pivot positions and I should mention that since our matrix is in echelon form I'm gonna go back a second since our matrix here is in echelon form we know that the system is consistent because there's no contradictions those would have emerged by now we also know that this system will have multiple solutions because we have a non pivot column in number three x three is gonna be a free variable for this system x one two and four are gonna be dependent variables we'll see some more about that in just a second so we know a lot about the solution set there's gonna be multiple solutions with one free variable but it is consistent now to start moving into the backwards phase we want to get ones in this pivot position so starting on the right and moving left you see there's a pivot position that the particularly the four the three four position there's a three there we don't want a three there so we're gonna divide that row by three we're gonna divide the third row by three now that might mean introducing fractions at this point but fortunately a negative six there is divisible by three so we're good to go and so going back to the slide we see the pivot position in the third row is now a one and then that negative six became a negative two when we divided by three next we want to working right to left so working on the the right most pivot we now want to get rid of all the entries above the pivot that are not already zero and the way we do that is similar to how we got zeros before to get rid of the four right here we need to take row one and minus if subtract from it four times row three notice to do that you're gonna get minus four and you're going to get a plus eight that's what's gonna be happening right there you'll notice I didn't write any numbers over here but that's because when you look at this if you take negative four times zero and you add a tending number it's just gonna be a zero nothing's gonna be changing this is why we actually do the forward phase in the backwards phase separately because when we do the backwards phase there's a ton of zeros inside of the matrix and so therefore a lot of the positions which we might have to have done arithmetic on are actually gonna be a nor ignored this makes it a lot more efficient to get a negative one right here we just need to take row two and add to it row three so we add one and we minus two and so upon doing that the negative four and the one negative one or sorry the positive four negative one are gonna disappear giving us zeros right here three and eight is 11 and negative two negative two is negative four so now our matrix we look at that pivot in the fourth column the that column now looks like what it's supposed to there's the pivot is one and every other number in that column is zero focus then on the next pivot over climbing up the ladder this time we have to give it of the one in this position so to do that we're gonna take row one and we're going to subtract from it row two so we get a minus one right here you do have to make sure you do this column right here so you're gonna get a positive three this comes as zero so you can ignore it this columns is zero so you can ignore it and then you're gonna add four right there so combining these things together in the second column you're gonna get a zero right here you're gonna get a five right here and then in the last column you get a 15 and so that then takes care of this call the second column right the pivot is a one everything else is a zero then when you look at the first column it already has a pivot of one we can scale if we have to to make sure there's a one there everything blows a zero and there's nothing above so it's already there so this matrix now is in row reduced echelon form this is the RREF and so when we look at the solution we can see the following think of the system of equations now the system of equations you're going to get that x 1 plus 5 x 3 equals 15 we're gonna get that x 2 minus 3 x 3 equals negative 4 and we get that x 4 equals negative 2 so solve the dependent variables for with respect to the free variables the dependent variables will be those that correspond to pivots so we're gonna see that x 1 equals 13 minus 5 x 3 we're gonna see that x 2 equals negative 4 plus 3 x 3 and then x 4 is always negative 2 irrelevant of any other value and so this is gonna be our general solution if we say like oh like let x 3 be arbitrarily chosen v 2 then the solution set would look like the following you get 13 minus 5 t you're gonna get negative 4 plus 3 t you're gonna get t and you're gonna get negative 2 this is the general solution we find from the RREF and this is the same solution we would have gotten had we solved using Gaussian elimination Gauss Jordan elimination has this has the benefit that when you have the RREF the problem is essentially done so there's no more work to be done so the difference between Gauss Jordan and just Gaussian elimination is the second half of the problem the backwards phase do we want to do that in the matrix or do we want to do that with the system of equations and for the most part I think we're gonna get much more comfortable with the row operations with respect to a matrix and therefore good for the most part gonna want to be row reducing this matrix to echelon form using Gaussian elimination I do want to mention that the Gauss elimination algorithm we just saw essentially shows that every matrix can be row reduced to an RREF and that RREF has to be equivalent and so because every matrix has a unique RREF we can see that two matrices are row equivalent if and only if they have the same RREF and if two row two matrices are row equivalent then in fact the corresponding systems of equations are equivalent as well so the RREF determines uniquely what the solution set of the corresponding make the system of equations is and which is why it's so important which is why we spent this lecture discussing how we can strategically use the row elementary operations to help us compute echelon forms especially the row reduced echelon form that then ends for us chapter six which introduces us to the basic ingredients of linear algebra and the next chapter chapter two we're gonna focus on vectors the algebra geometry of vectors and use some of the techniques we've learned about vectors there but also add unto it some more take a look for that with the link that's on the screen now and I hope to see you next time everyone bye