% LaTEX file of chapter 1 of the computing in finance notes.
% It was written starting January 20, 1996, by Jonathan Goodman (see the
% author line below). Goodman retains the copyright to these notes.
% He does not give anyone permission to copy the computer files related
% to them (the .tex files, .dvi files, .aux files, .ps files, etc.).
% If you want a copy of these notes, ask Jonathan Goodman. His email
% address on the internet is goodman@cims.nyu.edu.
\documentstyle[12pt]{article}
% Somewhat wider and taller page than in art12.sty
\topmargin -0.1in \headsep 0in \textheight 8.9in \footskip 0.6in
\oddsidemargin 0in \evensidemargin 0in \textwidth 6.5in
% Definitions of commonly used symbols.
\begin{document}
\title{Sources of Error}
\author{Jonathan Goodman}
\maketitle
{\scriptsize
\noindent
These are course notes for Scientific Computing, given
Spring 1996 at the Courant Institute of Mathematical
Sciences at
New York University by Jonathan Goodman. Professor
Goodman retains the copyright to these notes. He does not give
anyone permission to copy computer files related to them.
Send email to goodman@cims.nyu.edu.
}
\vspace{1cm}
In numerical computing we never expect to get the {\em exact}
answer.\footnote{This is almost the definition of numerical computation.
Computations that aim for the exact answer, such as symbolic algebraic
manipulation or prime factorization of large integers, are often called
``non numerical''.}
There are three basic sources of error: roundoff error, truncation
error, and statistical error. Roundoff error arises from the fact
that computer arithmetic is not exact. If we know $x$ and $y$ and write
\begin{displaymath}
\mbox{\tt z = x + y}
\end{displaymath}
then the computed $z$ will usually not be exactly the sum of $x$
and $y$. Exactly what $z$ will be is discussed when we cover IEEE arithmetic.
Truncation error arises from the use of approximate formulas, such as
\begin{displaymath}
f^{\prime}(x) \approx \left( f(x+h) - f(x) \right) / h \;\; ,
\end{displaymath}
that are not exact ``even in exact arithmetic''. Some computations,
particularly in linear algebra, have no truncation error. In most
computations that have truncation error, the truncation error is
much larger than roundoff error. Also, as will become clear throughout
the course, much more can be done to reduce truncation error than
roundoff error. For these reasons, most scientific computing
courses (including this one) spend more time analyzing truncation
error than roundoff error. Statistical error arises only in Monte-Carlo computations.
Often, inaccuracy in a computed answer is very large compared to the
size of roundoff, truncation, or statistical error introduced
during the computation. This is because error can be amplified during
the stages of the computational algorithm. Such error amplification is
inevitable
if the problem being solved is {\em ill conditioned}. An ill conditioned
problem is one in which the answer is so sensitive to the input parameters
that no computational algorithm could would be expected to give an
accurate approximation to it. However, even
well conditioned problems may have solution
algorithms that are {\em unstable}. To get an accurate answer, the
problem being solved must be well conditioned (this may be out of
the hands of the person trying to solve the problem) and the
solution algorithm must be stable.
It is important to be aware of the possibility of inaccuracy via
error amplification because this source of error is hardest to
discover by standard debugging techniques. In a large calculation,
the error may grow a seemingly negligible amount at each step but
grow to swamp the correct answer by the time the computation is
finished. One of the main uses of mathematical analysis in scientific
computing is in understanding the conditioning of problems and the
stability of algorithms.
\end{document}