18 Section 3.2
12.
x12x2+x3x4=5
x1+ 5x27x3+ 2x4= 2
3x1+x25x3+ 3x4= 1
2x1+ 3x25x3= 17
The initial augmented matrix for the system is
(a) Initialize the row vector to r=1234T.Among the values
The first pass of Gaussian elimination transforms the augmented matrix to
Now,
Finally,
Pivoting Strategies 19
As ar4,3= 0, the third pass of Gaussian elimination is already complete. Back
substitution now yields
(b) Initialize the row vector to r=1234T.Since
Among the values
Now,
20 Section 3.2
As ar4,3= 0, the third pass of Gaussian elimination is already complete. Back
substitution now yields
13. Show that when the system
3 1 4 1
221 2
5 7 14 8
1 3 2 4
7
1
20
4
is solved using Gaussian elimination with no pivoting and four decimal digit
rounding arithmetic, the resulting solution is x=1.131 0.7928 0.8500 0.9987 T.
Pivoting Strategies 21
Back substitution now yields
In Exercises 14 – 17, solve the given system in the indicated finite precision
arithmetic using
(i) Gaussian elimination with no pivoting;
(ii) Gaussian elimination with partial pivoting; and
(iii) Gaussian elimination with scaled partial pivoting.
Compare the results obtained from each technique with the exact solution of
the system.
14. 3 decimal digit rounding arithmetic
0.5x1+ 1.1x2+ 3.1x3= 6.0
2.0x1+ 4.5x2+ 0.36x3= 0.02
5.0x1+ 0.96x2+ 6.5x3= 0.96
(i) Using three decimal digit rounding arithmetic and no pivoting, Gaussian elim-
ination proceeds as follows:
Back substitution now yields
22 Section 3.2
(ii) Initialize the row vector to r=123T.Among the values
Back substitution now yields
(iii) Initialize the row vector to r=123T.Since
Pivoting Strategies 23
The first pass of Gaussian elimination transforms the augmented matrix to
Back substitution now yields
15. 3 decimal digit rounding arithmetic
3.41x1+ 1.23x21.09x3= 4.72
2.71x1+ 2.14x2+ 1.29x3= 3.10
1.89x11.91x21.89x3= 2.91
(i) Using three decimal digit rounding arithmetic and no pivoting, Gaussian elim-
ination proceeds as follows:
24 Section 3.2
Back substitution now yields
(ii) Initialize the row vector to r=123T.Among the values
the largest corresponds to r1, so there is no need to modify the contents of the
row vector. The first pass of Gaussian elimination transforms the augmented
Now,
The next pass of Gaussian elimination reduces the augmented matrix to
Back substitution now yields
Pivoting Strategies 25
(iii) Initialize the row vector to r=123T.Since
the largest corresponds to r1and r2. Following convention, we select the first
The larger value corresponds to r3, so we interchange the second and third
entries in the row vector to obtain
Back substitution now yields
16. 4 decimal digit rounding arithmetic
3 1 4 1
221 2
5 7 14 9
1 3 2 4
7
1
21
4
(i) Using four decimal digit rounding arithmetic and no pivoting, Gaussian elimi-
nation proceeds as follows:
3 1 4 17
3 1 4 17
0 0 0 3005 3004
Back substitution now yields
x4=3004
(ii) Initialize the row vector to r=1234T.Among the values
Pivoting Strategies 27
The first pass of Gaussian elimination transforms the augmented matrix to
Now,
Finally,
As ar4,3= 0, the third pass of Gaussian elimination is already complete. Back
substitution now yields
(iii) Initialize the row vector to r=1234T.Since
28 Section 3.2
Among the values
|ar1,1|
sr1
=3
4,|ar2,1|
sr2
=2
2,|ar3,1|
sr3
=5
14,|ar4,1|
sr4
=1
4,
the largest corresponds to r2. We therefore interchange the first two entries
in the row vector to obtain
r=2134T.
The first pass of Gaussian elimination transforms the augmented matrix to
0 4.000 5.500 4.000 5.500
221 2 1
0 12.00 16.50 14.00 18.50
0 4.000 2.500 3.000 4.500
.
Now,
|ar2,2|
sr2
=4.000
4,|ar3,2|
sr3
=12.00
14 and |ar4,2|
sr4
=4.000
4.
The largest value corresponds to both r2and r4. Following convention, we
select the first occurrence of the maximum, so there is no need to modify the
contents of the row vector. The next pass of Gaussian elimination reduces the
augmented matrix to
0 4.000 5.500 4.000 5.500
221 2 1
0 0 0 2.000 2.000
0 0 3.000 7.000 10.00
.
Finally,
|ar3,3|
sr3
= 0 and |ar4,3|
sr4
=3.000
14 .
The larger value corresponds to r4, so we interchange the third and fourth
entries in the row vector to obtain
r=2143T.
As ar4,3= 0, the third pass of Gaussian elimination is already complete. Back
substitution now yields
x4=2.000
2.000 =1.000;
x3=10.00 7.000(1.000)
3.000 =3.000
3.000 = 1.000;
x2=5.500 5.500(1.000) + 4.000(1.000)
4.000 =4.000
4.000 =1.000;
x1=1 + 2(1.000) + 1.000 2(1.000)
2=2.000
2= 1.000
Each component of the solution vector is correct to four decimal digits.
Pivoting Strategies 29
17. 4 decimal digit rounding arithmetic
1.985x11.358x2+ 2.113x3=5.56
0.953x10.6522x21.815x3= 0.1592
2.607x1+ 0.2065x2+ 3.79x3=0.357
(i) Using four decimal digit rounding arithmetic and no pivoting, Gaussian elimi-
nation proceeds as follows:
1.985 1.358 2.113 5.56
1.985 1.358 2.113 5.56
Back substitution now yields
(ii) Initialize the row vector to r=123T.Among the values
30 Section 3.2
The next pass of Gaussian elimination reduces the augmented matrix to
Back substitution now yields
(iii) Initialize the row vector to r=123T.Since
Among the values
the largest corresponds to r1, so there is no need to modify the contents of the
row vector. The first pass of Gaussian elimination transforms the augmented
Pivoting Strategies 31
The next pass of Gaussian elimination reduces the augmented matrix to
Back substitution now yields
18. Let Abe the n×nmatrix whose entries are given by aij = 1/(i+j1) for
1i, j n.
(a) For n= 5,6 and 7, solve the system Ax=busing single precision arith-
metic. In each case, take bas the vector that corresponds to an exact
solution of xi= 1 for each i= 1,2,3, …, n. Compare the solutions ob-
tained using Gaussian elimination without pivoting, with partial pivoting
and with scaled partial pivoting.
(b) For n= 11,12 and 13, solve the system Ax=busing double precision
arithmetic. In each case, take bas the vector that corresponds to an exact
solution of xi= 1 for each i= 1,2,3, …, n. Compare the solutions obtained
using Gaussian elimination without pivoting, with partial pivoting and
with scaled partial pivoting.
(a) Working in single precision arithmetic, the results obtained for each nand each
Scaled
No Pivoting Partial Pivoting Partial Pivoting
32 Section 3.2
Scaled
No Pivoting Partial Pivoting Partial Pivoting
Scaled
No Pivoting Partial Pivoting Partial Pivoting
1.00083
1.00090
1.00058
(b) Working in double precision arithmetic, the results obtained for each nand
each pivoting strategy are summarized below. For n= 11, the solution ob-
Scaled
No Pivoting Partial Pivoting Partial Pivoting
1.00000
1.00016
0.999064
0.992856
0.991930
0.999264
1.00000
1.00016
0.999072
0.992910
0.991982
0.999268
1.00000
1.00030
0.998232
0.986402
0.984544
0.998583
Pivoting Strategies 33
Scaled
No Pivoting Partial Pivoting Partial Pivoting
1.00000
0.999916
0.991859
0.902315
0.795768
1.00000
0.999862
0.986242
0.831939
0.643862
1.00000
0.999940
0.994281
0.931901
0.858404
Scaled
No Pivoting Partial Pivoting Partial Pivoting
0.999984
0.989763
0.501003
7.28388
5.49353
0.999989
0.993147
0.669261
5.11855
3.24305
0.999977
0.985051
0.265333
10.3429
8.68096
19. Solve the following system in single precision arithmetic.
149x150x2154x3= 353
537x1+ 180x2+ 546x3=1263
27x19x225x3= 61
Use Gaussian elimination without pivoting, with partial pivoting and with scaled
partial pivoting. Which technique provided the most accurate solution? The
exact solution for this problem is x=111T.
Using single precision arithmetic, we find the following solutions:
34 Section 3.2
No pivoting 1.00124 0.996035 1.00008 T
20. Solve the following system in double precision arithmetic.
9 11 21 63 252
70 69 141 421 1684
575 575 1149 3451 13801
3891 3891 7782 23345 93365
1024 1024 2048 6144 24572
356
2385
19551
132274
34812
Use Gaussian elimination without pivoting, with partial pivoting and with scaled
partial pivoting. Which technique provided the most accurate solution? The
exact solution for this problem is x=11 1 1 1 T.
Using double precision arithmetic, we find the following solutions:
No pivoting