Professional Documents
Culture Documents
1456308539E textofChapter1Module1
1456308539E textofChapter1Module1
1456308539E textofChapter1Module1
by
Dr. Anita Pal
Assistant Professor
Department of Mathematics
National Institute of Technology Durgapur
Durgapur-713209
email: anita.buie@gmail.com
.
Chapter 1
Numerical Errors
Module No. 1
Two major techniques are used to solve any mathematical problem − analytical and
numerical. The analytical solution is obtained in a compact form and generally it is free
from error. On the other hand, numerical method is a technique which is used to solve
a problem with the help of computer or calculator. In general, the solution obtained by
this method contains some error. But, for some class of problems it is very difficult to
obtain an analytical solution. For these problems we generally use numerical methods.
For example, the solutions of complex non-linear differential equations cannot be de-
termined by analytical methods, but these problems can easily be solved by numerical
methods. In numerical method there always be a scope to occur errors and hence it
is important to understand the source, propagation, magnitude, and rate of growth of
these errors.
To solve a problem with the help of computer, a special method is required and
this method is known as numerical method. Analytical methods are not suitable to
solve a problem by computer. Thus, the numerical methods are highly appreciated and
extensively used by scientists and engineers.
Let us discuss sources of error.
It is well known that the solution of a problem obtained by numerical method contains
some errors. But, our intension is to minimize the error. To minimize it, the most
essential thing is to identify the causes or sources of the error. Three sources of errors,
viz. inherent errors, round-off errors and truncation errors occur to find a solution of a
problem by using numerical method. They are discussed below.
(i) Inherent errors: These type of errors occur due to the simplified assumptions
made during mathematical modelling of the problem. These errors also occur when the
data is obtained from certain physical measurements of the parameters of the proposed
problem.
(ii) Round-off errors: Generally, the numerical methods are performed using com-
puter. In numerical computation, all the numbers are represented as decimal fraction.
Again, a computer can store finite number of digits for a number. Some numbers viz.
1/3, 1/6, 1/7 etc. can not be represented by decimal fraction in finite numbers of digits.
1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Errors in Numerical Computations
Thus, to represent these numbers some digits must be discarded and hence the numbers
should be rounded-off into some finite number of digits. So in arithmetic computation,
some errors will occur due to the finite representation of the numbers; these errors are
called round-off errors. These errors depend on the word length of the used computer.
(iii) Truncation errors: These errors occur due to the finite representation of an
inherently infinite process. These types of errors are explained by an example. Let us
consider the cosine series.
The Taylor’s series expansion of cos x is
x2 x4 x6
cos x = 1 − + − + ··· .
2! 4! 6!
This is well known that this series s infinite. If we consider the first five terms to
calculate the value of cos x for a given x, then we obtained an approximate value. The
error occurs due to the truncation of the remaining terms of the series and it is called
the truncation of error.
Note that the truncation error is independent of the computational machine.
It may be noted that same number may be exact as well as approximate. For ex-
ample, the number 3 is exact when it represents the number of rooms of a house and
approximate when it represents the number π.
The accuracy of a solution is defined in terms of number of digits used in the com-
putation. The significant digits or significant figures of a number are all its digits,
except for zeros which appear to the left of the first non-zero digit. But, the zeros at
the end of a number are always significant digit. The numbers 0.000342 and 8921.2300
have 3 and 8 significant digits respectively.
Some times we need to cut off usable digits. The number of digits to be cut off depends
on the problem. This process to cut off digits from a number is called rounding-off
of numbers. That is, in rounding process the number is approximated to a very close
number consisting of a smaller number of digits. In that case, one or more digits are
kept with the number, taken from left to right, and all other digits are discarded.
Rules of rounding-off
(i) If the discarded digits constitute a number which is larger than half the unit in the
last decimal place that remains, then the last digit that is left is increased by one.
If the discarded digits constitute a number which is smaller than half the unit in
the last decimal place that remains, then the digits that remain do not change.
(ii) If the discarded digits constitute a number which is equal to half the unit in the
last decimal place that remains, then the last digit that is half is increased by one,
if it is odd, and is unchanged if it is even.
This rule is often called a rule of an even digit.
In Table 1.1, we consider different cases to illustrate the round-off process. In this
table the numbers are rounded-off to the six significant figures. But, computer kept
more number of digits during round-off. It depends on the computer and the type of
the number declared in a programming language.
Note that the round-off numbers contain errors and this errors are called round-off
errors.
3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Errors in Numerical Computations
Absolute error:
Let xA be the approximate value of the exact number xT . Then the absolute error is
denoted by (∆x) and satisfies the relation
∆x ≥ |xT − xA |.
Note that the absolute error is the upper bound of the difference between xT and
xA . This definition is applicable when there are many approximate values of the exact
number xT . Otherwise, ∆x = |xT − xA |.
4
......................................................................................
Also, the exact value xT lies between xA − ∆x and xA + ∆x. It can be written as
xT = xA ± ∆x. (1.1)
Note that the absolute error measures the total error and hence this error measures
only the quantitative side of the error. It does not measure the qualitative, i.e. how
much the measurement is accurate. For example, the length and the width of a pond
are determined by a tape in meter. Suppose that width w = 50 ± 2 m and the length
l = 250 ± 2 m. In both the measurements the absolute error is 2 m, but it is obvious
that the second measure is more accurate.
To determine the quality of measurements, we introduced a new concept called rela-
tive error.
Relative error:
The relative error is denoted by δx and is defined by
∆x ∆x
δx = or , |xT | 6= 0 and |xA | 6= 0.
|xA | |xT |
This expression can also be written as
xT = xA (1 ± δx) or xA = xT (1 ± δx).
Note that the absolute error is the total error when whole thing is measured, while
relative error is the error when we measure 1 unit. That is, the relative error is the error
per unit measurement.
2 2
In case of above example, the relative errors are δw = 50 = 0.04 and δl = 250 =
0.008. Thus, the second measurement is more accurate.
In general, the relative error measures the quantity of error and quality of the mea-
surement. Thus, the relative error is a better measurement of error than absolute error.
Percentage error:
The relative error is measured in 1 unit scale while the percentage error is measured
5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Errors in Numerical Computations
in 100 unit scale. The percentage error is measured by δx × 100%. This error is
sometimes called relative percentage error. Percentage error measures both the
quantity and quality. Generally, when relative error is very small then the percentage
error is determined.
Note that the relative and percentage errors are free from the unit of measurement,
while absolute error depends on the measuring unit.
1
Example 1.1 Find the absolute, relative and percentage error in xA when xT = and
7
xA = 0.1429.
Solution. The absolute error
1 1 − 1.0003
∆x = |xT − xA | = − 0.1429 =
7 7
0.0003
= = 0.000043 rounding up to two significant figures.
7
The relative error
∆x 0.000043
δx = = = 0.000329 ' 0.0003.
xT 1/7
The percentage error is δx × 100% = 0.0003 × 100% ' 0.03%.
Example 1.2 Find the absolute error and the exact number corresponding to the ap-
proximate number xA = 7.543. Assume that the percentage error is 0.1%.
Example 1.3 Suppose two exact numbers and their approximate values are given by
17 √
xT = ' 0.8947 and yT = 71 ' 8.4261.
19
Find out which approximation is better.
Solution. To find the absolute error, we take the numbers xA and yA with a larger
√
number of decimal digits as xA ' 0.894736 · · · , yA = 71 ' 8.426149 · · · .
Therefore, the absolute error in xT is ∆x = |0.894736 · · · − 0.8947| ' 0.000036,
and ∆y = |8.426149 · · · − 8.4261| ' 0.000049.
6
......................................................................................
A decimal integer can be represented in many ways. For example, the number 7600000
can be written as 760 × 104 or 76.0 × 105 or 0.7600000 × 107 . Note that each number has
two parts, the first part is called mantissa and second part is called exponent. In last
form, the mantissa is a proper fraction and first digit after decimal point is non-zero.
This form is known as normalize form and it is commonly used in computer.
Every positive decimal number a can be expressed as
where di are the digits constituting the number (i = 1, 2, . . .). The digit d1 6= 0 and
10m−i+1 is the value of the ith decimal place starting from left.
Let dn be the nth digit of the approximate number x. This digit is called valid
significant digit (or simply a valid digit) if it satisfies the following condition
If the inequality of (1.3) does not satisfied, the digit dn is said to be doubtful. If dn
is a valid digit then all the digits preceding to dn are also valid.
Theorem 1.1 If a number is correct up to n significant figures and the first significant
digit is k, then the relative error is less than
1
.
k × 10n−1
Proof. Let xA and xT be the approximate and exact values. Also, assume that xA is
correct up to n significant figures and m decimal places. There are three cases arise:
(i) m < n
(ii) m = n and
(iii) m > n.
7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Errors in Numerical Computations