20.7 Gauss elimination for the solution of linear equations 583
Whenλ 1 = 123 , equation (3′′) is redundant, and back substitution givesy 1 = 15 z 221 − 18 and
x 1 = 1131 − 13 z. Because zremains arbitrary, we have infinitely many solutions, one for
each possible value of z. On the other hand, no solution exists whenλ 1 ≠ 123.
0 Exercise 31
Pivoting
The elimination method involves repeated subtraction of a multiple of one equation
from another and can lead to serious differencing errors, especially for large systems
of equations. To illustrate the problem, we consider the pair of equations
(1) 0.0003x
11 + 1 2.513x
21 = 1 7.545
(2) 0.7003x
11 − 1 2.613x
21 = 1 6.167
(20.45)
of which the solution isx
11 = 120 ,x
21 = 13. To solve by the elimination method, we choose
(1) as the pivot equation and eliminatex
1from (2) by subtracting (0.7003 2 0.0003) 1 ×
(1) from (2). If, for example, the calculation is performed using 4-figure arithmetic
then0.7003 2 0.0003 1 = 12334 , and the second equation becomes
(2′) − 5868 x
21 = 1 − 17600
Thenx
21 = 1 2.999, and equation (1) givesx
11 = 1 28.38. A small error inx
2has led to a large
error inx
1because the coefficient ofx
1in equation (1) is small compared with that in
(2). The resulting differencing errors are avoided if equation (2) is chosen as the pivot
equation. Then, multiplication of (2) by0.0003 2 0.7003 1 = 1 0.0002484and subtraction
from (1) gives
(1′) −2.514x
21 = 1 −7.542
so thatx
21 = 1 3.000. Substitution in (2) then givesx
11 = 1 20.0.
The choice of equation (2) as the pivot equation is an example of partial pivoting;
that is, choosing the pivot equation in the first step as that equation in which the
coefficient ofx
1has largest magnitude. Similarly forx
2in the second step, and so on.
Partial pivoting is equivalent to a reordering of the equations, but is not always
sufficient. For example, equations (20.45) may have been obtained with (1) multiplied
by some large number, 3000 say:
(1) 0.9000x
11 + 17539 x
21 = 122640
(20.46)
(2) 0.7003x
11 − 1 2.613x
21 = 1 6.167
The coefficient ofx
1in (1) is now the greater, but choosing (1) as the pivot equation
again results in a poor (but different) result. The correct procedure, called scaled
partial pivoting, is to choose as pivot equation in the first step that equation in which
the ratio of the coefficient ofx
1to the largest other coefficient has largest magnitude.
This ratio is0.90000 275391 ≈ 1 0.0001in equation (1) and0.7003 2 2.613 1 ≈ 1 0.3in equation