# Two digit partial pivoting

This is problem 1.7.16 from our text.

We consider the system

$$

\left(\begin{matrix}

0.1 & 2.7 \\ 1.0 & 0.5

\end{matrix}\right)

\left(\begin{matrix}x\\ y \end{matrix}\right) =

\left(\begin{matrix}10.0\\ -6.0 \end{matrix}\right).

$$

a. Find the *exact* solution.

b. Solve the system using Gaussian elimination with two-digit rounding.

c. Solve the system using Gaussian elimination with partial pivoting and two-digit rounding.

d. Compare your answers and discuss

## Comments

a.)

$$x = -8$$

$$y = 4$$

b.)

$$\left(\begin{array}{cc|c}

0.1 & 2.7 & 10\\

1.0 & 0.5 & -6.0

\end{array}\right) \sim

\begin{pmatrix}

0.1 & 2.7 & |10\\

0 & -28&| -110

\end{pmatrix}

\Rightarrow

$$

$$x = -5.3$$

$$y = 3.9$$

c.)

$$\begin{pmatrix}

1.0 & 0.5 & |-6\\

0.1 & 2.7 &| 10

\end{pmatrix} \sim

\begin{pmatrix}

1 & 0.5 & |-6\\

0 & 2.7&| 11

\end{pmatrix}

\Rightarrow

$$

$$x = -8.1$$

$$y = 4.1$$

d.)

I'm still trying to rap my head around the general case and the use of the full pivot to make a more accurate rounding operation. From what I get so far, when the number is small, for first pivot: a row multiplication increases the other elements by so much and will greatly affect the row addition used in Gaussian elimination. That is the source of the error. Making it where the first pivot is larger than the next, before column manipulation, reduces the amount of error effect on future moves.

@dan I don't think you've dealt with round-off correctly. Note, for example, that -106 (in your first reduced matrix) is had

threedigits of precision, rather than the required two digits.a)$$

\

\left[

\begin{array}{cc|c}

0.1 & 2.7 & 10 \\

1.0 & 0.5 & -6.0

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

0.1 & 2.7 & 10 \\

0 & -26.5 &-106

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

0.1 & 0 & -0.8 \\

0 &-26.5 & -10.6

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

1 & 0 & -8 \\

0 & 1 & 4

\end{array}

\right]

\

$$

b)$$

\

\left[

\begin{array}{cc|c}

0.1 & 2.7 & 10 \\

1.0 & 0.5 & -6.0

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

0.1 & 2.7 & 10 \\

1.0 & 0.5 & -6.0

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

0.1 & 2.7 & 10 \\

0 & -27 & -110

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

0.1 & 0 & -1 \\

0 & -27 & -110

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

1 & 0 & -10 \\

0 & 1 & 4.1

\end{array}

\right]

\

$$

c)$$

\

\left[

\begin{array}{cc|c}

0.1 & 2.7 & 10 \\

1.0 & 0.5 & -6.0

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

1 & 0.5 & -6 \\

0.1 & 2.7 & 10

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

1 & 0.5 & -6 \\

0 & 2.7 & 11

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

1 & 0 & -8 \\

0 & 2.7 & 11

\end{array}

\right]

\

\

\left[

\begin{array}{cc|c}

1 & 0 & -8 \\

0 & 1 & 4.1

\end{array}

\right]

\

$$

d)It seems partial pivoting helps reduce round-off error as much smaller scalers in row operations are used. Each order of 10 difference will reduce the precision by one more digit, and then earlier skewed calculations will affect those after them.$$A=\left[\begin{array} {cc | c}

.1 & 2.7 & 10 \\

1.0 & 0.5 & -6 \\

\end{array} \right] $$

a) Exact solution

$$ x = -8 $$

$$ y = 4 $$

b) Two digit rounding

$$\left[\begin{array} {cc | c}

.1 & 2.7 & 10 \\

1.0 & 0.5 & -6 \\

\end{array} \right] $$

-10R1 + R2

$$\left[\begin{array} {cc | c}

.1 & 2.7 & 10 \\

0 & -27 & -110 \\

\end{array} \right] $$

.1R2+R1

$$\left[\begin{array} {cc | c}

.1 & 0 & -1 \\

0 & -27 & -110 \\

\end{array} \right] $$

Thus, simple two digit rounding results in

$$ x= -100 $$

$$ y = 4.1 $$

c) Two digit rounding with Partial pivoting

$$A=\left[\begin{array} {cc | c}

1.0 & 0.5 & -6 \\

0.1 & 2.7 & 10 \\

\end{array} \right] $$

-.1R1 + R2

$$\left[\begin{array} {cc | c}

1 & 0.5 & -6 \\

0 & 2.7 & 11 \\

\end{array} \right] $$

-5/27 R2 + R1

$$\left[\begin{array} {cc | c}

1 & 0 & -8.0 \\

0 & 2.7 & 11 \\

\end{array} \right] $$

With partial pivoting and two digit rounding we obtain

$$ x = -8.0 $$

$$ y = 4.1 $$

d) Using partial pivoting we are able to reduce the error associated with large scalar multiplication. Usually we will have more freedom than 2 digit rounding, but this demonstrates how each error can contribute to the next one, ultimately giving larger and larger magnitudes of error.