CHAPTER 04.06: GAUSSIAN ELIMINATION: Naive Gauss Elimination Method: Example: Part 2 of 2 (Back Substitution)
In this segment, I'm going to continue with the example we had for Naive Gaussian elimination. We're looking at an example to solve a set of simultaneous linear equations, and we're going to, in this part, do back substitution part. There are two parts to Naive Gaussian elimination, or even the Gauss elimination with partial pivoting, which we will do later, is there's a forward elimination part to it, and there is a back substitution part of it.
The forward elimination part for the example which we just did resulted in the coefficient matrix being turned into an upper triangular matrix so that we can apply the algorithm of back substitution to do that, and this is what we obtained, 25, 5, 1, 0, -4.8, -1.56, 0, 0, 0.7, and we had three unknowns, a1, a2, and a3, and we had 106.8, -96.208, and 0.76. So the reason why we convert the coefficient matrix into an upper triangular matrix, because you're seeing that everything below the diagonal is 0, is so that we can solve one equation at a time, is that when we look at the last equation, it only has one unknown in it, when we look at the second . . . second-last equation, it has two unknowns, but a3 is already known, and the last, or the first equation, we have three unknowns, a1, a2, and a3, but these two have already been calculated, hence we can calculate a1. So that's the whole point why we convert our coefficient matrix, or do the matrix operations, so as to convert the coefficient matrix into an upper triangular matrix. So we'll look at the last equation, so from the third equation, so that's how you start in the back substitution, that's why it's called back substitution, because you're going backwards, so the third equation is simply 0.7 a3 is 0.76, which gives you a3 is 0.76 divided by 0.7, and that gives you 1.08571, so that's the value of a3. Now we want to calculate a2, what we'll have to do is we'll have to now write down this equation here, which is the second-last equation. So that turns out to be -4.8 a2, minus 1.56 a3, and that's equal to -96.208. So if I'm going to write down this equation in terms of a2, I get -96.208, plus 1.56 a3, divided by -4.8, that's what I get. So I'm going to substitute the value of a3, which I just obtained from the previous equation, or the previous step, a3 is 1.08571, divided by 4.8, and this value here turns out to be 19.6905, so we have already calculated now a3 and a2. Now let's go ahead and substitute now the values of a2 and a3 to get a1, so for that we'll have to look at the first equation. The first equation is, when we expand it will be 25 a1, plus 5 a2, plus a3 is 106.8, and since we have already calculated a2 and a3, calculating a1 is pretty straightforward, so what we're going to do is we're going to write down the equation for a1, which is 106.8, minus 5 a2, minus a3, divided by 25. The reason why I'm writing the equation like this is because that's following the algorithm, that what you do is in order to calculate a particular unknown, you take the element, the coefficient corresponding to it goes in the denominator, the right-hand side goes there, and then there's a summation of all the contributions coming from the previous values which have already been calculated. So that is . . . for that you should look at the algorithm part of this . . . of the Naive Gauss elimination to be able to see that how that would work in a program. So here this is my 106.8 minus 5, a2 we just calculated as 19.6905, minus a3, which is 1.08571, divided by 25, and this value here turns out to be 0.290472. So we have been able to calculate all the unknowns which we have. So if I write down the vector of the unknowns, a1, a2, a3, we get this to be equal to 0.290472, because that's just what we calculated here, that's a2, which is 19.6905, that's a3, that's 1.08571. And that's the solution which we obtain for the three equations, three unknowns by using the back substitution part of the Naive Gauss elimination algorithm. And that is the end of this segment.