Transcript for:
Solving Linear Systems with Matrices

so now that we have familiarized ourselves or reefa milliards ourselves with solving a system using algebraic methods now we're going to use augmented matrices and row operations so I gave you a little bit of a preview in the last video but in this video I really want to get specific and talk about what our possible row operations are what's legal what's illegal etc we have three row operations to choose from the first is called replacement and replacement tells us that we can replace one row by the sum of itself and a multiple of another row really we can use multiples of either row to do this so essentially I might be doing something like let's take two times row sorry negative two times Row two which of course is going to turn this into negative two and 0 and negative 18 and perhaps all want to add that to Row one and then this parts very important I'm going to say the target row so where is this going to land when I add negative two times Row two to Row one is that going to replace Row one or is it going to replace Row two and in this case let's say it's going to replace Row two what that tells me is Row one is still going to be two four eight but Row two is now if I take negative two times Row two and add it to Row one that's going to give me zero here and then zero plus four gives me four here and negative 18 plus 8 gives me negative ten here so that would be an example of replacement interchange just means to swap two rows so again I'm going to show you the proper notation if I want to replace Row one and Row two I'm going to use an equal sign essentially with an arrow on each side so this is telling me I'm swapping Row one for Row two so if I do that then this b10 9 + this would be 2 4 8 and lastly we have scaling scaling again is just multiplying a row by a nonzero constant so a great example here would be Row 1 obviously these are all multiples of 2 so I can just say let's take half of Row 1 and again I have to put my new target row which is again Row 1 so that means and again I cannot use division division is not one of the row operations so I can't say r1 divided by 2 I have to say half of Row one so half of 2 is 1 half of 4 is 2 half of 8 is 4 and again nothing has happened to Row 2 that stayed exactly the same so those are the 3 row operations and the proper way that I would like you to show your row operations this question should look familiar to you because we just solved this in the last video using elimination now obviously I want to use augmented matrices and row operations now we haven't really talked enough about a good strategy so really I just want you to sort of follow along with me and I'm not going to give too much of the strategy away because I'm going to talk about that in the next video and the video after that so all of section 1.2 is about here's how to go about solving a system in the best most efficient way possible and then what happens when you have variables that don't have a value but for now you're just going to kind of follow along with me and do the best you can so thinking about this in terms of elimination and again we haven't talked about this yet but what I would like is I would really like these values to all be ones and then anything that's not there I like to have them be zeros so we definitely need these three values to be zeros and whether or not you use these three values to be zeros is up for debate and I'll let you decide the best way that you want to go about that but for now you're just going to do it the way I want to do it because I'm the one making the video so what I'm going to do first is because I already have a one here where I want it and I already have a zero here I'm going to focus first on let's choose a different color this guy right here I want that to be a zero so every time I have a value of one I want everything below that to be a zero and we'll talk more about that later so how am I going to make negative four into one I'm sorry into zero I would have to add positive 4 so negative 4 plus positive 4 is 0 how can I add 4 to that well I have to use one of my three row operations the easiest row operation is to then take positive 4 times Row one because 4 times one would give me positive 4 adding that to negative 4 gives me 0 so I'm going to add that to Row 3 to be my new Row 3 and that gives me and notice this is Row 3 is the target row which means this guy doesn't change this guy doesn't change Row 3 is the only one that changed so what changes we take 4 times Row 1 so 4 times 1 plus negative 4 4 times negative 2 plus 5 and 4 times 1 plus 9 and 4 times 0 plus negative 9 so that's all for my first step now what I once is I'm going to focus on this guy what do I want that to turn into I want it to turn into a 1 well when I'm just taking something down to a 1 not a zero but if I'm taking something down to one usually I'm going to use scaling and that's what I'm going to do here is I'm just going to take half of Row 2 to be my new Row 2 so I'm just taking half of Row 2 so that means Row 1 is the same Row 3 is the same row 2 I'm just taking 1/2 so half of 0 is 0 half of 2 is 1/2 of negative 8 is negative 4 1/2 a positive 8 is positive 4 now what I need let's see if I've got another color is this guy to be a 0 so again when I'm turning something into a 0 usually that means I'm going to have to use interchange where I'm multiplying and adding together now I could obviously use Row 1 but if I use Row 1 this guy is going to become problematic because I'm going to probably end up screwing up my 0 and I don't want to backtrack and have to redo work so what I want to do is I want to use Row 2 to help me to get Row 3 how I want it so I'm going to take 3 times Row 2 and add it to Row 3 to get my new Row 3 so what is that going to do that's only going to change Row 3 so Row 1 1 negative 2 1 0 Row 2 0 1 negative 4 4 and Row 3 I'm taking 3 times Row 2 so 3 times 0 plus 0 3 times 1 plus negative 3 3 times negative 4 is negative 12 plus 13 is 1 and 3 times 12 I'm sorry 3 times 4 is 12 plus negative 9 is 3 so far so good because remember that's what this means is that X 3 0 X 1 + 0 X 2 + 1 X 3 is equal to 3 and that's what I want alright let's continue on now what I want is this is where you kind of make a choice and again we'll talk more about this in the next video but I really have to let you in on the secret here this is essentially called a triangular form and we'll talk your book will call it triangular form and it's triangular because we've got the ones and we've got the zeros and quite often we don't have all ones here we just have the zeros where the zeros are supposed to be and then the ones we can deal with later that's what your book calls triangular form this is actually Gaussian elimination and then going on to the next step which is making all of these zeros is Gauss Jordan but again it doesn't matter what you call it because it's still the same thing so from here I have a choice to make I can either and your book probably shows it to you this way I can either take that this equation and turn it back into an equation X 1 minus 2 X 2 plus 1 equals 0 and then 1 X 2 minus 4 X 3 whoops I forgot my X 3 equals 4 and then 1 X 3 equals 3 so from here obviously I can use back substitution and I can say well I've already found that X 3 is equal to 3 I can very easily say X 2 minus 4 times 3 equals 4 which gives me X 2 minus 12 is 4 which gives me X 2 is 16 and again that's the correct answer and then I can take 3 and 16 and substitute those back into my original equation so X 1 minus 2 times 16 plus 3 you zero X 1 minus 32 plus 3 is 0 X 1 minus 29 is 0 X 1 is 29 and again I've solved the equation so this is using back substitution and instead you can also and for now since we're not focusing completely on the correct algorithm you could also do whatever row operations were necessary to turn these values into zero and that's the way that I prefer to do it but again for the sake of this video not being 37 minutes let's not if I do it that way what happens here is I would end up with my three solutions and that's why I like it is I might as well just keep doing row operations until I've actually solved the system but for now we can see that we have solved the system again using an Augmented matrix and row operations and in this case also back substitution you're going to see the question of existence and uniqueness pop up quite often throughout the course and when we're talking about existence we're essentially asking is the system consistent or does a solution exist and uniqueness means if a solution does exist is it unique meaning is there one solution or are there many solutions so let's take a look at this one together and again we're trying to determine so far up to this point we have only looked at consistent systems with one solution so let's take a look at maybe one that isn't like that first thing I'm going to do as always is write my matrix 0 1 negative 4 8 2 negative 3 2 1 4 negative 8 12 1 and just as we talked about before I really want this column and that being ones but I've got this glaring issue right here with this 0 so I can't have a 0 there I have to have and in the next section we'll talk about all the terminology but essentially right now I'm just telling you we have to have something there other than a zero so the easiest thing I can do is essentially swap r2 and r3 with one I'm sorry yeah nope just kidding' swap r1 and r2 or r3 but I'm gonna go r1 and r2 so if I swap r1 and r2 I really haven't done anything except swap them interchange them and now I have 0 1 negative 4 8 on my second row and everything else stayed exactly the same so again the purpose of that is that I didn't like that I didn't have some value here now what I'm going to do is I'm going to try to get that to be a 1 so according to the correct algorithm I don't need it to be a 1 I just need it to not to be a 0 I like to have a 1 there so that's what I'm going to do next so I'm just going to take half of everything in row 1 to be my new Row 1 so that's using scaling and so I'm going to get 1 negative 3 halves 1 oops 1/2 and this stays the same and oops that's a positive 4 4 negative 8 12 1 so have a 1 where I want it but what I don't have now is I want this to be a zero because once I have a 1 I want everything below it to be a zero so I'm going to take 4 times sorry negative 4 times Row one because I need a negative 4 to cancel out my positive 4 plus Row 3 to be my new Row 3 so Row 1 remains the same ro2 remains the same and Row 3 is now negative 4 times Row 1 plus Row 3 so that's going to give me a 0 here it's going to give me 12 halves so 6 and negative 8 that's negative 2 negative 4 times 1 is negative 4 plus 12 is 8 and then negative 4 times 1/2 is negative 2 plus 1 is negative 1 now I would focus on making this a 1 but it already is so I'm going to focus on making this a 0 so to make that a 0 I'm going to take 2 times Row 2 plus Row 3 to be my new Row 3 which means Row 1 is the same Row 2 is the same and Row 3 is 2 times Row 2 oops my fat fingers down here making little marks 2 times Row 2 plus Row 3 so that gives me a 0 here that gives me a 0 here and that gives me a 15 here so we're gonna stop right now because remember what this means this says 0 X 1 plus 0 X 2 plus 0 X 3 is equal to 15 well that is impossible and because it's impossible that means no there is no existence so this is an in consistent system so no solution and is it unique well obviously we don't have to check that if there is no solution so inconsistent system in this case so here's a question for you to try on your own and again be very patient with yourself just do the best that you can we're just learning how to do this in no time at all this will just come a second nature to you but since we're just getting started again just be kind to yourself do the best that you can try this question on your own when you're done press play to see how you did so again the first thing I would do is draw or write this as an Augmented matrix so I have 1 negative 2 1 0 I have 0 2 negative 8 8 and I have 5 0 negative 5 10 and I already have a 1 exactly where I want it and I have a 0 just below it and I would like that 5 to be a 0 as well so that's the first thing I'm going to do how do I get rid of 5 I have to add negative 5 so I'm going to take negative 5 times Row 1 plus Row 3 to be my new Row 3 notice that means Row 1 remains the same Row 2 remains the same but actually and I'm going to cheat a little bit I'm going to do something to Row 2 at the same time just because I noticed that these are all even so it's okay for me to take half of Row 2 to be my new Row 2 in the same step so this is going to be 0 1 negative 4 4 and then the negative 5 Row 1 plus Row 3 so negative 5 times 1 plus 5 negative 5 times negative 2 is 10 plus 0 and then negative 5 times positive 1 is negative 5 plus negative 5 is negative 10 and then negative 5 times 0 is 0 plus 10 is 10 so that was a good first step or first two steps I guess since I cheated just a little bit and again I have one where I want it and I've got zeros below it and I've got one where I want it here but notice I want a zero above and below that as well so again I can do two separate steps typically I would start with that one on the bottom or I might even say look everything is divisible by 10 and so I might divide everything by 10 it's really up to you again we don't have an algorithm yet so I'm just going to take a tenth of Row 3 to be my new Row 3 and see where that gets us and that gives me 1 negative 2 1 0 0 1 negative 4 4 & 0 1 negative 1 1 so now I again have the ones where I want it I need this guy to be a zero so let's do Row 2 minus Row 3 to be my new Row 3 Row 1 is the same Row 2 is the same Row 3 is 0 minus 0 1 minus 1 negative 4 minus negative 1 4 minus 1 and then I'm going to because obviously these are both divisible by 3 let's change colors again and I'm going to take 1/3 of Row 3 to be my new Row 3 and again right now because we don't know the correct algorithm it if you do it in more steps if you do it in fewer steps everything's fine right now we're just learning so again don't be hard on yourself then 0 1 negative 4 4 and then 0 0 I'm going to take sorry negative 1/3 so that's positive 1 negative 1 now I'm going to continue I would like the negative 2 to be a 0 as well so I'm going to take 2 times Row 2 and add it to Row 1 to be my new Row 1 so that gives me 2 times 0 plus 1 2 times 1 plus negative 2 2 times negative 4 plus 1 and then 0 oh no I'm just kidding 8 2 times 4 is 8 plus 0 is 8 and then my second row I haven't done anything to and my third row zero zero one negative one so I'm getting there oops magically just put it one there for no reason at all so this guy is what I want these guys are this guy's what I want these guys are this guy's what I want and I still have to work on the negative seven and the negative four so let's do that I'm going to do both of those on the same step here so to get Row two to have a zero I'm going to take 4 times Row 3 plus Row 2 to be my new Row 2 so let's keep this guy exactly the same Row 2 is 0 0 plus 1 is 1 4 plus negative 4 is 0 negative 4 plus 4 is 0 and then to get my new Row 1 I've got a negative 7 so I'm going to take 7 times Row 3 plus Row 1 to be my new Row 1 so now that gives me 1 0 0 and then I've got negative 7 plus 8 which is 1 so my solution as an ordered pair is 1 0 negative 1 and again that is the correct solution so if you got that great job if not that's ok we're gonna keep working at it