Chapter 1
Chapter 1
The main sources of errors in obtaining numerical solutions to mathematical problems are:
a. The model: To solve different problems, mathematical models are formulated to describe
them and these models do not describe them exactly and as a result errors are introduced.
b. The method (Numerical): The methods used to solve the mathematical models are often
not exact and as a consequence errors are induced.
c. The data: There may be errors in measuring or estimating values.
d. The representation of numbers: A computer has a finite word length and so only a fixed
number of digits of a number are inserted and as a consequence errors are introduced.
e. The arithmetic: Frequently errors are introduced in carrying out operations such as
addition and multiplication.
Approximations of errors
Numerically computed solutions are subject to certain errors. Mainly there are threetypes of
errors. They are inherent errors, truncation errors and errors due to rounding.
1|Page
1. Inherent errors or experimental errors arise due to the assumptions made in themathematical
modeling of problem. It can also arise when the data is obtained fromcertain physical
measurements of the parameters of the problem. i.e., errors arisingfrom measurements.
2. Truncation errors are those errors corresponding to the fact that a finite (or infinite)sequence
of computational steps necessary to produce an exact result is “truncated”prematurely after a
certain number of steps.
3. Round of errors are errors arising from the process of rounding off during computation. These
are also called chopping, i.e. discarding all decimals from somedecimals on.
Estimation of Errors
Only rarely given data are exact, since theyoriginate from measurements. Thereforethere
is usually some error in the inputinformation
Algorithm itself usually introduces errors aswell, e.g., unavoidable round-offs, etc …
The output information will then contain errorfrom both of these sources
A common question related to all numericalprocedures is how confident we are in
theproduced results?
In other words, howmuch error is present inour calculation and is it tolerable?
Accuracyrefers to how closely a computed or measured value agrees with the true value.
Precision (or reproducibility)refers to how closely individual computed or measured
values agree with each other.
Inaccuracy (or bias). A systematic deviationfrom the actual (true) value.
Imprecision (or uncertainty). Magnitude ofScatter (disperse).
Error Definitions
Numerical errors arise from the use of approximations to represent exact mathematical
operationsand quantities. These include truncation errors, which result when approximationsare
used to represent exact mathematical procedures, and round-off errors, which resultwhen
numbers having limited significant figures are used to represent exact numbers. Forboth types,
the relationship between the exact, or true, result and the approximation can beformulated as
True value = approximation + error
Absolute error and relative error
Absolute error: Is the numerical difference between the true value of a quantity and its
approximate value. i.e. if x is the true value of a quantity and ~
x is its approximate value, then the
absolute error E A is given by:
E A =|x−~
x|
Relative error: The relative error E R is defined by:
x−~
E R=
x | |
x
2|Page
E A =|x−~
20
x|= −6.666 =
3
2
3000| |
| |
20
−6.666
E R=
x−~
x | |
x
=
3
20
=
1
10000
3
1 1
E P=100 E R=100 × =
10000 100
1
Example2: three approximate values of the number are given as 0.30 , 0.33 and 0.34 . Which
3
one of the three is the best approximation?
Solution: The value with the smallest absolute error is the best approximation and therefore we
have to find the absolute errors. Let ~
x =0.30 , ~
1 x =0.33 and ~
2 x =0.34 3
1
E A = −0.30 =
3 1 |1
30 |
1
E A = −0.33 =
32 | 1
300 |
1
E A = −0.34 =
33 | 1
150 |
1 1 1
Here, < <
300 150 30
Therefore, the best approximation of the number is 0.33 .
Remark: If the number is rounded to N decimal places, then the absolute error is given by:
1
∆ x= × 10− N
2
Example: If x=0.51 and correct to two decimal places, then find the absolute error.
1 −N
Solution: ∆ x= × 10 , but in this case N=2
2
1
¿ ×10−2=0.005
2
Propagation of errors
Definition: Error propagation means that the errors in the input numbers of a process or an
operation cause the errors in the output numbers.
Let us investigate how error might be propagated in successive computations. The addition of
two numbers x and y (the true values) with the approximated values x and y , which contain
errors
e x and e y respectively. Starting with x=x+e x and y= y+e y
3|Page
x+ y=x +e x + y +e y =( x+ y )+ ( e x +e y )
The sum is
Hence, for addition, the error in the sum is the sum of the errors in the addends.
xy=( x +e x )( y+e y ) =x y +x e y + y e x +e x e y
The product is
Relative error is
xy−x y=x e y + y e x +e x e y
xy−x y x e y + y e x +e x e y x e y y e x e x e y
R xy= = = + +
xy xy xy xy xy
Furthermore, suppose that x and y are good approximations for x and y then
x
x
y
y
e e
≈1 , ≈1 and R x R y = x y ≈0
x y ( )( )
R and R y are relative errors in the approximation
( x
x and y ).
xy−x y x y
R xy = ≈ + +0=R x +R y
Thus, xy x y
This shows that the relative error in the product xy is approximately the sum of the relative error
in the approximations x and y .
Often an initial error will be propagated in a sequence of calculations. A quality that is desirable
for any numerical process is that a small error in the initial conditions will produce small changes
in the final result. An algorithm with this failure is called stable; otherwise it is called unstable.
Whenever possible we shall choose methods that are stable.
Propagated error: this is defined as an error in later steps of a program due to an earlier error.
• Propagated error is critical as errors may be magnified causing results to be invalid
• The stability of the program determines how errors are propagated
5|Page