Chapter 1 NM
Chapter 1 NM
Numerical Analysis I
Math ___
Chapter 1
Numerical Error Analysis
Contents:
1.1 Why Numerical Methods?
1.2 Sources of error
1.3 Classification of errors
Round off error
Truncation error
1.4 Representation and Approximation of Numbers
Floating point representation
Chopping and Rounding
1.5 Measurement of errors
Absolute error
Relative error
Percentage error
Mathematics is used to understand and describe real world problems. The process of
representing physical systems in mathematical form is called Mathematical modeling.
Mathematical models are an integral part in solving engineering or scientific problems. Many
times, these mathematical models are derived from engineering and science principles, while
at other times the models may be obtained from experimental (discrete) data.
Mathematical models generally result in need of using the most common mathematical
forms:-
There are two general methods of solving these mathematical modeling forms:
Analytical Methods (Exact solution methods)
Numerical Methods (Approximate solution methods)
In practical application, a researcher would finally obtain results in a numerical form. And,
during manipulation or calculation of these numerical forms, errors will arise.
b) The Data:- There may errors in measuring, estimating and collecting data values.
c) The Methods:- the numerical methods used to solve mathematical models are not exact,
generally based on some approximation and as a consequence errors arise.
d) Computational Tools:- tools like calculator and computer represent numbers in a limited
2
space, thus errors are induced. For example, the numbers π , , √ 3 cannot be represent
3
exactly by a finite number of digits in a computer. And they are approximated by a given
number of digits.
e) Arithmetic and logical Operations:- Frequently, errors are introduced in carrying out
arithmetic and logical operations (missing the precedence of the operations). For example;
Simplify the expression 8−4 × 4−4 ÷ 2−3.
How computers understand the logical relationship p ⟹ q ⋀ r ??
b) Truncation error:- are errors caused by using approximate methods in place of an exact
mathematical procedure. That is, an error which is present when an infinite process is
approximated or truncated by a finite process.
1 1 1
For example, If S=1+ + 2 + 3 +… , then we may approximate S by truncating
x x x
the series after some terms, say Sn .
1 1 1 1
i.e S ≈ S n=1+ + 2 + 3 +…+ n . Here an error, called truncation error is
x x x x
introduced.
Note: Truncation errors can be reduced by retaining more terms in the process.
For example, 2.1596 , 0.55557∧3.0087 have five significant digits. But, 0.0087 has only two
significant digits 8∧7 only [NB: zeroes serve only to fix the position of the decimal point].
Since a digital computer or calculator has a fixed storage space of memory, a given number in a
certain base must be represented in a finite space. We usually represent a number in decimal
form (base 10). Thus, all digits of a given number may not be represented in the computer
memory.
The most common conventional way of representation of numbers in a digital computer is
Floating Point Representation.
Special case, when d t +1=5 . If the digit preceding the 5 is an even number, then
digit is not rounded up. If the digit preceding the 5 is an odd number, then the
digit is rounded up.
Exercise: Round the following numbers to three and four significant digits.
3.5587 1.341 75.25
0.5896 0.3762 0.1275
9.3866 9.871 0.2555
Remark: Chopping has introduced much more round-off error than rounding. That is,
error =|x−x|≤10
b−t
When we chop x to t significant digits, then
error =|x−x|≤ 0.5× 10
b−t
When we round x to t significant digits, then
Example: Using chopping and rounding, find the maximum rounding error committed in 3-digit
5
computation of =1. 6̇ . And compare the error that generated in both cases.
3
5
Solution: The floating point representation of x= ˙ ×101 . Here
is x=0. 16
3
b=1 ,t=3
˙ ×101 to 3-significant digits, the approximate value of x is
a) When we chop x=0. 16
x=0.166 × 10 . Then, error =|x−x|≤10
1 b−t 1−3 −2
=10 =10 =0.01.
⇒ The maximum error committed is 0.01
˙ ×101 to 3-significant digits, the approximate value of x is
b) When we round x=0. 16
x=0.167 × 10 .Then, error =|x−x|≤ 0.5× 10
1 b−t 1−3
=0.5 ×10 =0.005.
⇒ The maximum error committed is 0.005
From the above example, we can observe that the round off error due to chopping is greater
than rounding.
Numerically error can be measured and described in three ways; absolutely, relatively and using
percentage.
Definition: An absolute error denoted by E a is the absolute difference between the true value x
(also called the exact value) and the approximate value x .
E a=|x−x|
Activity:
Definition: Relative error is denoted by Er and is defined as the ratio between the absolute error
and the true value.
Ea Ea
Er = ≈
|x| | x|
Note: The magnitude of true error does not show how bad the error is. Consider the following
examples, and determine in which case does the error is more significant?
0.1
If x=2 and x=2.1 , then E a=0.1 and the relative error Er = =0.05
2
0.1
If y=2000 and y=2000.1, then again E a=0.1 but now Er = =0.00005
2000
Clearly, from the above example, we can observe that relative error is more powerful than
absolute error to describe the magnitude of the error that introduced in a computation.
E p =Er ×100 %
Exercise: Suppose that you have the task of measuring the length of a bridge and a nail and
come up with 9999cm and 9cm respectively. If the exact values are 10,000cm and 10cm
respectively, then for each case compute:
Computational Efficiency!!!
The execution speed of a program for a numerical solution depends mostly on the number of
functions and arithmetic operations performed in the program. Therefore, we need to reduce the
number of function calls and operations to write and run an algorithm.
Error Estimation!!!
To approximate an error that is generated through iteration, we mostly use approximate percent
relative error (ε a) :
That means, to terminate the computation/iteration the stopping criteria is until ε a< ε