03.03.2014 Views

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

26 CHAPTER 3. SOLVING LINEAR SYSTEMS<br />

The algorithm then selects the first row as the pivot equation or pivot row, and the first element of<br />

the first row, a 11 is the pivot element. The algorithm then pivots on the pivot element to get the<br />

system:<br />

⎛<br />

⎞<br />

a 11 a 12 a 13 · · · a 1n b 1<br />

0 a ′ 22 a ′ 23 · · · a ′ 2n b ′ 2<br />

0 a ′ 32 a ′ 33 · · · a ′ 3n b ′ 3<br />

⎜<br />

⎝<br />

.<br />

. . . ..<br />

⎟<br />

. ⎠<br />

0 a ′ n2 a ′ n3 · · · a ′ nn b ′ n<br />

Where<br />

( )<br />

a ′ ij = a ij − ai1<br />

a 11<br />

a 1j<br />

( )<br />

b ′ i = b i − ai1<br />

a 11<br />

b 1<br />

⎫<br />

⎬<br />

⎭<br />

(2 ≤ i ≤ n, 1 ≤ j ≤ n)<br />

Effectively we are carrying out the e.r.o. of replacing the i th row by the i th row minus<br />

( )<br />

ai1<br />

a 11<br />

( )<br />

ai1<br />

a 11<br />

times<br />

the first row. The quantity is the multiplier for the i th row.<br />

Hereafter the algorithm will not alter the first row or first column of the system. Thus, the<br />

algorithm could be written recursively. By pivoting on the second row, the algorithm then generates<br />

the system:<br />

⎛<br />

⎞<br />

a 11 a 12 a 13 · · · a 1n b 1<br />

0 a ′ 22 a ′ 23 · · · a ′ 2n b ′ 2<br />

0 0 a ′′<br />

33 · · · a ′′<br />

3n b ′′<br />

3<br />

⎜<br />

⎝<br />

.<br />

. . . ..<br />

⎟<br />

. ⎠<br />

0 0 a ′′ n3 · · · a ′′ nn b ′′ n<br />

In this case<br />

( )<br />

ij = a ′ ij − a ′<br />

i2<br />

a ′′<br />

a ′ 22<br />

b ′′<br />

i = b ′ i − ( a ′<br />

i2<br />

a ′ 22<br />

3.1.3 Algorithm Problems<br />

a ′ 2j<br />

)<br />

b ′ 2<br />

⎫<br />

⎬<br />

⎭<br />

(3 ≤ i ≤ n, 1 ≤ j ≤ n)<br />

The pivoting strategy we examined in this section is called ‘naïve’ because a real algorithm is a bit<br />

more complicated. The algorithm we have outlined is far too rigid–it always chooses to pivot on<br />

the k th row during the k th step. This would be bad if the pivot element were zero; in this case all<br />

the multipliers a ik<br />

a kk<br />

are not defined.<br />

Bad things can happen if a kk is merely small instead of zero. Consider the following example:<br />

Example 3.2. Solve the system of equations given by the augmented form:<br />

( −0.0590 0.2372<br />

) −0.3528<br />

<strong>0.1</strong>080 −0.4348 0.6452<br />

Note that the exact solution of this system is x 1 = 10, x 2 = 1. Suppose, however, that the algorithm<br />

uses only 4 significant figures for its calculations. The algorithm, naïvely, pivots on the first<br />

equation. The multiplier for the second row is<br />

<strong>0.1</strong>080<br />

−0.0590 ≈ −1.830508...,<br />

which will be rounded to −1.831 by the algorithm.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!