Gaussian elimination is a direct method, solving for the “exact” solution in one pass through the equations.
Given the matrix form of a system of equations:
Forward Elimination
First, we eliminate by multiplying the first row by so that it is:
This means that it can now be subtracted from the second row to get:
or
where the prime indicates that the value has been changed.
We can then also repeat the procedure for row 3, where:
At this point our matrix will be:
We then eliminate by doing:
such that our matrix is:
Here the double prime on and indicates that they have been changed twice.
Forward Elimination Completion Criteria
Forward elimination is complete when terms below the diagonal in are , such as
Backward substitution
Starting at the bottom, we can solve using:
Then, we can move up to row 2 to solve by subbing in our solved value:
Then we can continue moving up and sub in and to solve for :
Notes
The above approach is called Naïve Gaussian Elimination, because we are not
checking for a divide by zero. For example, if we have
if the term on the diagonal is , we will have a division by zero.
Benefits:
- We achieve the exact solution in one pass
- Straightforward algorithm
Challenges:
- Not very efficient (many calculations needed)
- Divide by zero is possibility (if there is zero on diagonal)
- Round-off Error for Gaussian Elimination