Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Chapter 1 ERROR

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

ERROR Part 1

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.1 What is Numerical Analysis?


Numerical analysis is the area of mathematics and computer sciences that
creates, analyzes, and implements algorithms for solving numerically the
problems of continuous mathematics. Numerical methods not only provide
alternatives in finding solutions to more difficult and complicated mathematical
models, but also create algorithms in finding solutions to models that cannot
be solved explicitly by the analytical mathematical formula in the most efficient
manner.
Numerical analysis can be both a science and an art. As a science, numerical
analysis is concerned with the processes by which mathematical problems
can be solved. As an art, numerical analysis is concerned with choosing the
most suitable procedure to solve a particular problem based on judgment and
experience.

1
ERROR Part 1

1.2 Introduction to Error


The knowledge we have of the physical world is obtained by doing
experiments and making measurements. It is crucial to understand that all
measurements of physical quantities are subject to some degree of
uncertainties. No measurement is perfectly accurate or exact. Many
instrumental, physical and human limitations cause measurements to deviate
from the “true” values of the quantities being measured. These deviations are
called “experimental uncertainties” or commonly known as “error”. Error in
scientific measurement usually does not mean mistake or blunder. Instead,
the terms “error” and “uncertainty” both refer to unavoidable imprecision in
measurements or computed values.
Failure to specify errors for a given measurement can have serious
consequences in science and in real life. In scientific investigations measured
values (with uncertainties) are used in mathematical processes repeatedly.
Errors in measurements, errors which arise as a result of arithmetical
procedures and errors incurred when using computational tools propagate
through calculations to produce errors in computed values and eventually
affect final results.
Calculators and especially computers have become powerful tools in solving
complex mathematical problems required in engineering practice. Although
computer technology has largely facilitate the implementation of solution
techniques it is important to be aware of the limitations of these calculating
aids since it can produce computational errors which can lead to undesirable
consequences.

1.3 Possible Sources of Errors


Numerical answers to problems generally contain errors which arise in two
areas: those inherent in the mathematical formulation of the problem and
those incurred in finding the solution numerically (computational error). The
first category includes inaccuracies in physical data or imprecision in
measurements as well as error incurred when mathematical modeling
formulated is simply an approximation of the actual physical situation.
Digital computers have enormously reduced the possibility that calculation
blunders will occur. However with limitations of computer, correctness and

2
ERROR Part 1

reasonableness of a computed solution should always be verified. Correct


calculation or procedure does not always guarantee correct solution.
Computational error may arise from two possible sources when using
calculating tools: truncation error and round-off error.
Truncation error arises as a result of replacing an infinite summation (or
integration by a finite approximation). For example, when evaluating the
function sin x using the infinite Taylor’s series expansion, only a finite number
of terms are being used.
Many numbers have infinite decimal representation that must be rounded.

Numbers such ,e, or 7 cannot be expressed by a fixed number of


significant digits. Even if a numerical value can be expressed exactly by finite
decimal representations, division may introduce numbers which must be
rounded and multiplication may produce more digits than can reasonably be
retained. The error introduced when rounding off a number is called round-off
error.

As a summary, errors may incur from the following sources:

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

1.4 Error Measurement


A measurement or experimental result is of little use if nothing is known about
the probable sizes of the errors, the uncertainties in the data which were used
to obtain that result and the extent in which the errors built up or propagate
through mathematical processes. It is important to learn to determine
quantitative estimates of the nature and size of experimental and
computational errors and to predict how these errors affect the reliability of the
final result. Here we shall attempt to formalize the concept of error.

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.

True value  approximate value + Error


Error  True value - approximate value

Definition
Absolute error is defined to be the magnitude of the difference between the
exact value and the approximated value.

Absolute error  |True value - approximate 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

Relative error gives an indication of how good a measurement is relative to


the size being measured. Relative error can also be expressed in terms of
percentage.

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

Absolute 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

a) Absolute error : E  x - x  0.6  0.5  0.1

E 0.1
Relative error :     0.1666...
x 0.6

E 0.1
Percentage : %  100%  100%  16.67% x 100%
x 0.6

b) Absolute error : E = x-x = 0.00006- 0.00005 = 0.00001

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).

1.5 Round-off Error and Significant Figures


The concept of significant figures (or significant digits) has been developed to
formally designate the reliability of a numerical value. The significant digits of
a number are those that can be used with confidence. They correspond to the
number of certain digits plus one estimate digit (the last digit). Round-off
errors are introduced when numbers having limited significant figures are
used to represent exact numbers.
Whenever we employ a number in a computation, we must have assurance
that it can be used with confidence. Both round-off digits and significant
figures are some of the ways of expressing our confidence in a numerical
value.

Definition
The number x is said to approximate x to nth decimal places if n is the largest
nonnegative integer for which

x-x ≤ 0.5 x 10 -n or E  0.5 x 10-n

Referring to the procedure of rounding digits, in order to round-off a number


with more than n digit to n digit:
a) if the n + 1 digit less than 5, let nth digit as it is
b) if the n + 1 digit greater or equal 5, add one unit to the nth digit

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)

E  x - x  4.375332  4.375  0.334103  0.5 103

b) 0.0346 (4D)

E  x - x  0.03456324  0.0346  0.3676104  0.5 104

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

We conclude this by writing the absolute error E in terms of normalize


scientific notation and observe the powers of 10.

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

b) x = 1.006 and x  1.0053

7
ERROR Part 1

Solution

0.00163 - 0.0016
a)    1.84 x 10  2  5 10  2 , thus the number is
0.00163

accurate to 2 significant digits.

1.006 - 1.0053
b)    0.6958 x 10  3  5 10  3 , thus the number is
1.006

accurate to 3 significant digits.

1.6 Review of Fundamental Mathematical Results

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

f(b) - f(a) = (b - a)f’(  )

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 =

f( xM ), then for any value y


* such that m  y *  M, there exists at least

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

n  n n  n n


x  y n    xn    xn-1y    xn-2 y 2  ...    xn-k yk  ...    yn
0 1   2 k  n

Observe that the powers of x begin at n and decrease by 1, while the powers

of y begin with 0 and increase by 1. Also, in (x + y* )n , the coefficient of yk


n
is always   .
k  

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

f' (x0 ) f' ' (x0 ) f (n)(x0 )


f(x)  f(x0 )  (x - x0 )  (x - x0 )2  ...  (x - x0 )n  Rn1(x0 ; x)
1! 2! n!

where there exists a number  between x and x * such that


(n+1)
f (ξ )
Rn+1(x0 ; x) = (x - x 0 )n+1
(n + 1)!
In other words,
f(x)  Pn(x)  Rn1(x)

where, Pn (x) is the Taylor polynomial of degree n.

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

The measurements of A and B are A  7.5415  0.005 and B  9.002  0.001


respectively. Find the absolute error, relative error and percentage error in the
measurement. What can be said about the accuracy of the measurement?

Exercise 1

1. Evaluate the absolute error, relative error and percentage error for each x and x
given:

a) x = 679.33 x  679 .36

b) x = 67.933 x  67 .936

c) x = 0.67932 x  0.679427

d) x = 0.67932 x 10
5 x  0.67942105

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

3. Determine the reliability of x as compared to x in terms of significant digits (or


significant figures). Justify using the definition.

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

4. Suppose that p* approximates p to 3 significant digits, find the interval in which


p* must lie if p is

a) 150 b) 900 c) 1500

12

You might also like