Section 7.1 Motivation
Suppose you have the following data on the population of a country:Year | 1998 | 2002 | 2003 |
Population (in millions) | 6.543 | 6.787 | 6.803 |
\begin{equation*}
p(x)=a_0+a_1 x+a_2 x^2.
\end{equation*}
(With a lower order polynomial, in general we have no solution. With a higher order one, we will have infinitely many solutions. How to choose one?) Imposing the conditions that \(p(1998)=6.543\text{,}\) \(p(2002)=6.787\) and \(p(2003)=6.803\text{,}\) we get the following system:
\begin{equation*}
\begin{pmatrix}
1&1998&1998^2\cr
1&2002&2002^2\cr
1&2003&2003^2\cr
\end{pmatrix}
\cdot
\begin{pmatrix}
a_0\cr a_1\cr a_2\cr
\end{pmatrix}
=
\begin{pmatrix}
6.543\cr 6.787\cr 6.803\cr
\end{pmatrix}
\end{equation*}
Let us ask Python the conditioning number of that matrix: Yes, it is almost \(10^{13}!\) Remember that the conditioning \(k(A)\) of a matrix \(A\) is the amplifying factor of the relative error in the right-hand-side \(b\) of the linear system \(Ax=b\text{.}\) Hence, assuming that \(b\) has an error of just 1 on its last digit, a conditioning of the order of \(10^k\) roughly causes the loss of \(k\) significant digits in the solution. In particular, with a conditioning of \(10^{13}\) and numbers in double precision, solutions would have only 3 significant digits. In single precision, none!