Chapter 1 ERROR
Chapter 1 ERROR
Chapter 1 ERROR
Chapter 1
Introduction to
Error Analysis
At the end of this Chapter, students should be able to:
Discuss the importance of error analysis in numerical computation
Describe the various possible sources of error
State the definition of absolute error, relative error and percentage of error
Evaluate absolute error, relative error and percentage of error
1
ERROR Part 1
2
ERROR Part 1
Type Source
i.. Arise when simplifications are made when
1. Initial data error describing relationship among variables.
ii. imprecision in data collection.
Occurs when fixed numbers of digits are used to
represent exact value.
1
Round off error 0.3333
2. 3
22
3.142
7
Occurs when finite number of terms is used to
estimate the sum of an infinite series.
Truncation error
3. x x2 x3
ex 1 ...
1! 2! 3!
i. Arise when executing arithmetic operation or
algebraic processes using approximate value.
4. Propagation error
ii. Errors at the beginning and in subsequent steps
propagate into computations and affect accuracy of
the final solution.
3
ERROR Part 1
Definition
Accuracy refers to how closely a measured or computed value agrees with
the true value.
Definition
Precision refers to how closely individual measured or computed value agrees
with each other.
Definition
Error is defined to be the difference between the exact value (actual value)
and the approximated value (measured/observed value). Errors represent
both imprecision and inaccuracy of both measurements and computations.
Definition
Absolute error is defined to be the magnitude of the difference between the
exact value and the approximated value.
Definition
Relative error is defined to be the absolute error divided by the magnitude of
the exact value.
4
ERROR Part 1
Absolute error
Relative error
Exact Value
Let x be the actual value (true value/exact value) and x be the approximated
value (measured value/computed approximation), then
Error : e x-x
E
Relative Error : , x ≠ 0
x
E
Percentage Relative Error: % x 100% , x ≠ 0
x
Example 1
Let x be an exact value and x be an approximate value. Compute the
absolute error, relative error and the percentage of error if
a) x = 0.6 and x = 0.5
b) x = 0.00006 and x = 0.00005
Solution
E 0.1
Relative error : 0.1666...
x 0.6
E 0.1
Percentage : % 100% 100% 16.67% x 100%
x 0.6
Relative error : = E
=
0.00001
= 0.1666…
x 0.00006
E 0.1
Percentage : % = x 100% = x 100% = 16.67%
x 0.6
5
ERROR Part 1
It should be noted that for numbers nearest to 1, the size of absolute error
and relative error are almost equal where as for numbers not near to 1, the
difference between absolute error and relative error will be rather large. The
relative error is exactly the same for part (a) and (b). Thus, as a measure of
accuracy, the absolute error may be misleading and the relative error (or
percentage of error) is more meaningful.
Generally, relative error is a better measurement since it does not vary
according to scalar. Using relative error protects us from misjudging the
accuracy of an approximation because of the scale extreme (very large and
very small).
Definition
The number x is said to approximate x to nth decimal places if n is the largest
nonnegative integer for which
6
ERROR Part 1
Example 2
Round off the numbers given to 3 decimal places and 4 decimal places
respectively. Hence, check the accuracy by calculating the absolute error
a) 4.375332 b) 0.03456324
Solution
a) 4.375 (3D)
b) 0.0346 (4D)
Both a) and b) show that the numbers have been rounded off to 3 and 4
decimal places respectively:
a) E 0.5 x 10
-3
b) E 0.5 x 10 -4
Definition
The number x is said to approximate x to t significant digits (or figures) if t
is the largest nonnegative integer for which
x-x
5 x 10- t or 5 x 10 -t
x
Example 3
Use the definition of significant figures to determine how many significant
digits x approximate x if given :
a) x = 0.00163 and x 0.0016
7
ERROR Part 1
Solution
0.00163 - 0.0016
a) 1.84 x 10 2 5 10 2 , thus the number is
0.00163
1.006 - 1.0053
b) 0.6958 x 10 3 5 10 3 , thus the number is
1.006
In this section we shall briefly list some basic mathematical results, mainly
from the calculus, that are useful in the development and investigation of
numerical methods in subsequent chapters.
Theorem
Rolle’s Theorem
If f(x) is a continuous function is the closed interval [a, b] and is differentiable
in (a, b), and if f(a) = f(b), then there exists at least one point in (a, b) such
that f’( ) = 0.
Theorem
Mean Value Theorem
If f(x) is a continuous function in the closed interval [a, b] and is differentiable
in (a, b), then there exists at least one number in (a, b) such that
8
ERROR Part 1
Theorem
First Mean Value Theorem for Definite Integrals
If f(x) is continuous for a x b , then there exists a number ,
a x b , such that
b
f ( x ) dx f( )(b - a)
a
Theorem
Second Mean Value Theorem for Definite Integrals
Let g(x) be an integrable function that does not change sign on the interval [a,
b] such that
b b
f ( x ) g( x ) dx f ( ) g( x ) dx
a a
Theorem
Let f be a continuous function on the closed finite interval [a, b]. Then there
exists points x m and x M , in [a, b] such that f( x m ) f(x) f( x M ) for any x
in [a, b]; that is, ‘a continuous function attains its maximum on a closed
interval’.
Theorem
Intermediate Value Theorem
If f(x), x m and x M are given as in Theorem 5, and if m = f( x m ) and M =
one number x
* in [a, b] such that f(x * ) = y * .
9
ERROR Part 1
Theorem
Binomial Theorem
If n is a positive integer, then
Observe that the powers of x begin at n and decrease by 1, while the powers
Theorem
Taylor’s Theorem
( )
Let f(x) be a function such that its (n + 1)st derivative, f n+1 (x) , is continuous
on the interval (a, b). If x and x0 are any two points in (a. b), then
Other basic ideas necessary from calculus are the concepts of continuity,
differentiation, and integration. Students are expected to have at least an
intuitive understanding of the concepts of limits, since many numerical
methods are iterative in nature and thus generate a sequence of
10
ERROR Part 1
approximations to the true solution. With this background then the student
can start asking questions such as:
(i) Is the sequence generated by the algorithm convergent?
(ii) How is the convergence related to the choice of initial value?
(iii) How fast does the method converge, or how large is the error,
after the nth iteration?
(iv) How does rounding error affect the method?
(v) Is it competitive with other methods?
(vi) How well can the method be implemented on the particular
computer available and what cost is necessary to obtain an
acceptable answer?
Warm up exercise
Exercise 1
1. Evaluate the absolute error, relative error and percentage error for each x and x
given:
b) x = 67.933 x 67 .936
c) x = 0.67932 x 0.679427
d) x = 0.67932 x 10
5 x 0.67942105
11
ERROR Part 1
2. Round off the following number to 3D (decimal places) and determine the
absolute error incurred as result of round-off.
a) 53.3573 c) 53.3447
b) 0.007353 d) 0.000079
a) x = 12.633 x 12 .6
b) x = 67.9143 x 67 .9
c) x = 0.3793 x 0.38
d) x = 0.00011 x 0.0001
12