Numerical Analysis: Lecture - 2
Numerical Analysis: Lecture - 2
Lecture -2
Muhammad Rafiq
Assistant Professor
University of Central Punjab
Lahore Pakistan
ERROR ANALYSIS
ERROR
The difference in exact and approximate values is error.
Suppose exact value of a number be = x
Approximate exact value of a number be = x
Error = x- x
Absolute error=|x- x|
Relative error=A.E/|x|
=|x- x|/|x|
Percentage relative error=R.E100%
ERROR IN ADDITION
Suppose exact value of a number be= x1
Suppose exact value of another number be= x2
Suppose approximate value of a number be= x1
Suppose approximate value of another number be= x2
Error in first number = e1=x1-x1
Error in first number=e2=x2-x2
Let Z be the sum of two numbers=Z=x1+x2
Let Z be the sum of approximate values=Z=x1 +x2
Error=ez=Z-Z
= (x1+x2) - (x1+x2)
= x1+x2- x1-x2
=(x1-x1)+(x2-x2)
ez=e1+e2
Absolute error=|ez|=|e1+e2||e1|+|e2|
And
|ez||e1|+|e2|
ERROR IN SUBTRACTION
Suppose exact value of a number be= x1
Suppose exact value of another number be= x2
Suppose approximate value of a number be= x1
Suppose approximate value of another number be= x2
|ez| |e1|+|e2|
e=1/2 10-2
e=1/2 10-4
EXAMPLE 1
If numbers in 0.3062-0.25026+2.51342 are rounded. Estimate
the maximum absolute error and relative error. Find also the
range in which true answers lies.
Solution:
Let x1=0.3062
e1=1/210-4
x2=0.25026
e2=1/210-5
x3=2.51342
e3=1/210-5
Let Z=x1-x2+x3
=0.3062-0.25026+2.51342
= 2.56936
2.56936-0.610-4 Z 2.56936+0.610-4
2.56930 Z 2.56942.
(Correct to 3d.p)
EXAMPLE 2
The values of x1 and x2 are estimated as x1=4.57+e1 and
x2=8.84+e2 where |e1|<0.35 and |e2|<0.82.Find the range in
which product lies.
Solution: Let Z=x1x2
Least value of product = (4.57-0.35)(8.48-0.82)
Exercise
Q#1
If numbers in 5.2163+1.35202-1.41265+2.14169 are rounded.
Estimate the maximum absolute error and relative error. Find
also the range in which true answers lies.
Q#2
If numbers in 3.123-2.5169+2.234-2.01267+2.1006 are
rounded. Estimate the maximum absolute error and relative
error. Find also the range in which true answers lies.