An archived instance of discourse for discussion in undergraduate Real and Numerical Analysis.

A linear system

mark

Solve the system
$$
\begin{align}
10^{-10}x_1 + x_2 &= 1 \\
x_1 + x_2 &= 2,
\end{align}
$$
using strict Gaussian elimination with and without pivoting. Comment on possible sources of error.






ctyra

x1 = 1 and x2 = 1 with slight error

Through Gaussian elimination x2 equals (2-(10^10))/(1-(10^10)) which is super close to 1, and x1 = 2 - x1. So x1 is roughly 1 as well.

sgerall

The system can be rewritten in the form $Ax = b$ such that matrix $A$ is the coefficients of $x_1$ and $x_2$, $x$ is $x_1$ and $x_2$ and b is comprised of the solutions, $1$ and $2$. Thus, it would look like this:

$$ A =
\left(
\begin{matrix}
10^{−10} & 1 \\
1 & 1
\end{matrix}
\right)
+
\left(
\begin{matrix}
x_1 \\
x_2\\
\end{matrix}
\right)
=
\left(
\begin{matrix}
1 \\
2\\
\end{matrix}
\right).
$$
This can be rewritten in augmented form with the terms flipped so that it is in upper triangular form (note $10^-10$ is close to zero--this is a possible source of error).
$$\left(
\begin{matrix}
1 & 1 & | & 2 \\
10^{-10} & 1 & | & 1\\
\end{matrix}
\right).
$$




























Therefore:
$$ x_1 + x_2 = 2
and
x_2 = 1$$


So, we can easily see, $$ x_1 = 2
and
x_2 = 1$$

Though, I think the claim that $10^{-10}$ is close to $zero$ may be too strong, so this answer may be incorrect.

amccann1

Strict Gaussian Elimination without swapping rows

$$\begin{bmatrix}
10^{-10} & 1 & 1 \\
1 & 1 & 2 \\
\end{bmatrix}$$


Row reduce to upper triangular

$$\begin{bmatrix}
10^{-10} & 1 & 1 \\
0 & 1-10^{-10} & 2-10^{-10} \\
\end{bmatrix}$$


Back substitution

$$x2 = 2-10^{-10}/1-10^{-10}$$
and
$$x1 = -1/10^{-10}$$

with $$10^{-10}$$ being so close to zero this creates a nasty results

With swapping rows

$$\begin{bmatrix}
1 & 1 & 2 \\
10^{-10} & 1 & 1 \\
\end{bmatrix}$$


Row reduce to upper triangular

$$\begin{bmatrix}
1 & 1 & 2 \\
0 & 1-10^{-10} & 1-2(10^{-10}) \\
\end{bmatrix}$$


Back substitution

$$x2 = 1-2(10^{-10})/1-10^{-10}$$
and
$$x1 = 1$$

mark

@amccann1 is closest, but having a little trouble with the the typesetting, I think.

Here's the key issue: You've got to solve the system exactly. Using straight Gaussian elimination without changing the order of the rows, I get:
$$\begin{align}
x_1 &= 10^{10}\left(1-\frac{2-10^{10}}{1-10^{10}}\right) \\
x_2 &= \frac{2-10^{10}}{1-10^{10}}
\end{align}.$$
Using Gaussian elimination after a change in the order of the rows I get
$$\begin{align}
x_1 &= 2-\frac{2-10^{10}}{1-10^{10}} \\
x_2 &= \frac{2-10^{10}}{1-10^{10}}
\end{align}.$$








You should be able to verify both these computations. Also, note that the expressions are algebraically equivalent. One of them yields a better numerical approximation when evaluated on a computer, however. The questions are which and why?

gbrock

I don't mean to sound like a genius, but the second one is better. However, the reason for this is too big to fit in a comment box.

NateRicks

Im confused. I ended up getting x1=10^10/(10^10-1) and x2=(10^10-2)/(10^10-1) without changing the order of the rows and wolframalpha even agrees with my solution.