 To episode 23, this is Math 1050, College Algebra. I'm Dennis Allison, and I teach in the mathematics department here at Utah Valley State College. Last time we introduced the Gaussian method with back substitution for solving systems of linear equations using three elementary rules, or three elementary row operations. Let's see how we're going to use those today if we go to the list of objectives here. First, we're going to look at an alternative to the Gaussian elimination with back substitution. This is called the Gauss-Jordan method. Jordan looks like Jordan, but he was French. They say Jordan. We'll look at a couple applications of the Gauss-Jordan method. And finally, we'll look at how we can solve simultaneous systems of linear equations, how we'll be solving those simultaneously. So let's look, first of all, at the three elementary row operations that we used in the previous episode. And we'll be using these again. Let's go to the elementary row operations. You remember that when we're solving a system of equations, there are basically three things we can do that will not destroy the solution. We can interchange two rows of the matrix. We can multiply a row by a non-zero constant. And we can add a multiple of a row to another row. Now, we use those three elementary operations in the last episode, and we'll use those again. In fact, we'll use them right now. Let's go to our first example. OK, let's solve this next example. This is a 3 by 3 system. And if we wanted to use the method from the last episode, you remember Gaussian elimination with back substitution, we could certainly solve this using that method. But instead, I'd like to solve using an alternative method called the Gauss-Jordan method here. This is a 3 by 3 system. You remember that means there are three equations and three unknowns. In this case, the unknowns are a, b, and c. And so what I've done is I've written this problem on the board already and the first thing I'll do is convert this to its augmented matrix. So the augmented matrix is 4, 8, negative 4, 4. And then 3, 6, 5, negative 13. And then negative 2, 1, 12, and negative 17. Now, if I were using the Gaussian elimination with back substitution, remember the idea is that I get a 1 in the first position, the first row, first column, and 0s below it. And then I get a 1 in the 2, 2 position, the second row, second column, and a 0 below it. And then I get a 1 in the 3, 3 position, and then I use back substitution. This time, I'm going to get 0s above and below the ones. And the answers will just appear over here on the right-hand side. And there's no back substitution required. It means I have to a little bit more work with the matrix, but I don't have to do the back substitution. So that's basically what the Gauss-Jordan method is. To get a 1 in the first position, let's see, we have all multiples of 4. So why don't we just take 1 fourth of row 1? So 1 fourth of row 1 is 1, 2, 1, 2, negative 1, and 1. Then I'll just rewrite the other two rows. 3, 6, 5, negative 13, and negative 2, 1, 12, negative 17. So to get a 0 here and here, this is the 2, 1 position, and this is the 3, 1 position, what I'm going to do is multiply row 1 by negative 3 and add it to row 2. And I'll multiply row 1 by 2 and add it to row 3. So that's going to say row 2 plus negative 3 times row 1 and row 3 plus 2 times row 1. Now, row 1 doesn't change, but rows 2 and 3 will. At this point, I might just mention some of you at home may be wondering, why don't I just write this as row 2 minus 3 times row 1? That seems like that'd be equivalent. But the way the rule is stated in our book and the way we stated it in our graphic earlier is that you can add a multiple of one row to another row. So I'm using addition, and so I have a negative coefficient. If you write subtraction there, I'll understand what you're doing, just sort of trying to sort of go by the rules as they were spelled out here. OK, I'm going to ask some of the people in the class to help me out here in a moment. But if I multiply row 1 by negative 3 and add it to row 2, that's going to be a 0. And if I multiply 2 by negative 3 and add it to 6, that'll be a 0. I think I've done the two easy ones. What are going to be the next two numbers there? Anybody? OK, Susan says 8. Yep, I think you're right. And what else? Negative 16, right. Now it's easy to make a careless error doing this, and I make careless errors too. And so you have to be really, really attentive to this. And that's why these methods are really more appropriate for computers than for human beings. Because if you program a computer to do this, it does the arithmetic flawlessly. But on the other hand, that's why we study this in Math 1050. Because if you're a computer science major, an engineering major, a business major, you need to know how these methods work if you're going to be using computers to do this. OK, on the bottom row, let's see. I think I'll get a 0 here. And I'll get a 5 there. What will be the last two numbers? Let's see, Jenny, what will be the last two numbers there? It'll be 10. 10, yep. Let's see, 2 is negative 15. Negative 15, right, very good. OK, so I have a 1 and then the 0. So my next goal is to get a 1 here. I don't see any way I can turn a 0 into 1. So I think what I'll do is just switch those two and put the 5 there. And then I'll make the 5 and 0, 1. So I'm going to switch rows 2 and 3. And the top row stays the same. Row 3 moves up into the row 2 position. And row 2 drops down. OK, so to get a 1 right here, what would you do? Divide by 5. Divide by 5, OK? Or I'm going to say multiply by 1 5th. So 1 5th times row 2. You know, while we're at it, why don't we multiply row 3 by 1 8th? Because I see a common factor there. So we might as well reduce it at the same time. So I have 1, 2, negative 1, 1. I have 0, 1, 2, negative 3. And I have 0, 0, 1, negative 2. Now, you know, in this form, I could step out and use back substitution, like we did in the previous episode. But instead, I want to get a 0 above the 1 there. Take care of that column. And then I'll move over to the last column. OK, so let's get a 0 above the 1 in the second column. So I'll be taking row 1 and adding on, looks like I need a little bit more room there, negative 2 times row 2. Now, row 1 will not change. Row 2 will not change, I should say. And at the moment, row 3 is not going to change. I'm not ready to go to row 3. So only row 1 changes. Let's see. Now, if I take negative 2 times 0 and add it to 1, I still get a 1. That's why I wanted to get those 0s there, because then, as I combine these, I don't lose that 1. Negative 2 times 1 plus 2 is 0. Negative 2 times 2 plus negative 1 is negative 5. And who can tell me what the last number will be? 7? Let's see. Negative 2 times negative 3 plus 1 is 7. That's right. OK, the second column is now taken care of for Gauss-Jordon elimination. So now I go to the third column. I've got the 1, so let's get 0s in the upper positions. So I think we're going to have to take row 1 plus 5 times row 3 and row 2 plus negative 2 times row 3. Now, row 3 won't change. We're happy with row 3. As a matter of fact, you can see right there, what's the value of z? Or rather of c? Negative 2. Yeah, c is negative 2. So we have that one already. Let's go back and get the a and the b. 5 times row 3 added to row 1 is going to be 1, 0, 0, and negative 3. And negative 2 times row 3 added to row 2 will be 0, 1, 0, and 1. So we can read off the answers here. What is the value of a, b, and c? Jeff, what do you see as the answers there? The answer to a is negative 3. Negative 3. b is 1. b is 1. And c is negative 2. c is negative 2. Now, you notice this took more steps than Gauss in elimination with back substitution. But the benefit is I can read my answers off at the end. I don't have to go through the back substitution process. So that's the difference with Gauss-Jordan elimination. So we have solved this system of equations. We've gotten the answer. And this is the way that this procedure will go. Let's go to the next application or the next example. And this is a 4 by 4 system. And I'm going to put that one up here. OK, so I've written this problem on the board. But you see, this is a 4 by 4 system. I've got four equations. And I've got four unknowns. The unknowns are x, y, z, and w. And I'll use Gauss-Jordan again to solve this one. This will be a larger matrix. The matrix will be 1, 0, negative 2, 1, 3. And then 1, negative 2, 0, negative 1, 7. Negative 1, 1, 1, 1, negative 4. And 2, negative 3, negative 1, 0, negative 12. And you see, this is a 4 by 4 system. Theoretically, you could work even larger systems using this method. It's just that the steps sometimes get a little bit more involved. I don't think this one's really too bad, though. For example, I already have a 1 in the first position, so that's good. I'll get 0s right below it. The way I'll do that is I'll take rho 2 and I'll add on negative 1 times rho 1. And then I'll take rho 3 and I'll add on rho 1. And then I'll take rho 4 and add on negative 2 times rho 1. But you know, rho 1 doesn't change. So we'll just rewrite it. OK, so the new rho 2 will be 0, negative 2, 2, negative 2, and 4. OK, who can tell me what rho 3 will be? Any volunteers? It'll be 0, 1, negative 1, 0. Let's see. Now we're adding there. Oh, sorry, 2. That'll be a 2 and negative 1. Very good. And now the last row. Somebody else who can do the last row for us. We're going to take negative 2 times rho 1 and add it to rho 4. It'll be 0. 0, yeah. Negative 3. Negative 3. 3. 3. Negative 2. Negative 2. Negative 18. Negative 18. Exactly. OK, now you see the whole purpose was to get these 0s. We don't really care what happens over there. As long as we do the arithmetic correctly, it's all going to take care of itself in the long run. OK, now moving on, I'd like to get a 1 in this position. What do you recommend we do? Divide that whole row by negative 2. Divide by negative 2? OK, I'll say negative 1 half times rho 2. You say potato. I say potato. OK, the first row is still 0, 1, negative 2, 1, 3. The second row, though, is 0, 1, negative 1, 1, and negative 2. And the other rows stay unchanged for the time being. We don't want to try to do too much at one time, or then we start making careless errors. Now, I've got a 0 above the 1, so I want to get 0s below the 1. So let's take rho 3 plus negative 1, rho 2. And then I'll take rho 4 plus 3 times rho 2. Now, row 1 is fine. I've got a 0 where I want a 0, so I'll just rewrite rho 1. And rho 2 is fine, so I've got a 1 where I want it. So I'll rewrite rho 2. But now, rho 3 changes. I'll be adding negative 1 times rho 2 to rho 3. That's going to give me 0, 0, 0 again, and a 1, and another 1. So what that's telling me right there is that w is equal to 1. And on the bottom row, I want to get a 0 in this position. So I'm taking 3 times rho 2, adding it to rho 4. That'll be 0, 0, 0. Now, 3 times 1 added to negative 2 is 1. And a negative 6 plus negative 18 is negative 24. Well, we can see a contradiction, because this says w is 1, and this says w is negative 24. It can't be both of those. But what if we didn't notice there was a problem there? I would proceed to try to get a 1 in this position, in the 3, 3 position, but there's no way to do that. There's no way to get a 1 in this position without using some of the upper rows, which would lose my 0s back here. In this case, what I do is I move on to the next position in the row 3, column 4, and use the 1 there. So I get a 1 here and get 0s above and below. And now I'm assuming I haven't noticed that I have a contradiction yet, so I'm just trying to cover all the bases for you. So what I'll do here is I'll take rho 1 plus negative 1 times rho 3. And then I'll take rho 2 plus negative 1 times rho 3. And I'll take rho 4 plus negative 1 times rho 3. And the top row is going to become 1, 0, negative 2, 0, 2. And the second row will become 0, 1, negative 1, 0, negative 3. 0, 1, negative 1, 0, negative 3. The third row is OK because it has a 1 in the first available position. And the bottom row becomes 0, 0, 0, 0, minus 25. Now you see there is the contradiction exposed for sure because what that equation says is 0 equals negative 25. And that says that's impossible. So what that means is this system of equations cannot be solved for any x, y, z, and w. And it's equivalent to the original one we had over here. So this one can't be solved for any x, y, z, and w again. Now if you happen to notice that there's a contradiction earlier, you can stop at that point and say there's no solution. But what we ultimately look for is a row of 0s except we have a non-zero number at the very end. OK, so this is a no solution problem. And the way I would record my answer is I would say no solution or in a lot of textbooks they just say empty set. So there's no solution in that format. OK, let's go to a new application. And I'm going to take a break here while I erase this and get the new problem set up. OK, in this problem we want to fit a curve to three points. The problem says find the equation of the quadratic function f of x equals ax squared plus bx plus c passing through the points 1, 3, 3 negative 1, and negative 2, 24. Then find the vertex. You see this quadratic function will have the graph of a parabola. Now what I've done here is to make a rough sketch of what the problem says. I'm looking for a quadratic function that passes through 1, 3, 3 negative 1, and then the point 2, negative 2, 24 is going to be way up there. So the graph is going to look something like this. I don't know it looks exactly like that. It could be that it will look more like that, but generally it's going to be a parabola. And I want to find out what are the exact coefficients of these terms that will pass through these three points. So the way I do this is I'm going to list the points 1, 3, the point 3, negative 1, and the point negative 2, 24. And I'm going to express this function rule using those points. So first of all, if I substitute in a 1, the function value is 3. If I plug in a 1, the function value is 3. So that says 3 is equal to a times 1 squared, which is a, plus b times 1, which is b, plus c. So a plus b plus c is 3. I'm just substituting in a 1 for x and a 3 for the y. If I substitute in a 3 for x, I should get negative 1 for y. So if I plug in a 3 for x, that's going to give me 9a plus 3b plus c. And for the last ordered pair, the function value is 24. And when I substitute in negative 2, I get a 4a minus 2b plus c. Now, of course, this is all written in the reverse form. What I want to do is turn that all around and put the constants over there on the right-hand side. And the augmented matrix for that system of equations is 1, 1, 1, 3. I'll put in that dotted line just to make sure everybody understands that 3 is now written on the other side. And then 9, 3, 1, negative 1, and 4, negative 2, 1, 24. So what I'm going to do now is to solve for a, b, and c from the system of equations. And those will be the coefficients of those terms. And I'll have the quadratic function that passes through these points. This is referred to as curve fitting. So we're finding the quadratic curve, the parabola, that fits these points. OK. So to proceed, let's see. I've got a 1 in the first position. So I want to get 0s below it. So that'll say take row 2 and add on negative 9 times row 1. And then take row 3 and add on negative 4 times row 1. So the first row stays the same. But the second row becomes 0, negative 6, negative 8. And negative 28, I think, is the last number. Negative 9 times 3 is negative 27. Plus negative 1 is negative 28. OK. For the last row, maybe somebody can help me out here. The first number will be what? 0. It'll be a 0. Better be a 0. Right. That's our whole purpose is to get a 0 right there. But now what comes after that? Negative 6. I'm multiplying by negative 4. Yeah, negative 6? Then what? Negative 12. Negative 3. Let's see. We're multiplying by negative 4 and addings. That'll be a negative 3. OK. And then the last number is? 12, no, 12. We'll see negative 4 times, oh, I'm looking at the wrong row. Negative 4 times 3. That's 12. Plus 24. Yeah, it will be 12. That's that. Negative 12 plus 24 is 12. Now, all of these numbers are even, so why don't we multiply by negative 1 half? All of these numbers are multiples of 3, so why don't we multiply by negative 1 third? And I think that'll make those numbers easier to work with. So I'm going to take negative 1 half times row 2 and negative 1 third times row 3. Now, the top row won't change, but the second row becomes 0, 3, 4, and 14. And the bottom row becomes 0, 2, 1, and negative 4. So we've made the number smaller. It makes things a little bit easier to deal with. And to get a 1 right here, I think the best thing to do would be to take row 3, add a negative 1 times row 3, add it to row 2, and that will be a 1. And we avoid integers that way. So let's just continue with that idea. I'm going to take row 2 plus negative 1 times row 3. So the top row is 1, 1, 1, 3. The second row becomes 0, 1, 3, 18. And the bottom row is 0, 2, 1, negative 4. OK, so we've been able to get a 1 without introducing fractions. You don't have to be using the same steps that I'm using, of course, as long as you obey the rules. You'll arrive at the same answer, I will, at the end of the problem. OK, I've got my 1. I want to get to 0s above and below, because we're using Gauss-Jordan elimination method today. So I'll take row 1 plus negative 1 times row 2. And I'll take row 3 plus negative 2 times row 2. Now, you know, row 2 isn't going to change, so I'll just rewrite that in the middle. But the first row will be 1, 0, negative 2, negative 15. And the bottom row will be 0, 0, negative 5, and negative 40. OK, the second column is now taken care of. I want to get a 1 where the negative 5 is. So I'll multiply by negative 1 fifth. Negative 1 fifth times row 3. The top row hasn't changed. The second row isn't changing. But the bottom row is 0, 0, 1, 8. OK, I have my 1. It's my lever to get the 0s above it. So let's continue with that. In fact, let's see. Maybe I'll just come over here and use this space to finish that off. Let's see, I'll be taking row 1 plus 2 times row 3. And I'll be taking row 2 plus negative 3 times row 3. And row 3 stays unchanged, 0, 0, 1, and 8. So let's see, the top row will be 1, 0, 0. And that should be a 1 there. 16 plus negative 15 is 1. And the second row will be 0, 1, 0. Let's see now, we're tripling and subtracting. That'll be a negative 6. Well, I can read off my answers from that. You remember our quadratic function was f of x equals ax squared plus bx plus c. And our system of equations was given in terms of a, b, and c. So what is the value of a here? a is 1, right? What is b? Negative 6. b is negative 6. And c is 8, isn't it? So what this tells me is the quadratic function is f of x equals x squared minus 6x plus 8. This is the parabola that passed through the three points that we were given. And I think in the question it said, also find it's vertex. We don't know that any of the three points were actually the vertex. Now, this goes back quite a few episodes, but it was still in this course. You remember to find the vertex, what we do is we use a little formula, x equals negative b over 2a. So that's going to be the negative of, that's a b there. The negative of negative 6 is 6. Over 2a is 2. So this is 3. And the y-coordinate is f at 3. And if I plug in a 3, I get a 9 minus 18 plus 8 is negative 1. So this tells me that the vertex is the point 3, negative 1. And if I'm not mistaken, that was one of our points, wasn't it? Yes, right here. We didn't know it at the time, but that was actually the vertex of that parabola. OK, so now we have another application. OK, in this application, we're looking at traffic flow on some city streets. Now in the graphic that you see, we have four intersecting streets. And the arrows indicate the general flow of the traffic. So in the upper left-hand corner, you see 100 coming in on the left. The way we interpret that is there are 100 more cars moving to the right than moving to the left. So this is not necessarily a one-way street. It's just that the net influx is 100 from the left. And coming down from the top, 200 cars are coming down, 200 more are coming down than going up. And so as you go around this diagram, each one of those represents the so-called net change in cars traveling on that branch. OK, now on these intermediate pieces, x1, we don't know how many cars are traveling along there. We don't know how many are coming up at x3 or coming down at x2 and so forth. But we do know that 100 are coming in and 200 are coming down. 200 is the net amount that's entering this intersection. Now these four intersections are referred to as nodes. Let me just write that word down here. They're referred to as nodes. And this traffic problem is actually part of a larger type of problem referred to as a network problem. So this is a network problem with four nodes. Now at every node, I can write an equation that represents the traffic passing through that node. For example, at this first node right here, we have a total of 300 cars coming in, 100 from the left and 200 from above. So I have 300 cars entering. And coming out, we have x1 plus x2. So that tells me that x1 plus x2 should equal 300. Now if I go to another node, let's say the one over here, looks like coming in to the node, we have x1 plus x3. And coming out, we have 410. So x1 plus x3 equals 410. OK, at the node in the lower left, we have x2 plus x3 coming in, and we have 230 coming out. So x2 plus x4 equals 230. And at the last node, let's see, coming in, we have a total of 340 entering the intersection. And we have x3 plus x4 coming out. So x3 plus x4 should equal 340. OK, so you see this network problem leads me to four equations and four unknowns, x1 through x4. So this is referred to as a square system or a 4 by 4 system, and I'll solve it now using Gauss-Juridon elimination. Let's go over here to the marker board to solve this one. Let's see, the first equation says that x1 plus x2 equals 300. The next equation says that x1 plus x3 is equal to 410. And then x2 plus x4 is 230. And finally, x3 plus x4 equals 340. OK, now as I write this on the board, you'll notice that what I've done is I've assigned the variables to their independent columns, so it's a lot easier to write the augmented matrix when it's written in this form. And the augmented matrix is 1100300. And the second equation is 1010410. And then 01012030. And finally, 0011340. OK, so we've gone from that graphic with an illustration to a system of equations, and from that now we go to the augmented matrix. So you notice how this is changing in form, and now we're into this matrix. Well, I'll use Gauss-Jordano elimination, which means I need to produce a 0 on the second row of the first column. That's the 2, 1 position. So what I'll do is I'll take row 2 plus negative 1 times row 1, and I think that's the only thing that needs to be done to the first column. So the first row is 1100300. The second row is 0, negative 1, 1, 0, 110. And then I'll rewrite the other rows. OK. So we're now ready to move to the second column, and I want to get a 1 in this position. There are several things I can do. Susan, what would you do to get a 1 right there? What comes to your mind? Multiply the row by negative 1. Multiply by negative 1. I think that sounds very reasonable. Of course, there are other ways I could get a 1 there. What's another way I could do that? Switch row 2 and row 3. We could interchange rows 2 and 3. But Susan said multiply by negative 1, and I think that's actually the simplest thing to do. So I'm going to take negative 1 times row 2. And row 1 doesn't change. But row 2 does. 0, 1, negative 1, 0, negative 110. Row 3 is OK. And row 4 is OK for the time being. First column taken care of. I have my 1, so now I need to get 0s above and below. And I'll use this 1 to do it. So I think I'll take row 1 plus negative 1 times row 2. And on row 3, I'll take row 3 plus negative 1 times row 2. OK, now let's see. Row 2 won't change. So let me just rewrite that portion. And row 4 is not going to change. But row 1 changes. So row 1 becomes 1, 0, 1, 0, 4, 10. We've actually seen that row before. That was the second row of the original matrix. And row 3 becomes 0, 0, 1, 1, and 340. Well, you notice that row 3 and row 4 are the same now. So I've got a 1 here. And if I continue to get 0s above and below and follow in the same orderly process, I think row 4 is going to get wiped out this time. But that's OK. Let's take row 1 and add on negative 1 times row 3. And let's take row 2 and add on row 3. And let's take row 4 and add on negative 1 times row 3. That's going to take care of this entire column. And it looks like it's probably going to wipe out the last row. OK, well, the third row won't change. I'll rewrite that. But the top row will change. What will the new top row be there? Who can tell us? 1, 0, 0, negative 1. Negative 1, yeah. 70, I think it'll be. Yeah, that'll be a 70 there. OK, what about row 2? Let's see. Now, what we're doing is taking row 2 and adding on row 3. So what's row 2 going to become? 0, yeah. 1, 0, 1, yeah. And 2, 30. 2, 30. Have we ever seen that one before? Yeah, that was the original row 3. It's now in the row 2 lines. Let's just tell this one's working out. Some of these rows are resurfacing. I tell you what, you've been working awfully hard. I'm going to do the last row for you. OK, the last row is. I think it says 0, 0, 0, 0, 0. Yeah, I think I'm right on that one. OK, those are all 0s there. Now, what does it mean in a system of equations when you get a row of 0s? Infinitely many solutions? Well, yeah, well, I would say in this case what it means is one of these equations wasn't really necessary. And it's been moved to the bottom, and it's been completely eliminated. Now, I think we may be going too far if we say there's no solution. Because, for example, what if in this row it had said 0, 0, 0, 0, 100? So in other words, one of the other rows may say no solution. This one doesn't say that there couldn't be no solution, but it just says one of the equations is not needed. Now, if I take this matrix, there's no way I can get a 1 in the 4, 4 position. So there's no further reduction that I can make there. So what I'm going to do is step out of that augmented matrix and write down the system of equations as far as we've reduced it. So I'll just use this space over here. And it looks like that says x1 minus x4 is 70. That's the first equation. The second equation says that x2 plus x4 is 230. That was one of my original equations. And the third equation says x3 plus x4 equals 340. That was also one of the original equations. OK, so I have an extra variable in here that I can't isolate. So what this tells me is this one's going to become the parameter, and there will be infinitely many solutions. So now, if I solve for x1, x1 is 70 plus x4. And if I solve for x2, x2 is 230 minus x4. x3 is 340 minus x4. And you know as long as I've listed all of x1, x2, and x3. Let's put x4 in here. x4 is equal to, gee, what can we say? T. x4. x4 equals x4. Now, you see what's happened is I have all four of my variables defined in terms of x4. So the x4 on the right-hand side becomes what's referred to as a parameter. We saw this come up in the last episode. And this is actually a set of parametric equations. Now, in some books, the parameter is changed to a different letter, like T. So right here, I'm going to substitute T, T, T, and T. But I'm going to leave the x4 on this side. But what I've done is I've changed the x4s into a T. And this is referred to as a set of parametric equations. And we haven't had a chance to look at this very much. So this gives us an opportunity to sort of examine this in more detail. You see, if you pick an arbitrary value of T and substitute it in here, you'll get an x1, x2, x3, and x4. That's a solution for the original system of equations. And there are infinitely many different choices for T, which means you get infinitely many different solutions. For example, suppose T were equal to 0. In the case that T is equal to 0, what does x1 equal? 70. 70. OK, I'm going to write this as a set of coordinates. What would x2 be? 230. 230. x3 would be 340. And x4 would be 0. But on the other hand, suppose we were to say, what if T were equal to, let's say, 300? If T were 300, x1 would be what? 370. 370. What would x2 equal? Negative 70. Negative 70. Now you may wonder, how can you have a negative number in the traffic flow? We'll talk about that in a moment. For x3, we'll get 40. And for x4, we get 300 there. And now one more possibility. Suppose we say T is equal to, let's say, T is equal to negative 50, because there's no reason why we can't pick negative values as well as positive values. So what this says is x1 is equal to 20. x2 is equal to 280. x3 is equal to 390. Wow. And x4 is negative 50. OK, now let me take those answers. Let's go back to our graphic and look at our traffic flow situation and see how we'll describe that. So if we can put that problem back up on the screen. OK, so let's see. We said the solutions were, well, when T is equal to 0, our solution was 70, 230, 340, and 0. Looks like I'm getting up a little bit too close there. Let me move this in. That was for T equals 0. But another choice was what if T were 300, and our solution was 370, negative 70, 40, and 300. And finally, when T was negative 50, we got 20, 280, 390, and negative 50. Now let me just show you how this fits into our model over here. Let's take this first solution. If I put 70 for x1, and if I put 230 for x2, and if I put 340 for x3, and finally 0 down here for x4, then look how many cars are coming into this intersection. There were 300 cars coming in. Look how many are coming out, 70 and 230. 300 are coming out. So no one stopped in the intersection. Everything kept moving. Over here, there were 410 coming in. That's 70 and 340, and there were 410 going out. Same thing at the other nodes. We get exactly the right number of cars coming in and going out. Just turns out that there's no net change in traffic on this street, which means there are just as many cars going to the right as going to the left. So there's no net change in that portion of the traffic flow. Now if I take a different solution, let me just erase these numbers. Let's go to this last one down here. Suppose I put in 20 for x1. For x2, we'll put in 280. Now that does seem a little exorbitant, doesn't it? 280, but that's what we got. x3 over here, my gosh, this sounds like me coming to work. Over here, 390 cars in an hour there. And here's the weird part. We have negative 50 there. Now how should we interpret a negative 50? What do you think, Stephen? The net flow is going to the right, and there are more cars going to the right. The arrows pointed in the wrong direction. There are 50 cars. There's a net change of 50 cars moving to the right, not moving to the left. You see, when I put these arrows on here, I did these sort of arbitrarily. And so there's no reason to think that that's exactly how the cars should be moving. So if you get a negative number, it just means the cars are actually flowing in this other way. They should actually be flowing that way. And if you were to add up, check the numbers at every node, you would see there are just as many cars coming in as going out. So there are infinitely many solutions to this traffic problem, or to this network problem. But it doesn't mean anything is a solution, just because there are infinitely many, doesn't mean that anything's a solution. It has to satisfy the parametric equations that we created over there on the board a moment ago. OK, let's go to a new problem and look at simultaneous systems of linear equations. And this is on the next graphic. OK, this idea is going to become very important in the next episode. And so I want to sort of wind us down here with a new problem in which we have three different systems of equations. And I want to solve all of these at the same time. So I'm going to have to do a little erasing on the board to set that up. OK, now in that graphic, in the first system of equations, we have 3x plus 3y minus z is 12. 2x minus y plus 2z is negative 1. And 4y plus 3z is 12. OK, now if you look at the other two systems that are written up there, the other two 3 by 3 systems, they have the same variables, the same coefficients. The only way they change is in their constant term. The constant terms of the 1 in the upper right are 1, negative 12, and 30. And the constant terms and the 1 of the bottom is 50, negative 10, and 25. But the coefficients are all alike. Now if I were going to solve that first system of equations, I would write down this augmented matrix, 3, 3, negative 1, 12, and 2, negative 1, 2, and negative 1, and then 0, 4, 3, and 12. And I'd put a little dotted line in here to separate those constants. But if I have another system of equations that looks like this with different constants on the end, why don't we solve it at the same time, just put those constants next to it, 1, negative 12, and 30. And then in the third system of equations, the constants are 50, negative 10, and 25. OK, so here's my x column. Here's my y column. Here's my z column. And then here are my constants for the first system of equations. Here are my constants for the second system of equations. And here are the ones for the third system. So I'm thinking rather than working this three times and trying to reduce this to 1s and 0s, why not do it one time and have three different columns for the three different systems and just let all the answers work themselves out in different columns. So I'll really be working three systems in one operation. OK, so let's try solving this. I'll be using Gauss-Rodin elimination again, but I could use Gaussian elimination with back substitution, but that's not what this episode's about. So I want to get a 1 in the first position. Any suggestions on how to get a 1 there? Negative rho 2 plus rho 1. Exactly. Yeah, we don't want to multiply by a third. We get fractions in there. We're trying to avoid fractions. So let's take rho 1 plus negative 1 times rho 2. I have a 0 at the bottom, so that's good. I can get a 1 up there. I'll have to come back and get rid of that 2 in a moment. So the top row becomes 1, 4, negative 3, 13, and 13, and 60. The second row is still 2, negative 1, 2, negative 1, negative 12, negative 10, and 0, 4, 3, 12, 30, 25. I think we can save a little space there. OK, so now I'll go to work on that 2 and make that into a 0. So let's take rho 2 and add on negative 2 times rho 1. Now, rho 1 is still 1, 4, negative 3, et cetera. And rho 3 is still 0, 4, 3, et cetera. But rho 2 changes. It'll be, well, a 0 first. Who can tell me the rest of the numbers on that row? 5. I see negative 5. Let's see now. Be careful. We're multiplying by negative 2 times rho 1. So it's negative 2 times that plus this. Negative 9. Negative 9, yeah. 8. 8, very good. 25. Negative 26. Negative 27, very good. So I think that's good. If you have to pause on this, I think that's fine because the people at home are thinking, yeah, it's very easy to make careless errors on that. So I don't think we should do this flawlessly. Go ahead, Jenny. What would you get next? 26 plus 12. 38. Negative 38? Negative 38, right, very good. 120. And is that 10? That's a 10 there, yeah. Negative 130? Negative 130, yeah. OK, so let's see. We have a negative 9 and a 4. Somehow I want to get a 1 there. And we could introduce fractions like we could multiply by negative 1 ninth. But you see, that's going to be kind of messy. Can you think of a way of getting a 1 there that would allow us to keep integers? Add 2 times rho 3 to rho 2, and then times by a negative 1. Right, yeah, I think it's going to take two steps. Let's double rho 3 and add it to rho 2 and make that a negative 1. And then afterwards, we can change the signs. So that sounds good. I'm going to take rho 2 plus 2 times rho 3. And let's begin by rewriting rho 1. And while we're at it, let's rewrite rho 3, because it's not going to change. We're just using it to change something else. So if I double rho 3 and add it to rho 2, I'll go ahead and do this one. This is 0, negative 1, 14. And then negative 3, and then 22, and then negative 80. Then negative 80. OK, now let's go back and change those signs so that we make that into a positive. So I'm going to take negative 1 times rho 2. So that becomes 1 for or negative 3. The next row becomes 0, 1, negative 14. And the last row becomes, well, the last row stays just as it is. OK, and I have that 1. And I want to get a 0 up here. You know, rather than multiplying this guy by 4, why don't we multiply rho 3 by negative 1 and just add it to rho 1? That would save us a little bit of mental arithmetic, I think. Let's take rho 1 and add on negative 1 times rho 3. This is a little out of the ordinary. But since I have a 4 there and a 4 there, I think they're going to cancel out very quickly. Rho 2 will be unchanged. Rho 3 will be unchanged. But we're going to add the negative of rho 3 to rho 1. That'll make it a 1 and a 0 and a negative 6 and 1 and negative 17 and 35. OK, now I go to work on the 4 down below. So I'll take rho 3 plus negative 4 times rho 2. Rho 2 stays the same. But rho 3 is going to change. So this will be 0, 0. And let's see. Now negative 4 times 14 is positive 56 plus 3 is 59. And negative 4 times 3 plus 12 is 0. And negative 4 times negative 22 is 88. 88 plus 30 is 118. The numbers look pretty bad right now, but I think we're going to be OK. And finally, negative 4 times 80, that's what? Negative 320, add 25 is negative 295. Now normally when I see numbers that big, I think, there must have been something wrong. But 59 will divide both of those. So if I multiply by 1 over 59, I think we'll be getting out of this. OK, so on the last row, let's see. I'm going to take 1 over 59 times rho 3. Rho 1 is still unchanged. Well, it's unchanged for now. But watch and see if this doesn't turn into a decent equation on the bottom. Let's see, we're taking 1 59th of the bottom row. That's 0, 0, 1. Now what are the other numbers going to be? 0. 0, yep. 2. 2, yep. 5. And negative 5. Negative 5. So what this tells me is in the first system of equations, z is 0. In the second system of equations, z is 2. And in the last system of equations, z is negative 5. OK, and I've got my 1 there, so now I just need to get 0s up above. And we'll be able to get all of the solutions. So let's take rho 1 plus 6 times rho 3. Let's take rho 2 plus 14 times rho 3. And I think we'll be out of this. So the bottom row is, let's go ahead and get it down, 0, 2, and negative 5. Now the top row will be 1 0 0, 1. And 6 times 2 added to negative 17 is a negative 5. And 6 times negative 5 added to 35 is 5. OK, and on the second row, we're taking 14 times rho 3, so that'll be 0, 1, 0. And this will still be a 3. Let's see, 14 times 2 is 28 plus negative 22 is 6. And what's 14 times 5? 70. 70, thank you very much. OK, so that's going to be, let's see, negative 70 plus 80 is 10. OK, now believe it or not, I think we've finally solved three systems of equations simultaneously. These are the solutions to the first system. These are the solutions to the second system. And these guys are the solution to the third system. Now you might say, well, Dennis, why would anybody want to do this? Why would they want to solve three systems of equations simultaneously? Well, first of all, you're going to see us do this exact thing in the next episode. It won't be quite this long and detailed, but you're going to see us do something like this in the next episode. And so that application is going to come up. But also, if you're working for a company where you have to solve, let's say, systems of equations, it wouldn't be unusual that you might have to solve the same systems repeatedly with different constants on the end. And if that's the case, why not do them all at once? What if I had had 100 systems of equations with these coefficients but 100 different constant columns? I could just stack those on the end. And theoretically, I could work them out by hand. Of course, we wouldn't want to do that. So what we'd do is have a computer do it at that point. But if you're going into computer science, you have to understand what the algorithms are that are being used in a computer if you want to be able to modify the programs, rewrite the programs, or whatever. And so this is giving some insight into how the computer might solve this. Well, let's see. We've looked extensively at the Gauss-Jordan method for solving a system of equations. On an exam, if I don't specify which of those two methods to use, I'll just say use matrix methods to solve the system. And I'll leave it up to you which of the two methods, Gaussian elimination with back substitution or Gauss-Jordan, which one you want to use. But if I specify a particular method, then I'll want you to do that. Don't be surprised if you get a problem with no solution. Don't be surprised if you get a problem that has infinitely many solutions and the solution is parametrized. I'll see you next time for episode 24.