Linear Algebra/Topic: Accuracy of Computations/Solutions

Solutions

Problem 1

Using two decimal places, add $253$ and $2/3$ .

Sceintific notation is convienent to express the two-place restriction. We have $.25\times 10^{2}+.67\times 10^{0}=.25\times 10^{2}$ . The $2/3$ has no apparent effect.

Problem 2

This intersect-the-lines problem contrasts with the example discussed above. $\displaystyle {\begin{array}{*{2}{rc}r}x&+&2y&=&3\\3x&-&2y&=&1\end{array}}$ Illustrate that in this system some small change in the numbers will produce only a small change in the solution by changing the constant in the bottom equation to $1.008$ and solving. Compare it to the solution of the unchanged system.

The reduction

${\xrightarrow[{}]{-3\rho _{1}+\rho _{2}}}{\begin{array}{*{2}{rc}r}x&+&2y&=&3\\&&-8&=&-7.992\end{array}}$ gives a solution of $(x,y)=(1.002,0.999)$ .

Problem 3

Solve this system by hand (Rice 1993).

${\begin{array}{*{2}{rc}r}0.000\,3x&+&1.556y&=&1.569\\0.345\,4x&-&2.346y&=&1.018\end{array}}$ 1. Solve it accurately, by hand.
2. Solve it by rounding at each step to four significant digits.
1. The fully accurate solution is that $x=10$ and $y=0$ .
2. The four-digit conclusion is quite different.
${\xrightarrow[{}]{-(.3454/.0003)\rho _{1}+\rho _{2}}}\left({\begin{array}{*{2}{c}|c}.0003&1.556&1.569\\0&1789&-1805\end{array}}\right)\Longrightarrow x=10460,\,y=-1.009$ Problem 4

Rounding inside the computer often has an effect on the result. Assume that your machine has eight significant digits.

1. Show that the machine will compute $(2/3)+((2/3)-(1/3))$ as unequal to $((2/3)+(2/3))-(1/3)$ . Thus, computer arithmetic is not associative.
2. Compare the computer's version of $(1/3)x+y=0$ and $(2/3)x+2y=0$ . Is twice the first equation the same as the second?
1. For the first one, first, $(2/3)-(1/3)$ is $.666\,666\,67-.333\,333\,33=.333\,333\,34$ and so $(2/3)+((2/3)-(1/3))=.666\,666\,67+.333\,333\,34=1.000\,000\,0$ . For the other one, first $((2/3)+(2/3))=.666\,666\,67+.666\,666\,67=1.333\,333\,3$ and so $((2/3)+(2/3))-(1/3)=1.333\,333\,3-.333\,333\,33=.999\,999\,97$ .
2. The first equation is $.333\,333\,33\cdot x+1.000\,000\,0\cdot y=0$ while the second is $.666\,666\,67\cdot x+2.000\,000\,0\cdot y=0$ .
Problem 5

Ill-conditioning is not only dependent on the matrix of coefficients. This example (Hamming 1971) shows that it can arise from an interaction between the left and right sides of the system. Let $\varepsilon$ be a small real.

${\begin{array}{*{3}{rc}r}3x&+&2y&+&z&=&6\\2x&+&2\varepsilon y&+&2\varepsilon z&=&2+4\varepsilon \\x&+&2\varepsilon y&-&\varepsilon z&=&1+\varepsilon \end{array}}$ 1. Solve the system by hand. Notice that the $\varepsilon$ 's divide out only because there is an exact cancelation of the integer parts on the right side as well as on the left.
2. Solve the system by hand, rounding to two decimal places, and with $\varepsilon =0.001$ .
${\begin{array}{rcl}&{\xrightarrow[{-(1/3)\rho _{1}+\rho _{3}}]{-(2/3)\rho _{1}+\rho _{2}}}\;&\left({\begin{array}{*{3}{c}|c}3&2&1&6\\0&-(4/3)+2\varepsilon &-(2/3)+2\varepsilon &-2+4\varepsilon \\0&-(2/3)+2\varepsilon &-(1/3)-\varepsilon &-1+\varepsilon \end{array}}\right)\\&{\xrightarrow[{}]{-(1/2)\rho _{2}+\rho _{3}}}\;&\left({\begin{array}{*{3}{c}|c}3&2&1&6\\0&-(4/3)+2\varepsilon &-(2/3)+2\varepsilon &-2+4\varepsilon \\0&\varepsilon &-2\varepsilon &-\varepsilon \end{array}}\right)\end{array}}$ gives a third equation of $y-2z=-1$ . Substituting into the second equation gives $((-10/3)+6\varepsilon )\cdot z=(-10/3)+6\varepsilon$ so $z=1$ and thus $y=1$ . With those, the first equation says that $x=1$ .
$\left({\begin{array}{*{3}{c}|c}.30\times 10^{1}&.20\times 10^{1}&.10\times 10^{1}&.60\times 10^{1}\\.10\times 10^{1}&.20\times 10^{-3}&.20\times 10^{-3}&.20\times 10^{1}\\.30\times 10^{1}&.20\times 10^{-3}&-.10\times 10^{-3}&.10\times 10^{1}\end{array}}\right)$ {\begin{aligned}&{\xrightarrow[{-(1/3)\rho _{1}+\rho _{3}}]{-(2/3)\rho _{1}+\rho _{2}}}\;\left({\begin{array}{*{3}{c}|c}.30\times 10^{1}&.20\times 10^{1}&.10\times 10^{1}&.60\times 10^{1}\\0&-.13\times 10^{1}&-.67\times 10^{0}&-.20\times 10^{1}\\0&-.67\times 10^{0}&-.33\times 10^{0}&-.10\times 10^{1}\end{array}}\right)\\&{\xrightarrow[{}]{-(.67/1.3)\rho _{2}+\rho _{3}}}\;\left({\begin{array}{*{3}{c}|c}.30\times 10^{1}&.20\times 10^{1}&.10\times 10^{1}&.60\times 10^{1}\\0&-.13\times 10^{1}&-.67\times 10^{0}&-.20\times 10^{1}\\0&0&.15\times 10^{-2}&.31\times 10^{-2}\end{array}}\right)\end{aligned}} comes out to be $z=2.1$ , $y=2.6$ , and $x=-.43$ .