CHAPTER -1
ERROR
INTRODUCTION
Numerical technique is widely used by scientists and engineers to solve their problems.
Analytical methods have certain limitations in practical applications. Exact solutions are not
possible. A major advantage for numerical technique is that a numerical answer can be obtained
even when a problem has no analytical solution. However, result from numerical analysis is an
approximation, in general, which can be made as accurate as desired. The dependability of the
numerical result will depend on an error estimate or bound, therefore the analysis of error and the
sources of error in numerical methods is also a critically important part of the study of numerical
technique.
1.1 Accuracy Of Numbers
There are two types of numbers, exact and approximate.
a) Exact number: Number with which no uncertainly is associated, to no approximation is
taken, are known as exact number. For example 5, 21/6, 12/3, ….
b) Approximate number: There are numbers, which can't expressed by a finite number of
digits. Numbers which represent the exact numbers to a certain degree of accuracy is
called approximate numbers. For instance √2 =1.41421 ...,e=2.7183 ....,e.t.c are not
exact numbers since they contain infinitely many non-terminating digits. Therefore the
numbers obtained by retaining a few digits, are called approximates numbers, e.g., 3.142,
2.718 are the approximate values of and e.
c) Significance figure: Significant figures are digits used to express a number. The digits 1,
2, 3, 4, 5, 6, 7, 8, 9 are significant digits. ‘0’ is also a significant figure except when it is
used to fix the decimal point or to fill the places of unknown or discarded digits.
For example, each number 5879, 3.487, 0.4762 contains four significant figures while the
numbers 0.00486, 0.000382, 0.0000376 contains only three significant figures since zeros only
help to fix the position of the decimal point. Similarly, in the number 0.0002070, the first four
‘0’s are not significant figure since they serve only to fix the position of decimal point and
indicate the place values of the other digits. The other two ‘0’s are significant.
Haileyesus T.,
T., University of Gondar Page 1
Some example to be clearer, the number 2.0683 contains five significant figures.
2300 two
23.0 two
6
2.3 ×10 two
d) Round off: If we divide 2 by 7, we get 0.285714... a quotient which is a non-terminating
decimal fraction. For using such a number in practical computation, it is to be cut-off to a
manageable size such as 0.29, 0.286, 0.2857,.... etc. The process of cutting off super-flouts digits
and retaining as many digits as desired is known as rounding off a number or we can say that
process of dropping unwanted digits is called rounding-off.
Rule to rounded-off a Numbers:
To round-off the number to n significant figures, discard all digits to the right of nth digit
and if this discarded number is
i) Less than 5 in (n+ 1)th place, leave the nth digit unchanged e.g., 8.893 to 8.89.
ii) Greater than 5 in (n+ 1)th place, increase the nth digit by one e.g.,5.3456 to 5.346.
iii) Exactly 5 in (n+ 1)th place, increase the nth digit by unity if it is odd otherwise leave it
unchanged. e.g., 11.675 to 11.68, 11.685 to 11.68.
EXAMPLE: Round-off the following numbers correct to four significant figures:
i) 28.3643 iv) 23.395
ii) 179.267 v) 0.065738
iii) 0.7265 vi) 452685300.
SOLUTION: After retaining first four significant figures we have:
(i) 28.3643 becomes 28.36
(ii) 179.267 becomes 179.3
(iii) 0.7265 becomes 0.726 (digit in the fourth place is even)
(iv) 23.395 becomes 23.40 (digit in the fourth place is odd)
(v) 0.065738 becomes 0.06574 (because zero in the left is not significant)
(vi) 452685300 becomes 4527 ×105.
Haileyesus T.,
T., University of Gondar Page 2
ERRORS
In general, we can say that
Error= True value– Approximate value
Sources of Error
Numerical results are affected by many types of errors. Some sources of error are
i) Errors in Given Input Data.
Input data can be the result of measurements which have been contaminated by different types of
errors.
Rounding Errors during the Computations
A rounding error occurs whenever an irrational number, for example π, is shortened (“rounded
off”) to a fixed number of digits, or when a decimal fraction is converted to the binary form used
in the computer.
ii) Truncation Errors
A truncation error occurs, for example, when an infinite series is broken off after a finite number
of terms, or when a derivative is approximated with a difference quotient (although in this case
the term discretization error is better). Another example is when a nonlinear function is
approximated with a linear function.
iii) Simplifications in the Mathematical Model
iv) “Human” Errors and Machine Errors
In all numerical work, one must expect that clerical errors, errors in hand calculation, and
misunderstandings will occur.
Generally the errors may be divided into the following different types:
i) Inherent error: The inherent error is that quantity which is already present in the
statement of the problem before its solution. The inherent error arises either due to the
simplified assumptions in the mathematical formulation of the problem or due to the
errors in the physical measurements of the parameters of the problem.
ii) Round-off error: The round-off error is the quantity, which arises from the process
of rounding off numbers. Also round off denote a quantity, which must be added to
the finite representation of a compound number in order to make it the true
representation of that number. The round-off error can be reduced by carrying the
computation to more significant figures at each step of computation.
Haileyesus T.,
T., University of Gondar Page 3
iii) Truncation error: These types of errors caused by using approximate formula in
computation or on replace an infinite process by a finite one that is when a function
f(x) is evaluated from an infinite series for x after ‘truncating’ it at a certain stage, we
have this type of error.
For instance, if X=ex=1+x+ + + ….. is replaced by 1+x+ + = .
! ! ! !
Then the truncation error is
X- = + + +…
! ! !
1.5Absolute and Relative Errors
a) Absolute error: Absolute error is the numerical difference between the true value of a
quantity and its approximate value. Thus if is the approximate value of quantity x then
| − | is called the absolute error and denoted by . Therefore
= | − |
The unit of exact or unit of approximate values expresses the absolute error.
b) Relative error: The relative error , defined by
= =
Where is the approximate value of quantity x. The relative error is independent of units.
c) Percentage error: The percentage error in which is the approximate value of x is
given by
= 100X = 100X
The percentage error is also independent of units.
EXAMPLE : Find the absolute, percentage and relative errors if X is rounded-off to three
decimal digits. Given X = 0.005998.
SOLUTION: If X is rounded-off to three decimal places we get xa= 0.006. Therefore
Error = True value – Approximate value
Error =0.005998 – 0.006 = – 0.000002
Absolute Error = Ea= || =0.000002
.
Relative Error = = = = = 0.0033344
. ""# . ""#
= 100X = 100X = 100X0.0033344 =0.3344
Haileyesus T.,
T., University of Gondar Page 4
EXAMPLE : Three approximate values of number 1/3 are given as 0.30, 0.33 and 0.34.
Which of these three is the best approximation?
SOLUTION: The number, which has least absolute error, gives the best approximation.
%
True value X = =0.33333
When approximate value is 0.30 the Absolute Error is given by:
= | − | =|0.33333 − 0.30| = 0.03333
When approximate value is 0.33 the Absolute Error is given by:
= | − | = |0.33333 − 0.33| = 0.00333
When approximate value is 0.34 the Absolute Error is given by:
= | − | = |0.33333 − 0.34| = 0.00667
Here absolute error is least when approximate value is 0.33. Hence 0.33 is the best
approximation.
RULES: If Xa is the approximate value of X correctly rounded off to n decimal places then
,
|X − X *| ≤ x 10/
-
EXAMPLE : If X=8/9 and the exact decimal representation of X is 0.888. find the absolute error
using an appropriate rule when it is rounded-off to three decimal digits.
SOLUTION: We have X=8/9, n= 3
The decimal representation of X rounded-off to three decimal digits is x= 0.889
Then
# # ##"
Ea = − 0.889 = −
" " %
# # %
=
"
%
= "
, ,
≤ x 10 [ by rule 1 ]. Therefore, Ea = ≤ x 10
- -
1.6 GENERAL FORMULA FOR ERROR
Let X=f(% , , … , 4 ) be the function having n variables. To determined the error δX in X due to
the errors δ% , δ , … , δ4 in % , , … , 4 respectively.
X+ δX= f(% +δ% , 6 δ , … , 4 + δ4 ) …………(1)
Haileyesus T.,
T., University of Gondar Page 5
Using Taylor’s series for more than two variables, to expand the R.H.S. of above equation, we
get
7 7 7 % 7< 7<
X+ δX = f(% , , … , 4 )+( δ% +δ% +…+δ% )+ [(δ% ) +(δ )
+
78 7 79 78 7
7<
………….+(δ4 ) ]+…………………… …….(2)
79
Errors δ% , δ , … , δ4 all are small so that the terms containing (δ% ) , (δ ) ,…, (δ4 )
and higher powers of δ% , δ , … , δ4 are being neglected.
Therefore
7 7 7
x+ δx = f(% , , … , 4 )+( δ% +δ% +…+δ% ) ……..(3)
78 7 79
Since X=f(% , , … , 4 ),we have
7 7 7
δX = δ% +δ +…+δ4 …………(4)
78 7 79
Eq.(4) represents the general formula for Errors. If eq.(4) divided by X we get
relative error
δ= δ>8 ?= δ> ?= δ>@ ?=
Er= = + + ……..+
78 7 79
On taking modulus both of the sides, we get maximum relative error
δ>8 ?= δ> ?= δ>@ ?=
≤ + +……+ ,
δ=
78 7 79
Also from equation (2), by taking modulus we get maximum absolute error.
7 7 7
|δX| ≤ δ% +δ 7 +……+δ4 7
78 9
> A
EXAMPLE: If u= and the errors in x,y,z be 0.001.compute the relative maximum error in
B
u when x=y=z=1.
7E 7E 7E
SOLUTION: We know CD = C + CF + CH
7 7G 7B
7E #>A 7E %> A 7E %> A
Since = , = , =
7 B 7G B 7B B
Also the errors C, CF, CH may be positive or negative, therefore absolute values of terms on
R.H.S is,
#>A %> A %> A
|CD|= C + CF + CH
B B B
=8(0.001)+12(0.001) +16(0.001) = 0.036
Also the maximum relative error is
Haileyesus T.,
T., University of Gondar Page 6
IE .
Er = E =
=0.009 where u=4 at x=y=z=1
EXAMPLE: The allowable error in r and h is 0.12% and 0.505% when r=4.5cm and h=5.5cm
J
respectively, find the percentage error in R where R=J + .
SOLUTION: Here we have
7L 7L
δR =δ 7 + δh 7J
7L 7L %
= and = +
7 J 7J J
NO
The percentage error in r = X100 = 0.12
%
⇒ δr = (0.12) X 4.5= 0.0054
%
NR
The percentage error in h = J
X100 = 0.505
%
⇒ δh =% (0.505) X 5.5= 0.028
Now
7L 7L
δR =δ 7 + δh 7J
. (.)
=(0.0054) + (277.75)[ + 0.5]
. (.)
= (0.0054)(0.8182)+ (0.028)(20.0868) = 0.00441828+ 0.5624304= 0.5668
Therefore the percentage error in R is
NW
Ep = L
X 100
.# .#
= ( .) .
X 100 = X 100 = 0.2 %
[ 6 ] ."%
(.)
1.8 ERROR IN SERIES APPROXIMATION
The error committed in a series approximation can be evaluated by using the remainder after n
terms. Taylor’s series for f(x) at x = a is given by,
( ) ( ) ( )9X8 (n-1)
f(x) =f(a) +(x-a)f'(a) + f''(a) + f'''(a)+………..+ f (a) +Rn(x)
! ! (4%)!
( )9 (n)
Where Rn(x) = f (Y) ;a< Y <x.
(4)!
This term Rn(x) is called remainder term and for a convergent series it tends to zero as n→∞.
Thus if we approximate f(x) by the first n terms of a series then maximum error committed in
Haileyesus T.,
T., University of Gondar Page 7
this approximation is given by the Rn(x) and if accuracy required is already given then it is
possible to find the number of terms n such that the finite series yields the required accuracy.
EXAMPLE : The Maclaurin’s expansion for ex is given by
(9X8) 9
ex =1+x + !
+ !
+……….+ (4%)! + 4!
Z [ ,0< Y < x
Find the number of terms, such that their sum yields the value of ex correct to 8 decimal places at
x = 1.
(9X8) 9
SOLUTION: Given that ex =1+x + + +……….+ + Z [ ,0< Y < x
! ! (4%)! 4!
Then the remainder term is,
9
Rn(x) = Z[
4!
When Y =x gives a maximum absolute error
9
Ea(max) = Z
4!
And the maximum relative error
\*(]*>) 9
Er(max) = =
^_ 4!
%
Hence at x =1, Er(max) = 4!
% %
For an 8 decimal accuracy at x= 1, 4! <x10-8 ⇒ n=12
Hence we have 12 terms of the expansion in order that its sum is correct to 8 decimal places.
EXAMPLE : The function f(x) = tan–1x can be expanded as
9X8
tan-1(x) = x- + -…………+(−1)4% +-------
4%
Find n such that series determines tan–1(1) correct to eight significant digits.
9`8
SOLUTION: If we retain n terms then (n+ 1)th term = (−1)4
46%
(%)9
For x=1,(n+1)th term = 46%
–1
To determine a tan (1) correct up to eight significant digits,
(%)9 %
46% < x10-8 ⇒ 2n+1> 2x108 ⇒ n=108+1
Haileyesus T.,
T., University of Gondar Page 8