Subsection 5.3.1 Gaussian elimination with row exchanges
¶ !Homework 5.3.1.1.
Perform Gaussian elimination as explained in Subsection 5.2.1 to solve
The appended system is given by
In the first step, the multiplier is computed as \(\lambda_{1,0} = 1/0 \) and the algorithm fails. Yet, it is clear that the (unique) solution is
The point of the exercise: Gaussian elemination and, equivalently, LU factorization as we have discussed so far can fail if a "divide by zero" is encountered. The element on the diagonal used to compute the multipliers in a current iteration of the outer-most loop is called the pivot (element). Thus, if a zero pivot is encountered, the algorithms fail. Even if the pivot is merely small (in magnitude), as we will discuss in a future week, roundoff error encountered when performing floating point operations will likely make the computation "numerically unstable," which is the topic of next week's material.
The simple observation is that the rows of the matrix (and corresponding right-hand side element) correspond to linear equations that must be simultaneously solved. Reordering these does not change the solution. Reordering in advance so that no zero pivot is encountered is problematic, since pivots are generally updated by prior computation. However, when a zero pivot is encountered, the row in which it appears can simply be swapped with another row so that the pivot is replaced with a nonzero element (which then becomes the pivot). In exact arithmetic, it suffices to ensure that the pivot is nonzero after swapping. As mentioned, in the presence of roundoff error, any element that is small in magnitude can create problems. For this reason, we will swap rows so that the element with the largest magnitude (among the elements in the "current" column below the diagonal) becomes the pivot. This is known as partial pivoting or row pivoting.
Homework 5.3.1.2.
When performing Gaussian elimination as explained in Subsection 5.2.1 to solve
set
to
(since we will assume \(k \) to be large and hence \(1 \) is very small to relative to \(10^k \)). With this modification (which simulates roundoff error that may be encountered when performing floating point computation), what is the answer?
Next, solve
What do you observe?
The appended system is given by
In the first step, the multiplier is computed as \(\lambda_{1,0} = 10^k \) and the updated appended system becomes
which is rounded to
We then compute
and
If we instead start with the equivalent system
the appended system after one step becomes
which yields the solution
which becomes
as \(k \) gets large.
What this illustrates is how a large multiple of a row being added to another row can wipe out information in that second row. After one step of Gaussian elimination, the system becomes equivalent to one that started with