Skip to content

02. Errors in Computation

Dated: 14-08-2025

Computed solutions are subject to certain errors so it is useful to know about their

  • sources
  • growth

Following are these errors

Inherent Errors

These are the errors which are present in the mathematical model of the problem itself due to simplified assumptions. It can also arise when the data is obtained from certain physical measurements of the parameters of the problem.

Local round off Errors

A computer has a limited word length due to which, there's a limit to how many decimal numbers1 can be stored in a computer (in binary form). These limitations can cause errors, called round off errors.

Example

Imagine we are tasked to store

\[(0.7625)_{10} = (0.110 \overline{00011})_2\]

But the word length is limited to \(12\) bits. Therefore, the stored value in binary is \(0.110000110011\) which is equal to \(0.76245\) not \(0.7625\). Therefore, there's an error of \(0.00005\). This error is inherent with the computer system we have.

Therefore, the error is

\[\text{Error} = \text{True value} - \text{Computed value}\]

The absolute error is defined as \(|\text{Error}|\) meanwhile the relative error is defined as.

\[\text{Relative Error} = \frac{|\text{Error}|}{|\text{True value}|}\]

Local Truncation Errors

It is generally easier to expand a function2 into a power series using Taylor series3 expansion and evaluate it by retaining the first few terms.

Example

We can approximate \(f(x) = \cos(x)\) as follows:

\[ \cos (x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \dots + (-1)^n \frac{x^{2n}}{(2n)!} + \dots \]

Assume, we approximate by restraining the first \(n\) terms. This will cause the following truncation error.

\[\text{T.E.} \le \frac{x^{2n + 2}}{(2n + 2)!}\]

This error is independent of the computer used. If we want the approximation to be accurate with five significant digits then the question is how many terms are going to be included in the final result?

\[ \frac{x^{2n+2}}{(2n+2)!} < 0.5 \times 10^{-5} = 5 \times 10^{-6} \]

Taking logrithm4 on both sides, we get

\[(2n + 2) \log (x) - \log\left((2n + 2)!\right) < \log_{10} (5) - 6 \log_{10} 10 = 0.699 - 6 = -5.3\]
\[\log((2n + 2)!) - (2n + 2) \log (x) > 5.3\]

This inequality5 is satisfied for \(n = 7\). Hence, we need \(7\) terms.

\[\text{T.E.} = \frac{x^{16}}{16!}\]

References

Read more about notations and symbols.


  1. Read more about numbers

  2. Read more about functions

  3. Read more about taylor series

  4. Read more about logrithms

  5. Read more about inequalities