Chapter 01
Error Analysis
Shirin Sultana
Assistant Professor
Department of CSE
Daffodil International University,
Ashulia, Dhaka, Bangladesh.
Numerical Error
If we want to solve,
2 25
2.9 Exact Value Approximate Value
5 10
25 12
1.61752136752 For our convenience we may write 1.6175
36 13
In the second calculation, calculated value is 1.61752136752 (Exact value) but we
write 1.6175 (Approximate value).
So the Error occurred here, 1.61752136752- 1.6175=0.00002136752.
Finally, The error of a quantity is the difference between it’s true value and
approximate. It is denoted by E. If the true value is 𝑿 and approximate value is 𝒙
then the error of the quantity is given by,
E X x 2
The absolute error of a quantity is the absolute
Different Types of Error
value of the difference between the exact value and
Absolute error the approximate value. It is denoted by E A . If the
exact value is X and approximate value is x, the
Relative error absolute error is define by, EA X x
Percentage error
The relative error of a quantity is the ratio of its
absolute error to its exact Evalue. It is denoted by ER ,
ER A
X
The percentage error of a quantity is 100 times of its relative
error. It is denoted by EP ,
EP 100 ER
3
Problem: An approximate value of is 3.1428571 and true value is 3.1415926. Find the absolute,
relative and percentage errors.
Solution: We have, true value X 3.1415926 and approximate value x 3.1428571
The absolute error is, E A X x 3.1415926 3.1428571
0.0012645 0.0012645
EA 0.0012645
The relative error is, ER 0.000402
X 3.1415926
The percentage error is, E p 100ER 100 0.000402 0.0402
4
Round off Error
When a calculator or digital computer is used to perform numerical calculations, an
unavoidable error, called round-off error, must be considered. A round-off error, also
called rounding error, is the difference between the calculated approximation of a
number and its exact mathematical value due to rounding.
1
For example, a number like may be represented as 0.333333 on a PC. Then the
3
1
round off error in this case is − 0.333333 = 0.00000033ത . Then there are
3
other numbers that cannot be represented exactly. For example, 𝜋 and 2 are
numbers that need to be approximated in computer calculations.
1 −𝑁
Formula: If the number P is rounded to N decimal place then 𝐸𝐴 = (10 )
2
5
Problem: Find the absolute, relative and percentage errors of the number
8.2546 if this number rounded up to two decimal places.
Solution: The given number is 𝑃 = 8.2546
Since the given number rounded up to two decimal places so 𝑁 = 2
The absolute error is,
1
𝐸𝐴 = 10−2 = 0.005 (i.e, exact value 𝑋 = 8.25)
2
Given number is 𝑃 = 8.2546, if we write this
The relative error is, number as, 8.2541 then error will be,
𝐸𝐴 0.005 E=8.2546-8.2541=0.0005
𝐸𝑅 = = = 0.00060606061
𝑋 8.25 From the error we can say, as long
as there is zero there is no mistake
that is exact.
The percentage error is,
𝐸𝑃 = 100𝐸𝑅 = 100 × 0.00060606061 = 0.060606061%
6
Significant Digits 5 decimal places
5.21432
But the significant digits are 6
Example:
5.609 has 4 significant digits.
700.0879 has 7 significant
Example:
digits.
456 has 3 significant digits
68.29 has 4 significant digits
Some rules to Example:
Example:
0.067 has 2 significant digits
identify the 12.2300 has six significant
0.000008 has 1 significant significant figures
0.000122300 still has only six
digit numbers significant figures
Zeros before Zeros behind Zeros between
Every non-zero
non-zero digits non-zero digits non-zero digits
digit is
are never are sometimes are always
significant
significant significant significant
7
Problem: Evaluate the sum 𝑺 = 𝟐 + 𝟑 + 𝟓 to 𝟒 significant digits and also
find its absolute, relative and percentage errors.
Solution: For the 𝟒 significant digits we may write
𝟐 = 𝟏. 𝟒𝟏𝟒, Rounded up to 3 decimal places, so for N=3
√𝟑 = 𝟏. 𝟕𝟑𝟐, Rounded up to 3 decimal places, so for N=3
𝟓 = 𝟐. 𝟐𝟑𝟔, Rounded up to 3 decimal places, so for N=3
sum , 𝑺 = 𝟏. 𝟒𝟏𝟒 + 𝟏. 𝟕𝟑𝟐 + 𝟐. 𝟐𝟑𝟔 = 𝟓. 𝟑𝟖𝟐
Since the values of 𝟐, 𝟑 and 𝟓 all are rounded to three decimal places,
so for all values 𝑵 = 𝟑.
8
Now the absolute error is,
𝟏 −𝟑 𝟏 −𝟑 𝟏 −𝟑
𝑬𝑨 = 𝟏𝟎+ + 𝟏𝟎 (𝟏𝟎 )
𝟐 𝟐 𝟐
= 𝟎. 𝟎𝟎𝟎𝟓 + 𝟎. 𝟎𝟎𝟎𝟓 + 𝟎. 𝟎𝟎𝟎𝟓
= 𝟎. 𝟎𝟎𝟏𝟓
The absolute error shows that the sum is correct to two decimal places only.
So we take exact value 𝑿 = 𝟓. 𝟑𝟖
The relative error is,
𝑬𝑨 𝟎.𝟎𝟎𝟏𝟓
𝑬𝑹 = = = 𝟎. 𝟎𝟎𝟎𝟐𝟖
𝑿 𝟓.𝟑𝟖
The percentage error is,
𝑬𝑷 = 𝟏𝟎𝟎𝑬𝑹 = 𝟏𝟎𝟎 × 𝟎. 𝟎𝟎𝟎𝟐𝟖 = 𝟎. 𝟎𝟐𝟖%
9
Practice Work
𝟏
1) Three approximations of the number are given as 0.32, 0.33 and 0.34. Find the best
𝟑
approximation among the three.
2) Evaluate the sum 𝑺 = √𝟑 + √𝟓 + √𝟕 + √𝟏𝟏 to 𝟔 significant digits and find its
percentage error, absolute error, relative error?
3) Find the absolute, relative and percentage errors of the number 5.2356 if 4 significant digits
are correct.
4) Evaluate the sum S = √𝟏𝟏 + √𝟐𝟏 + √𝟑𝟏 to 5 significant digits and find its E A , E R , E P ?
5) Find the absolute, relative and percentage errors of the number 0.3576 if 2 significant digits
are correct.
10