CHAPTER 04.06: GAUSSIAN ELIMINATION: Gaussian Elimination With Partial Pivoting: Example: Part 2 of 3 (Forward Elimination)

 

So the second row, first column now is 0.  Now I have to do the same thing for first row . . . third row, first column, so let me go back here, I need to make this to be 0.  So in order to be able to make this to be 0, this 25 to be 0, what I'll do is I'll divide it by 144, the first row, because I'm at the . . . I'm still at the first step of forward elimination, so that means that I have to use the first row as the equation which makes the elements below the first row in the first column to be 0. So I will divide the first row by 144 and multiply it by 25, that will give me the multiplier in order to make this to be 0, and I will show that on the next board. So the multiplier is 25 divided by 144, so that turns out to be 0.1736, and now what I'm going to do is I'm going to multiply the first row by 0.1736 so that it makes the third row, first column to be 0, then I subtract it.  So when I multiply this, I get 25.00, 2.083, 0.1736, and 48.47.  Again, keep in mind that for simplicity reasons, I'm only using four significant digits in showing my calculations.  If you take more at home, you will find out that you get a slightly different answer.  I'm just doing this so that it looks aesthetically pleasing.  Now what I'm going to do is I'm going to take this multiple of the first row, and subtract it from the third row.  So the third row is 25, 5, 1, 106.8, this is the third row, and I'm going to subtract this, which I get 25, 2.083, 0.1736, 48.47, and when I subtract it I get 0, and then I get 2.917, I get 0.8264, so this is negative, negative, negative here, and I get 58.33.  So you're seeing that by doing this operation of multiplying the first row by 0.1736 and subtracting it from the third row, I get 0 in the third row, first column, and this is the end of the first step of forward elimination, which means that, when we talk about first step, use the first row to make everything below the first row in the first column to be 0, so it's algorithmically, you can see what I'm talking about, everything is related to one.  You take the first row, first column, that creates the . . . that creates the multiple, so you take the first row, and you make the first column below the first row to be 0.  So this is what we get, we get 144, 12, 1, 279.2, the first row stays the same, then the second row is 0, 2.667, 0.5556, and the right-hand side is 58.33, and then we have 0, 2.667, 0. . . . sorry, this one is 0.8264, yeah, 0.8264, yeah, that's what it is, this one is not 2.667, this is 2.917, okay, that's this one, 2.917, 0.8264, and then 58.33, and this one is 53.1, so. So the second row is 0, 2.667, 0.5556, 53.1, the third row is this one, 0, 2.917, 0.8264, and 58.33, so that's the first step end.  So that's the end of the first step of forward elimination.  Let's go ahead and look at now the second step of forward elimination. So . . . so we have to look at the second step of forward elimination. 

 

So let me go back to the previous board here. Now what are we going to do?  Just focus on this part here, what we're going to do is that we are going to . . . we are now going to do the second step of forward elimination, which means that we've got to take this element here . . . we've got to take this element here, and this is in the second row, second column, again, keep in mind, second step of forward elimination, we're going to take this second row, second column, and try to make this 0.  But before we do that, what we need to do is we need to look at these numbers here in order to be able to see that which one is bigger, is this one bigger than this one, so far as the maximum absolute value is concerned. So the absolute value of 2.667 is 2.667, the absolute value of 2.917 is 2.917, so this one is bigger than this one, that means that row three has to be switched with row two before we do anything else.  So let's go ahead and do that first, and then we will make this second . . . third row, second column to be 0, because that's what the algorithm of the Gauss elimination says.  So . . . so before I do anything else, I need to take the absolute value of the second row, second column, third row, second column, so everything which is in the second column below second row . . . second row and below, so this maximum here turns out to be . . . so this is 2.667, 2.917, so this is the maximum. So since this the maximum, it's related to the third row, this is related to the second row, I'm going to switch row two and row three, that's what I'm going to do, I'm going to switch row two and row three.  And my resulting equation is now going to look different, it's going to look like this, 144, 12, 1, 0, 2.917, 0.8264, again, keep in mind that you have to . . .  you have to switch the right-hand side also, otherwise the equations will not stay the same, so this becomes 279.2, and this becomes 58.33, and then the second row becomes the third row, which makes it this, 2.667, 0.5556, and then you have 53.10. Now what I have to do is I have to divide by 2.917 and multiply by 2.667, that will be my multiplier, and then I'll multiply it . . . this row by that number, and then subtract it from here to make this to be 0.  So the multiplier is 2.667, this number divided by this number, that's my multiplier, and that multiplier turns out to be 0.9143, and I'm going to take this multiplier and multiply it to the second row here.  So I have 0, 2.917, 0.8264, and the right-hand side value is 58.33, and I'm going to use the multiplier of 0.9143, and this gives me 0, 2.667, 0.7556, and 53.33.  So I'm going to take this, and I'm going to subtract it from the third row, the third row is 0, 2.667, or the third equation, I should say, 0.5556, and 53.10, which is the right-hand side number, and I'm going to take this and write it down underneath it, again, keep in mind that you have to follow the algorithm of the Gauss elimination with partial pivoting to get the numbers.  So I'm going to subtract this, I'm going to get 0, 0, -0.2, and -0.23, so that becomes my third row now, and you see that in the third row, this is 0 and that is 0. So if I rewrite . . . so this is the . . . when I rewrite my equations now, when I rewrite my equations in the matrix form, let's so what do I get. 

 

My first two equations will stay the same, because I'm at the second step of forward elimination, so nothing changes about the first equation, nothing changes about the second equation. The third equation is this one, so that goes there, which is 0, 0, -0.2, and -0.23, the unknowns are a1, a2, a3, and that's the end of the second step of forward elimination.  That is the end of the second step of forward elimination, because I have gone through two steps and got 0 and 0 here, and that's the end of the forward elimination also, because I have been able to get my coefficient matrix turned into an upper triangular matrix. There are always n-minus-1 steps, which means that there are 3 minus 1, 2 steps in this case, which is 2 steps in this case, which is two steps in this case for our forward elimination.  And that is the end of this segment, and in the next segment, I will show you how to do back substitution on these equations.