 So we've now seen that the key to solving linear systems has reduced, will reduce the matrix, the augmented matrix to an echelon form. Again, RREF is sort of like the ideal, but we can actually get away with it for any echelon form. So how do we actually accomplish that? We need an algorithm that is a process we can follow step by step, which when followed correctly, will always lead us to some echelon form. And we can actually do this recursively. Recursively meaning that the next step is dependent upon smaller cases, right? We can kind of work step by step through a matrix. And this is gonna happen by looking for pivots inside of the matrix. And that's actually why we call them pivots. If you think of it like a basketball analogy, right? If you're playing the game of basketball, put your, if you're holding the ball, right? You can't just run around with the ball. It's supposed to be dribbled. But if you've stopped dribbling, you kind of have to pivot. You keep one foot fixed on the ground and the rest of your body can turn around that pivot so that you can either shoot the ball, pass to a team member or something like that, right? And the idea is the whole matrix is gonna be pivoting around the number we're focusing on, the so-called pivot position. Now, once the pivot is done, you'll then pass the basketball to a different player who will then pivot around. And so as the pivots kind of move throughout the matrix, we can use that algorithm to help us reduce, reduce, reduce the matrix along the way. And this process is referred to as Gaussian elimination. And let me explain to you step by step what we're going to do. So if you take a, we'll use an example right here. This three by six matrix, it's got a three by five coefficient matrix. This matrix could correspond to a system of linear equations, right? So what you're gonna do is the step one, you're gonna look for the left most column. That is look for a column that contains non-zero's entries in it. The number itself could be zero, right? But look for a column, right? You'll notice there's some non-zero entries below it. So we look for the left most non-zero column. You might ask, if there is no non-zero columns, what do you do? Well, if there's no non-zero columns, that means every column is a zero column. You're in the zero matrix. The zero matrix is an echelon form. So you're done. It's kind of a weird situation, but you know, it's no big deal. So we only have to worry about row reduction when you have a non-zero column. So look for the first non-zero column on the left. It's oftentimes gonna be the first column. And then you're gonna place a pivot position in the top row of that column. So here we get a zero. Now, for our pivot positions, for our pivot here, we need something non-zero to be in the pivot position. This is why we were looking for the left most non-zero column. Now, in order to get something non-zero in that zero position, typically you're gonna want to do interchange. That is, just swap the zero position with something non-zero below it. So for example, let's just take the first two rows and interchange them. So we're gonna swap them. So row two is gonna come up here and become row one. And row one is gonna come down and become row two. So we just switch the rows. That's what interchange does. Now, throughout this whole situation, the pivot position didn't change. Although the pivot entry does change, the number in the pivot position does change based upon the interchange we just did. Now that we have a non-zero entry in the pivot position, what we're gonna do is we want to then zero out everything below it, which we already have a zero in the second row. That's great. We don't have a zero in the third row. So that's our target right here. How do we cancel out a four using multiples of two? Well, what we can do to accomplish this is we're gonna take row three and we're gonna add to it two times row one. Notice what happens here. If I take negative two and I times it by two, that's gonna give us a negative four. Negative four plus four is gonna give zero, so then I'll cancel it out. But then we have to do that for the rest of the row. If you take negative four times two, that's a negative eight. Negative two times negative, sorry, positive two times negative six, that's a negative 12. Two times one is a two. Negative one times two is a negative two. And then negative three times two is a negative six. Do pay attention to the signs. You're gonna notice here that when you combine these things together, zero or four and negative four gives you zero. Eight and negative eight cancels out, giving you another zero. 12 and negative 12 also gives you zero, so lots of zeroes here, right? Finally, something non-zero. One plus two gives you a three right here. And then lastly, negative two and negative two gives you a negative four. And that's the last for the coefficient matrix. We have to also do the last column. 16 and negative six gives you a 10, which gives you this right here. So we've now, now looking at the first column, if you look at just the first column and you ignore the rest of the matrix here, this column now looks like what it's supposed to be in if it were an echelon form. The pivot position is identified. We need zeroes below the pivot. That's what we're trying to construct. To be an echelon form, we don't have to have a one there. And we could have divided the first row by two, a negative two, but I don't really wanna do that because there are some odd numbers. That is numbers not divisible by two. If I started dividing by negative two, I would have gotten some fractions and I don't really wanna do that unless I really have to. So I'm just gonna delay doing that for now. And so then when you look at the first row, we're done, right? Negative two, a zero zero, that's all we need. So because of that, we're gonna move our pivot to the next position, right? But when you look for the next pivot, let me back up for a second. You do this recursively. To find the next pivot, you ignore the column, you ignore the column and row for which the previous pivot was located in. So you look at just this sub matrix. You look only inside of this matrix right here and you look for the leftmost column. Well, it's not that one, it's not that one. It's actually gonna be the fourth column that we find something non-zero right here. So it's in this position. So now our new pivot position is gonna be in the two, four position. Let me kind of erase this and clean it up a little bit. So our pivots, we have the original pivot position in one, one, but then the next pivot is gonna be here in two, four. Remember, we ignore the first, we ignore pivot rows and columns when we look for the new pivot. So the rest of the problem is gonna be focused around this point right here, at least for the next little while. Now this pivot position has to be a non-zero number, which we do have that, it's already negative two. So no interchange was necessary. The next thing to do is then to do some type of row replacement. We wanna cancel out some things below it. And so in this situation, how do you cancel out a three with a negative two? Well, the answer is kind of always gonna be clear. You're just gonna take row three and then you're gonna add to it. The reason I'm adding is because this is a positive and this is already a negative, so I don't need to multiply anything by negative here. But we're just gonna take three divided by two times R2. Basically, I took on top the number I need and I divided by the number I have, right? So another way of thinking about this is really you're always gonna subtract this thing. Always gonna subtract this thing but then I divided by negative two. So it's a double negative, it'll simplify in that regard. So I'm gonna think of it as a double negative right there. It's a positive. And so that's how we're gonna proceed. So therefore, if you take three halves times negative two, you're gonna get a negative three. Those guys are gonna cancel out. Do that for the next piece. You're gonna get a nine halves. You're gonna combine that with a negative four. Really not a whole lot you can do about that one just except deal with the fractions there. And then you're gonna have a negative seven, which times by three halves, it's gonna give you negative 21 halves like so. All right? So now you have to kind of just deal with the fractions as they are. The three minus three will cancel out, thus giving us a zero down here. The fractions on the other spots are somewhat unavoidable because you're gonna get nine halves with negative four. Negative four is the same thing as negative eight halves which combines together to give us a positive one half. That's not so bad. And then you're gonna take negative 21 halves combined with 10, which is 20 halves. That combines to give us a negative one half. And now that, then we look at this row right here, this column, excuse me, the pivot position here, everything below it is now a zero. So now we're now done with that row. So ignoring, I mean, our pivots, we had a pivot in the one, one and the two, four position ignoring the pivot rows and columns. Whoops. So we now search for the left most non-zero column. That's gonna be the one half right here. This is our final pivot position. But as everything below it is already, well, there's nothing below it. This is now an echelon form. So kind of backing up right here. This matrix we now see is an echelon form. This is a matrix of rank three. There's three pivots in this matrix. It's an echelon form. So once you find echelon form, Gaussian elimination says then convert the matrix back into a system of equations and then solve this system of equations by back substitution. So to solve for x five, divide both sides by one half and you'll end up with x equals negative one. Should say x five equals negative one there. You're then gonna take negative one and plug it into this equation right here. So we see the negative two x to the four, two x four plus three times negative one equals negative seven. We're gonna get negative two x to the fourth minus three equals negative seven. Add three to both sides, negative two x to the fourth. Like I said, if you add three to both sides, you can negative four divide by negative two x to the fourth equals positive two. That gives us our second value right there. Then with x four and x five, we're then gonna plug those into this spot in the equation here. And so what we see here is we get negative two x one minus four x two minus six x three. We're gonna get plus two. We're gonna get minus minus one. So it's a plus one equals negative three. Notice these things add up together to give us a three. If you subtract three from both sides, you're gonna get a negative six in this side, negative two x one minus four x two minus six x three. This is equal to negative six. And now if I solve for x one because now you have three variables left but this is your last equation. What this tells us is that there's no restriction placed on x two and x three. Notice in the previous matrix, right? The second and third columns were non-pivot columns. These will correspond to free variables. So this matrix would have multiple solutions here. So continuing to solve for x one here, you're gonna get the x one equals positive two x two positive three x three and then minus three. I also took the liberty of dividing by two. Actually, I think I might've got a little ahead of myself there. So let me, let me actually try that again here. Negative two right here. So you move the x to this side, you get a positive four x two. Then you also have a positive six x three and you'll have a negative six. Now we divide by the negative two you get x one equals negative two x two minus three x three and a positive three. So this is what your solution would look like. You're generally speaking, let's say that x two is the number s and x three is the number t. What we're gonna see then as our solution is that x one looks like negative two s minus three t plus three, x two is s, x three is t, x four is actually a number two and x five is a specific number. It was negative one. And so our solution, our general solution would look like this. There are two free variables in play here but we were able to solve this system of equations using back substitution, using this technique of Gaussian elimination. We can always solve this, we can always solve systems of equations using this type of Gaussian elimination.