 Welcome back to our lecture series linear algebra done openly as usual. I'm your professor today, Dr. Andrew Misseldine You might have noticed in the previous lecture 1.4 We were solving some systems of equations using the substitution technique. You could have done elimination as well Unfortunately the systems that we have solved were pretty easy And if you have been looking at the homework in the in the book here You'll notice that in some of the sections like 1.4 You do have to solve systems of equations and again the examples given to us are fairly easy You could solve it using elementary techniques like substitution or elimination But the thing is these are kind of Mickey Mouse type problems, right? They deliberately have been made easier for us knowing that at this moment in the course We might not have an effective strategy for solving systems of linear equations. Well, we're gonna need some way of Solving linear systems. We've seen that working with linear combinations working with linear transformations Naturally leads to solving linear systems. So in this section and in the next section 1.6 We're gonna be trying to develop an effective algorithm for solving systems of linear equations And so in this lecture, we're gonna introduce the elementary row operations and augmented matrices as a tools to help us work with With the systems of linear equations. So the three elementary or operations they have Many names and some textbooks don't give them any names at all The names that we are gonna use in this textbook are actually borrowed from David Lay's linear answer textbook And he calls the three row operations the following the first one. He calls Replacement we're replacing the replacement operation You're gonna replace one row by the sum of itself and a multiple of another row or in other words You're gonna add a multiple of one row into another when I say row here, right? What why we call these row operations? You could think of that each equation of the linear system is the row in the system This will make much more sense when we talk about augmented matrices because these rows will literally be rows of a matrix But I'm getting a little ahead of myself So the replacement operation occurs by adding a multiple of a row to another row In other words, you're replacing a row with the original row plus a multiple of another That one seems a little bit complicated But when we do some examples, I think it will clarify very very quickly turns out the replacement operations The one we're gonna be doing the most often The second row operation is we call interchange. You're gonna interchange the order of any two rows So if you have like the first row in the second row, you can swap them The second row becomes first and the first becomes second, you know, if you want the the first to be last and the last to be first You can do that switching their switching the rows It is allowed and the last one we call scaling The reason we call that is you can multiply any row That is you can multiply any row Which is an equation you can multiply by some non zero scaler The reason you don't want to multiply by zero is that it would actually just demolish your equation If you multiply any equation by zero, you can end up with zero equals zero and the solution to this equation is everything, right? And so multiply by zero kind of devastates and changes the solution said this actually leads me to my next point We say that two linear systems of equations are row equivalent if there's some sequence of Operations Replacement interchange and scaling some sequence of row operations that transforms the first linear system into the other linear system They're row equivalent systems. Now this is what's important about row equivalence is that row equivalence is the same thing as Equivalence which equivalence as we defined before this means that they have the same solution set So performing row operations on a system of linear equations Does not change the solution set of this system and some of these are kind of easy to see Interchanges switching the order of the equations that shouldn't have any consequence as I've mentioned before like if you do You know if you multiply both sides of the equation by the same value That's not going to change the solution as long as it wasn't zero because that just demolishes the equation Basically just throw it in the shredder at that point Replacement is a little bit harder to see but he start adding if two rows have common solutions when you add them together You'll have a common solution. This was a something we talked about when we showed that the set of linear equations forms itself a vector space taking linear combinations of Equations with common solutions will keep those same common solutions So it turns out that two linear systems are equivalent if and only if the row equivalent So we can use row equivalency to help us solve systems of linear equations And I want to give you an example of such a thing Consider the following three by three system. It has three equations aka three rows. It has three variables aka Three columns again, I'm getting a little ahead of myself here So in this linear system, we have the first equation x1 minus 2x2 plus 2x3 equals zero The second equation is 2x2 minus 8x3 equals negative 8 and the last one is negative 4x1 plus 6x2 plus 2x3 equals 10 And so what I'm going to do is start performing some row operations Not exactly motivated why I just want to demonstrate to you. How do you actually do the row operations? So with this system right here Right, we're going to just we're going to take this system of equations and I want to perform the following row operation We're going to replace row three with row three plus four times row one So this is a replacement operation row three is going to be replaced with row three plus Four times row one. This is oh a shorthand. I use a lot We're going to write next to the robot replacing row three Which is what you have to take the multiple of itself plus a multiple of another row And how does one do this? We have to actually first consider well, what is four times row one even mean? This would mean you multiply everything in this in the equation by four. So you get 4x1 times 8x2 Plus 8x3 equals zero and then you have to add this to row three And if you do that, you're going to get four a negative 4x1 They'll cancel with the 4x1. So you don't see anything here You're going to get 6x2 minus negative 8x2 And so that gives you a negative 2x2 and then you get a 2x3 Plus an 8x3 that gives you a 10x3 and then 10 plus zero is 10 So we can add those things together now that itself kind of takes a lot of space On the page and so we're tempted to not we don't want to use so much space on the page Another option you just try to do everything your head. I don't advise. I don't advise that too well So one thing you're going to see me a lot do is that I'm actually going to take 4 or 1 And using a different color like maybe red or something I'm going to write as a superscript the coefficient above it So x1 times 4 is going to give you 4x1. So I'm just going to write a 4 right there Next we're going to take the negative 2 times it by 4 you get a negative 8 Then you're going to take 2 times 4 which is an 8 and then you take 0 times forward to 0 So you just write the numbers you have to add just like a superscript above it right there And then you can add those together very nicely giving us the the 0x1 negative 2x2 10x3 and 10 like we did before So that was our first row operation. That's a replacement operation The next operation and I should mention that when you connect these things together You draw these little these little squiggles to show that the two systems are a row equivalent because they're not equal The two systems are not the same, but they are equivalent to each other So the little squiggle means the solution set has been preserved Next what we're going to do is we're going to take row two and we're going to multiply it By a factor of one half we're using the scaling operation. So I'm going to take row two and times it by one half Oh, I needed that above don't I we're going to multiply this one by one half And so notice why I did this Everything in this row Is a multiple of two 2x2 8x3 negative 8 v times by one half or divide by two same thing We can then replace it with this row right here x2 minus 4x3 is equal to negative 4 We divided every coefficient by 2 that is what the scaling operation is all about We had done the replacement operation up here Next what I want to do Is I'm going to do replacement again I'm going to replace row three the current row three not the original row three I'm going to replace the current row three with row three plus two times row two. So I'm going to take Row three and replace with it row three plus two times row two So following the convention we did before we're going to take row two. So one times So one times two is a two Negative four times two is a negative eight Don't forget the sign and negative four times a two is a negative eight again So when you add these together the twos will cancel. So there is no x2 in now you're going to get 10x3 take away 8x3 that's going to be a 2x3 And then you're going to get 10 minus 8 which is a 2 like so And so with these three operations we did we did replacements scaling them replacement again We now have a system of equation looks like the following and I want to notice I want to point out to you the following observation Look at the last equation the last equation only depends on x3. I could solve for that very quickly Divide both sides by two right You're going to see that x3 Is equal to one Well, that's pretty convenient, but also what we see here is if I know what x1 is The second equation only depends on x2 and x3 if I could plug in x3 into that equation I could solve for x2 And doing that gives me the following notice that x2 is going to equal 4x3 minus 4 I just solve for x3 right there and then plug in one you get 4 minus 4 which is equal to 0 so x2 Is equal to zero But now look at the first equation the first equation depends on x1 x2 and x3 I know what x3 is. I know what x2 is. I could plug those values to find an x1 So notice if you solve for x1 you're going to get x1 equals 2x2 minus 2x3 We know what x2 is. It's a zero. We know what x3 is. It's a one And so we see that x1 is going to be negative two So I've now solved this system of equations if the solution is going to be unique. It's negative two zero and one This is a consistent linear system with a unique solution and we found it using these operations, huh? What did we do here? You'll notice that along the way We were trying to simplify the the system of equations. We kind of got rid of everything under this Variable we got rid of everything here. We kind of make this downward staircase. That's what we were trying to Create here and once we got that we are able to solve the system using this technique of back substitution You could always you could always solve for a variable and then you back substitute it into the above equation And then there's always one unknown in each of those equations And so you just knock them off one by one by one until you find the solution That's starting to show us how we can solve a system of equations how we build this staircase We'll focus on how you build the staircase in lecture 1.6 But for now, I just want to illustrate how one can use row operations to help you manipulate and solve systems of linear equations