lec4_gaussian
lec4_gaussian
give some insight into the difficulty of assessing the accuracy of computed solutions of
linear systems.
Summary
(1) The basic forward elimination procedure using equation k to operate on equations k +
1, k + 2, . . . , n is
#
ai j ← ai j − (aik /akk )ak j (k ! j ! n, k < i ! n)
bi ← bi − (aik /akk )bk
(2) When solving the linear system Ax = b, if the true or exact solution is x and the
x , then important quantities are
approximate or computed solution is !
roblems 7.1
a
1. Show that the system of equations
⎧
⎨ x1 + 4x2 + αx3 = 6
Forward Elimination
Just prior to the kth step in the forward elimination, the system will appear as follows:
⎡ ⎤⎡ ⎤ ⎡ ⎤
a11 a12 a13 ··· ··· ··· a1n x1 b1
⎢ 0 a22 a23 a2n ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ··· ··· ··· ⎥ ⎢ x2 ⎥ ⎢ b2 ⎥
⎢ 0 0 a33 a3n ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ··· ··· ··· ⎥ ⎢ x3 ⎥ ⎢ b3 ⎥
⎢ .. .. .. .. .. ⎥ ⎢ .. ⎥ ⎢ .. ⎥
⎢ . . . . . ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ . ⎥ ⎢ . ⎥
⎢ 0 0 0 akk ak j · · · akn ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ··· ··· ⎥ ⎢ xk ⎥ = ⎢ bk ⎥
⎢ .. .. .. .. .. .. .. ⎥ ⎢ .. ⎥ ⎢ .. ⎥
⎢ . . . . . . . ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ . ⎥ ⎢ . ⎥
⎢ 0 0 0 aik ai j · · · ain ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ··· ··· ⎥ ⎢ xi ⎥ ⎢ bi ⎥
⎢ . .. .. .. .. .. .. ⎥ ⎢ .. ⎥ ⎢ .. ⎥
⎣ .. . . . . . . ⎦⎣ . ⎦ ⎣ . ⎦
0 0 0 · · · ank · · · an j · · · ann xn bn
Here, a wedge of 0 coefficients has been created, and the first k equations have been proc-
essed and are now fixed. Using the kth equation as the pivot equation, we select multipliers
to create 0’s as coefficients for each xi below the akk coefficient. Hence, we compute for
each remaining equation (k + 1 ! i ! n)
⎧ + ,
⎪ aik
⎪ a
⎨ ij ← aij − ak j (k ! j ! n)
akk
+ ,
⎪
⎪ aik
⎩ bi ← bi − bk
akk
Obviously, we must assume that all the divisors in this algorithm are nonzero.
Forward Elimination: Pseudocode
7.1 Naive Gaussian Elimination 2
j = k, we have
Since we expect this to be 0, no purpose is served in computing it. The location where th
is being created is a good place to store the multiplier. If these remarks are put into practi
the pseudocode will look like this:
Back
where the ai j ’s and bi ’s are Substitution
not the original ones from System (6) but instead are the ones
that have been altered by the elimination process.
The back substitution starts by solving the nth equation for xn :
bn
xn =
ann