 So far in lecture 13, we have learned how we can encode a system of linear equations using augmented matrices. And we've learned that if that augmented matrix is in echelon form, especially if it's in row reduced echelon form, then we can easily solve the associated system of linear equations. So then I left us in the last video with a promise. If we can change a matrix, that is if we can row reduce a matrix so that it becomes echelon form or even better row reduced echelon form. And if we can do that in such a way that it doesn't change the solution set, then that will give us a method for solving systems of linear equations. And the way that we can do that is to use the so-called elementary row operations. These elementary row operations are three operations we can do to an augmented matrix that'll change the matrix. And if done strategically, we'll row reduce the matrix until we can obtain an echelon form and we can continue on actually to get to row reduced echelon form which is what our goal is gonna be. There's three elementary row operations called replacement interchange and scaling. We'll talk about the details of those in just a second. But if you have two linear systems, we say that they're row equivalent. If there's some sequence of row operations that transforms one linear system into the other. And since we can represent linear systems using augmented matrices, that's typically how we do it. We perform the elementary row operations to a matrix. We transform the matrix into a new matrix and then those two matrices will be row equivalent. Now, what's important here is this theorem, two linear systems are considered equivalent if and only if they're row equivalent. Let's make sure we understand what these words mean here. Row equivalent means that there's a sequence of row operations that transforms one system into the other. For two systems of equations to be equivalent means they have the same solution set. Like two equations are equivalent if they have the same solution set. Two systems of equations is equivalent if they have the same solution set. So what this theorem tells us is that performing row operations to a linear system does not change the solution set. So if we use row operations in a strategic manner, we can row reduce the augmented matrix into echelon form, thus solving the system of equations. Now, what are the three elementary row operations? Let's look at them in a little bit more detail here. The replacement one, the replacement operation is the most complicated of the three elementary operations, but it's also the most important the one we use the most often. So the replacement says, we're gonna replace one row in a matrix by the sum of itself with a multiple of another row. So how we usually think of it is we're gonna add to one row a multiple of another. Now I want you to be aware that when we use the elimination method we kind of did this, right? We would change the coefficients, we'd scale a row, the change the coefficients then we add them together. In essence, that's what we were doing. We were using the replacement operation. We were also using the scaling operation. The third row operation is scaling. You can times any row by a non-zero scalar and that doesn't change the solution set. If you have any equation whatsoever, like if you have x plus y minus z equals seven, if I times both sides by two, you get two x plus two y minus two z is equal to 14. That didn't change the solution to that equation and therefore didn't change the solution to the system of equations. Scaling a row by non-zero constants doesn't change the solution set. Likewise, interchange, I can switch the order of any two rows. So I have a first equation, a second equation, I swap them so the second becomes first and the first becomes second. The order in which I list the rows shouldn't affect the solution set as well. The replacement operation is a little bit harder to convince yourself that this doesn't change the rows, doesn't change the solution set, excuse me, but if you're looking at those points which are simultaneous solutions, if you start adding multiples of one row to the other, though things that satisfy the first equation and the next equation when you add them together will still satisfy them. There's a little bit more details going on here, but I'm not gonna provide the proof of this theorem, but we are gonna utilize this theorem to help us solve systems of linear equations, okay? So let's consider a three by three system of equations. We're gonna take x minus two y plus z is equal to zero. Two y minus eight z is equal to eight and negative four x plus five y plus nine z is equal to negative nine. The first thing that I'm gonna do is I'm gonna represent this linear system as an augmented matrix for which I get one negative two, one augment zero, zero, two negative eight. Let me move that negative eight a little bit more over negative eight, positive eight, and then I'm gonna get negative four, five, nine and negative nine, like so. So looking at this matrix here, this augmented matrix encodes the system of equations that we had previously seen here. And I'm gonna start performing some elementary row operations to this matrix. And I'm not gonna necessarily explain what I'm doing, or I'm gonna explain what I'm doing. I'm not gonna explain why I'm doing it yet. Just follow along to make sure we're comfortable with these things. And it's helpful to write little notes on your matrices to see what you're doing here. So what I'm gonna do is I'm gonna do a replacement operation. I'm gonna replace row three with row three plus four times row one. Okay, so row three we can see right here. Row one we can see right here. Four times row one means I'm gonna take everything in row one times it by four, I'm gonna add it to the third row here. A little trick that I like to do is I'm gonna take the first row times everything by four and I'm gonna write it as a superscript with a separate color here to help me with this addition so I don't have to do too much in my head here. One times four is four. So I'm gonna get that number right there. Negative two times four is negative eight. I'm gonna write that there. One times four is four and zero times four is zero. So then what I'm gonna do for my next matrix I've now done the replacement operation. The first row stays the same because I only changed the third row. The second row stays the same because again I only changed the third row. Now the third row is gonna change because I'm replacing the third row with the third row plus four times row one. And so now what you can do is you can take the number you see in the third row and add it to the little number you just wrote there. Negative four plus four gives me a zero. Five minus eight is gonna give me a negative three. And then lastly we're gonna get nine plus four which is a 13. I guess it's not lastly, but the next one's pretty easy. Negative nine plus zero is equal to negative nine. So we've now replaced the third row with a new row three using my row replacement operation. And I want you to notice here that the matrix in some regard is simpler. Notice I have a zero here now to kind of motivate what's going on here. I'm thinking of this as my pivot position. I have a leading one in the first row. I now have a one in that position. I have zeros all below it. That's something we kind of like when it comes to these things, okay? Next thing I want you to do is I want you to shift your focus from that number. I want you to focus here for a moment. Looking at the second row, you'll notice that everything in the second row is divisible by two. Two, negative eight, eight, zero itself are all divisible by two. So what I could do to simplify things because smaller numbers are better is I could scale the second row by one half. That is, I could divide by two. And this then gives me a matrix that looks like one, negative two, one, zero. I didn't do anything to the first row. The second row I'm dividing everything by two. So I'm gonna get zero, one, negative four, positive four. And then I didn't do anything to the third row either. So it stays the same there, okay? So again, focusing on this number right here, I now got a one in the leading position. That's something I kind of like to do when it comes to these elementary, I like the leading one there because that kind of feels like a row reduced echelon matrix, right? Like I have one, zero, zero, that looks pretty nice right there. And then I wanna create that here too, all right? In order to do that, I would want a zero above that one and a zero below that one. Now to get a zero here, what I could do, kind of like I did before, is I could take the replacement, I could replace row three, the current row three, with row three plus three times row two, okay? And following the same little trick I did before, one times three is three, negative four times three is negative 12, four times three is positive 12. So let's write down the next matrix down here. So we're gonna copy down the second row, it didn't change whatsoever, zero, one, negative four and four, like so. It's the third row we're replacing, in which case we're gonna replace row three with row three plus three times row two. We get zero, negative three plus three is zero, 13 minus 12 is one, and negative nine plus three is 12. I want you to note here that I didn't actually write any number on the first column here. And the reason I didn't do that is because since this is a zero, zero times three is gonna give you zero and zero plus zero gives you back zero. Because this number is a zero, this number won't change. And as such, I don't even bother writing it down because I know it's not gonna change. This is sort of the beauty of row replacement. Once you get sufficiently many zeros in the earlier columns, as you start moving to the right with your row replacements, you can start ignoring columns and thus these row replacements get faster the farther you get through the problem. This is one of the reasons why Gaussian elimination is so efficient. And we'll do some more practice of that, of course, in the next lesson, all right, the next lecture. But let's finish this problem at the moment. It would be lovely if I could also get a zero up here and I could sort of mimic what I did below. I could take row one and replace it with row one plus two times row two, right? I could, if I take row two and times it by two, I get two times negative eight times positive eight. Notice I don't have to worry about the first column because this is a zero right there. And as such, you'll still have a one there. Negative two plus two is zero, one minus eight is negative seven and zero plus eight is equal to eight. So look what we have accomplished so far. This first column is one, zero, zero. It's kind of what we expect for a row reduced session on form. The second column is now zero, one, zero. I'm producing this staircase of ones. The last thing I would want for a row reduced session on form is to make these things into zeros. And I can use the row replacement operation to do that. I can take row two and replace it with row two plus four times row three. And to get rid of the negative seven, I can replace row one with row one plus seven times row three. This will then give us our final matrix like so for which I didn't write the numbers this time. So if you take row three and times it by seven, you're gonna get seven and 21. If you times it by four, you're going to get four and 12. And so then writing this out here, we're gonna get one, zero, zero, zero, one, zero, zero, one. This is now the row reduced form of the coefficient matrix. And then on the right-hand side, this is what we're really interested in. You can eight plus 21, which is 29. Four plus 12, which is 16. And then three just itself. So now a matrix, the coefficient matrix note is in row reduced session on form. If we rewrite this as a system of linear equations, we will get the following. This matrix tells us that X is equal to 29, that Y is equal to 16, and that Z is equal to three. We've solved the system of equations. The only solution is 29, 16 and three. So what this tells us, and you can check, put this back into the original equations and see that X being 29, Y equals 16 and Z equals three gives you a solution to the system of equations. It solved the system and we used strategically these row operations exactly to do that, to row reduce the matrix. So in the next lecture, because this is the end of lecture 13, in lecture 14, we're gonna discuss how we can be strategic. I'll teach you the Gaussian elimination algorithm and so we can get further practice with the operations and use them to solve these linear systems in the most efficient manner that we're gonna learn. So thanks for watching this lecture. If you learned anything about matrices or row operations, please like these videos, subscribe to the channel to see more videos like this in the future, share with friends or colleagues so they can learn this cool math too. And as always, if you have any questions, feel free to post them in the comments below and I'll gladly answer them at my soonest convenience.