Chapter One

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

Basic concepts In Error Estimation

Chapter One
Basic concepts in Error Estimation
Introduction
Numerical Analysis is a subject that is concerned with devising methods for approximating the
solution of mathematically expressed problems. Such problems may each be formulated for
example in terms of algebraic, transcendental equations, ordinary differential equations, partial
or integral equations. More often the mathematical problems cannot be solved by exact methods.
The mathematical models ordinarily do not solve the physical problems exactly, so it is often
more appropriate to find an approximate solution. Hence, the approximate solutions are obtained
by numerical methods. Numerical methods are methods for solving problems on computers by
numerical calculations, often giving a table of numbers. Generally, numerical analysis does not
give exact solution; instead it attempts to devise a method which will yield an approximation
differing from exactness by less than a specified tolerance. The efficiency of the method used to
solve the given problem depends both upon the accuracy required of the method and the ease
with which it can be implemented. Assessing the accuracy of the results is the main objective of
this course.

1.1 Some Basic concepts in numerical analysis


I. Significant digits and floating point representation
Real numbers are represented in digital computers using a normalized scientific notation or
floating point notation: the decimal point is shifted and appropriate powers of 10 are supplied so
that all the digits are to the right of the decimal point and the first digit displayed is not zero. For
example,
8491.2913 = 0.84912913 × 10
−12.32 = −0.1232 × 10
0.00321 = 0.321 × 10
The general notation for a floating point number (in base 10) is
±0. ⋯ × 10
where 0. ⋯ is the mantissa, the integer is the exponent and the integer 10 is called
the base of this representation. The number of digits in the mantissa is a measure of the
precision of the representation: the bigger the more digits are stored in the computer and the
more accurately the real number is approximated. The digits are called “significant digits”:
is the most significant digit and is the least significant digit. The size of the mantissa is also
referred to as “the number of significant digits”. The significant digits are the number of digits
used to express the reliability of a numerical value. The digits 1,2,3, … , 9 are significant
figures/digits. "0" is also a significant digit except when it is used to fix the decimal point or to
fill the place of unknowns or discarded digits.
Example:
5687
3.521
four significant digits.
0.5034
0.1478

0.000345
three significant digits.
0.00102
Compiled by Zerihun M. Page 1
Basic concepts In Error Estimation

48000
3900 two significant digits.
3.9 × 10

4.0196 five significant digits.


II. Round off and Chopping of Numbers
Round off numbers: To round numbers to significant digits
 If the digit in ( + 1) place is less than 5, the is unchanged and discard all digits to
the right of digit number.
Example: 3.762 to 3.76
4.5609 to 4.56
 If the digit in ( + 1) place is greater than 5, then increase the digit by unity and
discard all digits to the right of digit number.
Example: 5.3457 to 5.346
5.808 to 5.81

If the digit in ( + 1) place is exactly5, then increase the digit by unity if it is odd.
Otherwise leave it unchanged.
Example: 23.575 to 23.58
23.585 to 23.58
Example: Round-off the following numbers correct to four significant figures:
58.3643, 979.267, 7.7265, 56.395, 0.065738 and 7326853000.
Solution: After retaining first four significant figures we have:
(i) 58.3643 becomes 58.36
(ii) 979.267 becomes 979.3
(iii) 7.7265 becomes 7.726 (digit in the fourth place is even)
(iv) 56.395 becomes 56.40 (digit in the fourth place is odd)
(v) 0.065738 becomes 0.06574 (because zero in the left is not significant)
(vi) 7326853000 becomes 7327 × 10 .
Chopping of numbers: To chopped the numbers to significant digits, then discard all digits to
the right of digit.
Example: 4.762 to 4.76
5.3456 to 5.345
11.675 to 11.67
III. Exact and approximate numbers
Exact Numbers: are numbers with which no uncertainly or no approximation is taken.
Example: exact numbers are 1, 2, , , √2, , etc
Approximate numbers are numbers which is not exact.
Example:

Compiled by Zerihun M. Page 2


Basic concepts In Error Estimation

≈ 3.14
≈ 2.718
1
≈ 0.3333
3
IV. Accuracy and precision
Accuracy measures how close a measurement is to the true value.
Precision measures the degree to which measurements are the same.
Example: (a) inaccurate and imprecise (b) accurate and imprecise,
(c) inaccurate and precise and (d) accurate and precise

Good accuracy Good precision

1.2 Error and Approximation in Computations

Error is a measure of the accuracy of a value which is due to the uncertainty in scientific
measurements. If we have true value and an approximate value, then error is the quantity true
value minus an approximate value. i.e. = –
In any numerical analysis, errors will arise during the calculations. To be able to deal with the
issue of errors, we need to
(A) Identify where the error is coming from, followed by
(B) Quantifying the error, and
(C) Minimize the error as per our needs.

Compiled by Zerihun M. Page 3


Basic concepts In Error Estimation

1.3 Sources of error


Analysis of errors is the central concern in the study of numerical analysis and therefore we will
investigate the sources errors. Errors in the solution of a problem are due to the following
reasons:
 To solve physical problems, mathematical models are formulated to describe
them and these models do not describe the problems exactly and as a result errors
are introduced.
 The methods used to solve the mathematical models are often not exact and as a
consequence errors are introduced.
 A computer has a finite word length and so only a fixed number of digits of a
number are inserted and as a consequence errors are introduced.

Example: By using differential equation the population growth is modeled by =( − ) ( )

where birth rate, death rate and time. Since, the exact birth and death rate are not known,
then this formula its own error. Therefore, the mathematical modeling may be one of the sources
of error.

Similarly, the methods which are used to solve the differential equation = ( − ) ( ) may

be again one of the sources of error. (The methods are Euler’s method, Modified Euler’s method,
and Runge - Kutta methods which we will see at the last chapter of this course)
Example: Consider the oscillation of a pendulum
The differential equation that describes the oscillation of the pendulum is taken in the form

+ sin + =0

 = length of the pendulum


= acceleration due to gravity
 = coefficient of friction.
- The mathematical description of the pendulum’s oscillation is not exact because air resistance
and friction at the pivot are neglected and as a consequence the coefficient of friction is
considered as linearly dependent on the speed. And these errors are inherent because they
cannot be controlled in the process of numerical solution.
- The differential equation cannot be solved explicitly and will require some numerical methods
and this generates the errors of the method.

Compiled by Zerihun M. Page 4


Basic concepts In Error Estimation

- Determination of , and are not exactly correct and computation of these is not exact and
hence computational error will be produced.
1.4 Types of error
The errors induced by the sources mentioned above are classified as:
1) Inherent Errors: These are errors that we cannot avoid. In computations, inherent
errors can be minimized by obtaining better data and by using computing aids of higher
precision.
2) Truncation Errors: Are errors caused by using an approximate formula in computation.

Example 1: ( ) = =1+ + + ⋯. Truncating the series after four terms, we get an


! !

approximate value of and is given by ≈1+ + + + . The Truncation error is


! ! !

( )= + +⋯
5! 6!
Example 2: From differential calculus
( ∆ ) ( )
( ) = lim∆ → which is exact mathematical formula. But, if we use

( ∆ ) ( )
( )≈ , then it is not exact. Therefore, such type of error is called Truncation

error.
Example 3: Consider the integral
0.5  x 2
 e dx
0
By truncating the infinite series
2 x4 x6
e x  1  x 2     
2 ! 3!
with only 4 terms, we have
0.5  4
1  x 2  x  dx
0. 5  x 2
 e dx 
0 0  2 

0.5
 x3 x5  0.125 0.03125
= x     0.5  
 3 10  3 10
0
= 0.461458
The exact value of the integral is 0.461281 (to 6 d.p.).
Thus using only three terms of the infinite series we have
Truncating error = 0.461281  0.461458
= 1.69  10 4

Compiled by Zerihun M. Page 5


Basic concepts In Error Estimation

3) Round-off Errors: These are errors due to approximate representation of numbers.


Example: ≈ 3.14, ≈ 0.3333, √2 ≈ 1.414

1.5. Absolute, Relative and percentage errors


The accuracy of any computation is always of great importance. There are three ways to express
the size of error in a computed result. These are
1. Absolute error 3. Percentage error
2. Relative error
Definition: Let denote the true value of a quantity and let denote the approximate value of
the quantity then
 The absolute error denoted by is defined by:
=| − |
 The relative error denoted by is defined by
| − |
= =
| | | |
 The percentage error denoted by is defined by
= × 100%

Let ∆ be a number such that = | − | ≤ ∆ , then ∆ is an upper limit on the magnitude



of the absolute error and is said to measure absolute accuracy. Similarly, the quantity | |
measures the relative accuracy.
-Some important rules
a) If the number is round off to -decimal places, then the upper limit of the absolute
error is given by ∆ = 0.5 × 10 .i.e. | − | ≤ 0.5 × 10
b) If the number x is chopped to -decimal places, then the upper limit of the absolute
error is given by ∆ = 10 . i.e. | − | ≤ 10
c) If is the approximate value of , after rounding off to digits, then

≤ 0.5 × 10

d) If y is the approximate value of x, after truncating to m digits, then



≤ 10
Example: If 0.0002 is the approximate value of 0.00016, find the absolute, relative and
percentage errors.
Solution:
= 0.00016, = 0.0002, then
=| − | = 0.0004

Compiled by Zerihun M. Page 6


Basic concepts In Error Estimation


= = 0.25

= × 100% = 25%
Example: Three approximate values of the number are given as 0.30, 0.33, and 0.34

Which of these three is the best approximation?


Solution: The number, which has least absolute error, gives the best approximation.
True value = , =| − |

i) = ii) = iii) =

It follows that 0.33 is the best approximation for .

Example: Let = 0.3000 × 10 and = 0.3100  10 , then


Absolute error =| − | = |0.3 − 0.31| × 10 = 0.1

Relative error = = 0.3333 × 10

- Let = 0.3000 × 10 and = 0.3100  10


Absolute error =| − | = 0.1 × 10

Relative error = = 0.3333 × 10

- Let = 0.3000 × 10 and = 0.3100  10


Absolute error =| − | = 0.1 × 10

Relative error = = 0.3333 × 10

These examples show that the same relative error 0.3333 × 10 , occurs for widely varying
absolute errors. Therefore, as a measure of accuracy the absolute error may be misleading
leading and the relative error is more meaningful, because the relative error takes into
consideration the size of the true value.
Example: Suppose you have the length and mass measurement of your friend. The
measurements are = 85 ±3 , = 20 ± 1 . Which measurement is more
accurate?
Solution: Since the relative error is meaningful to measure the accuracy then, the one that has
smaller relative error is more precise.
For the length measurement = 0.04 and
For the mass measurement = 0.05
Hence, the length measurement is more accurate than the length measurement.

Compiled by Zerihun M. Page 7


Basic concepts In Error Estimation

1.6 Propagation of Errors

In this section, we derive a general formula for the error committed in using a certain formula
due to using the error in each variable. Numerical computations usually involve a series of
arithmetic operations like addition, subtraction, multiplication and division. When approximate
values are used, errors are propagated. A general formula for error estimation can be deduced by
using Taylor expansion of several variables.

Let = ( , , ,…, ) be a function of n variables. Let the error in each be ∆ , =


1,2, … , . Then the error in u is ∆ and

+∆ = ( +∆ , + ∆ ,…, +∆ )

Expanding the right hand side by Taylor’s series, we get

+∆ = ( , , ,…) + ∆ +⋯

Assuming that the errors ∆ is very small and neglecting higher powers, we obtain

∆ = ∆ = ∆ + ∆ + ∆ +⋯+ ∆

This equation represents the general error formula. If we divide this equation , we get the
relative error.
∆ ∆ ∆ ∆ ∆
= = + + ( )+⋯+

 Taking absolute value both of the sides, we get maximum relative error.

∆ ∆ ∆ ∆ ∆
≤ + + + ⋯+

 Also the maximum absolute error

|∆ | ≤ ∆ + ∆ + ∆ +⋯+ ∆

1.6.1 Error in Addition and Subtraction

(i) If f ( x, y )  x  y , then
E x  y  E x  E y
(ii) If f ( x, y )  x  y , then
E x  y  E x   E y  E x  E y

Compiled by Zerihun M. Page 8


Basic concepts In Error Estimation

Thus, the absolute error in addition and subtraction is the sum of the absolute errors of the
numbers involved.
1.6.2 Error in Product and Division

(i) If f ( x, y )  xy , then
E f  y A E x  x A E y
Dividing by xy
E f y A E x x E y
  A
xy y x x y
Assuming x A / x  1 , y A / y  1 , we obtain
R xy  R x  R y
(ii) If f ( x, y )  x / y , then
1 x
E f  E x   A2 E y
yA yA
Dividing by xy
E f y E x x y E y
  A
x/ y yA x x yA yA
Assuming x A / x  1 , y / y A  1 , we obtain
R x / y  R x  R y
This shows that the relative error in the product and division is approximately the sum of the
relative errors of the numbers involved.
Example1: Find the absolute and relative error of the volume of a sphere = if the

diameter d=3.7 cm  0.05 cm, ≈ 3.14.


Solution:
Take and d as variables
1 1
= = 8.44, = = 21.49
6 2
Since is corrected to two decimal places then |∆ | = 0.5 × 10

= |∆ | = |∆ | + |∆ |

= (8.44)(0.005) + (21.49)(0.05) = 1.1167


1.1167
=
= 4.2 × 10
26.5084
Example 2: Determine the maximum relative error for the function
( , , ) = 3 + 5 –7 + 38
For = = = 1 and = – 0.05, = 0.001 and = 0.02.
Compiled by Zerihun M. Page 9
Basic concepts In Error Estimation

Solution:
( , , ) = 3 + 5 –7 + 38

=6 − 14

=6 + 10

= 10 − 14

(∆ ) = |∆ | + |∆ | + |∆ |

= |(6 − 14 ) | + |(6 + 10 ) | + |(10 − 14 )


= 0.496
For x = y = z = 1 and Δx = – 0.05, Δy = 0.001 and Δz = 0.02, we have the maximum
relative error is given by
(∆ ) 0.496
( ) = = = 0.01272
39
Example1: Evaluate the sum = √3 + √5 + √7 to four significant digits and find its maximum
absolute and relative errors.
Solution: We have √3 = 1.732, √5 = 2.236, √7 = 2.646
Thus
= √3 + √5 + √7
= 1.732 + 2.236 + 2.646 = 6.614
Max = 10 for each of √3, √5 and √7

Thus maximum absolute error for = 0.0005 + 0.0005 + 0.0005 = 0.0015 < 10

The total absolute error shows that the sum is correct to three significant figures only
(i.e., correct to two decimal places)
Hence we take = 6.61
∆ 0.0015
= = = 0.0002
| | 6.61
Example 2: If = 0.51 is corrected to decimal places, then find the maximum absolute and
relative error.

Compiled by Zerihun M. Page 10


Basic concepts In Error Estimation

Solution: Since = 0.51 is corrected to two decimal places, then the maximum absolute error is

∆ = 0.5 × 10 = 0.005 and the maximum relative error is | | = 0.0098

Exercise
1. If = and errors in , , be 10 for each, calculate the maximum relative error at
each point (1,1,1).
2. Two sides and included angle of a triangle are 9.6 cm, 7.8 cm and 45° respectively. Find the
possible error in the area of a triangle if the error in sides is correct to a centimeter and the
angle is measured correct to one degree.
1.7. Inverse (permissible) errors
Given the error of several independent quantities or approximate numbers, the direct problem
requires us to find the error of any function of these quantities. However, the inverse problem
requires us to find the allowable or permissible errors in several independent quantities in order
to obtain a prescribed degree of accuracy in any function. The direct problem is straight forward.
The formula to be used is:

∆ = ∆

However, the inverse problem is finding the allowable errors in , ,⋯, when the error in u
is known. Since there is only one equation u and there are several unknowns
∆ ,∆ ,⋯,∆ ,then the problem is solved with the minimum effort by using what is known as

the principle of equal effects. This principle assumes that the partial differential ∆ , =

1,2,3, ⋯ , are all equal. Thus,

∆ = ∆


=

Example 1:.The base of a cylinder has radius ≈ 2 , the altitude of the cylinder is ℎ ≈
3 .Find the allowable error in the volume of the cylinder if ∆ = 0.1 and use ≈ 3.14
Solution: The volume of the cylinder is given by
= ℎ, ∆ = 0.1 , =2 , ℎ=3 , = 3.14

= ℎ = 12,

Compiled by Zerihun M. Page 11


Basic concepts In Error Estimation

=2 ℎ = 37.7

= = 12.6

Since n = 3, using the formula

∆ =

We have,
∆ 0.1
∆ = = ≈ 0.003
3× 3 × 12

∆ 0.1
∆ = = ≈ 0.001
3× 3 × 37.7

∆ 0.1
∆ℎ = = ≈ 0.003
3× 3 × 12.6

r2 h
Example 2: The percentage error in R which is given by R   , is not allowed to exceed
2h 2
0.2% , find allowable errors in r & h ,when r  4.5cm & h  5.5cm.
Solution: The percentage error in

= × 100 = 0.2

Therefore,
0.2 0.2 ℎ 0.2 (4.5) 5.5
∆ = × = + = +
100 100 2ℎ 2 100 2 × 5.5 2
0.2
= (4.5909) = 0.0092
100
Thus, Percentage error in

∆ 100 ∆
= × 100 =

100 0.0092
= = 0.1249
4.5 2 × 4.5
5.5

Compiled by Zerihun M. Page 12


Basic concepts In Error Estimation

Percentage error in ℎ

∆ℎ 100 ∆ − 1
= × 100 = , = +
ℎ ℎ ℎ 2ℎ 2

100 0.0092
=
5.5 −(4.5) 1
2× +2
2 × (5.5)
= 0.5060
Example 3: The error in the measurement of area of a circle is not allowed to exceed 0.1%. How
accurately should the diameter be measured?

Solution: Here, the area of the circle with radius is = =

=
2
By inverse problem, we have

∆ = , =1

∆ 1 ∆ 1 ∆
= =

∆ 1 ∆
× 100 = × 100 = 0.05%

1.7 Stability and Condition in Numerical Computation


A numerical computation is said to be numerically unstable if the uncertainty of the input values
is grossly magnified by numerical method employed. The condition number of a problem is the
sensitivity of the solution with respect to errors in the data.
Consider the first-order Taylor’s series of a function given by
( ) = ( ) + ′( ) ( – ) (i)
The relative error of f (x) then becomes
( )− ( ) ′( ) ( – )

( ) ( )
The relative error of x becomes

Compiled by Zerihun M. Page 13


Basic concepts In Error Estimation

≅ (ii)

A condition number is often defined as the ratio of the relative errors given by (i) and (ii) as
′( )
= (iii)
( )
The condition number given by in this equation indicates the extent to which an uncertainty in x
is magnified by ( ).
Condition number = 1 (function’s relative error = relative error in x)
Condition number > 1 (relative error is amplified)
Condition number < 1 (relative error is attenuated)
Condition number > very large number (the function is ill-conditioned)
 a problem is well-conditioned if small errors in the data produce small errors in the
solution
 a problem is ill-conditioned if small errors in the data may produce large errors in the
solution
Example: Compute and interpret the condition number for
a. ( )= for = 0.51
b. ( ) = for = 1.7
Solution:
a. The condition number is given by
′( )
=
( )
′( )
For = 0.51 , = cos(0.51 ) = – 0.03141, ( ) = sin(0.51 ) = 0.99951
′( ) (0.51 )(– 0.03141)
= = =– 0.05035
( ) 0.99951
Since the condition number is < 1, from Eq. (iii), we conclude that the relative error is
attenuated.
b. ( ) = , ( ) = – 7.6966 = 1.7, (1.7) = 60.2377
′( ) (1.7)(60.2377)
= = =– 13.305
( ) – 7.6966
Thus, the function is ill-conditioned.
If errors are magnified continuously as the algorithm continues eventually they will over shadow
the true value and hence destroying the validity of the algorithm and we call such algorithm us
unstable. If errors made at initial stage die out as the algorithm continues, the algorithm is said
to be stable. Usually the initial error induced will not die out to the last stage of the algorithm.
But to consider the stability of an algorithm we consider two cases:
Suppose that an error e0 is introduced at initial stage of the algorithm and after ‘n’ subsequence
operations of the algorithm, En error is resulted which is the propagated error:
- If |En|  kne0 where k is a constant the propagated error is said to be linear growth and the
algorithm is stable.

Compiled by Zerihun M. Page 14


Basic concepts In Error Estimation

Linear growth of error is usually unavoidable and is acceptable and Algorithms that show
linear growth are considered to be stable.
- If |En|  kne0 for some k > 1, the propagated error is exponential. Exponential growth of
error should be avoided.
- And algorithms that show exponential growth are said to be unstable.
Numerically Unstable: Computations that are so sensitive to round-off errors that errors grow
uncontrollably during calculations.
Example:

- The sequence = , > 0 can be generated using.

1. Let = 1 and defining = ≈ (0.33333) for > 1

If the sequence is generated using five digit rounding arithmetic, the results are:

0 0.10000  10 0.10000  10
1 0.33333  10 0.33333  10
2 0.11111  10 0.11111  10
3 0.37036  10 0.37037  10
4 0.12345  10 0.12346  10

The rounding error introduced by replacing by 0.33333 produces a propagated error of

(0.33333)  10 in the nth term of the sequence. Hence, the method of generating the
sequence is stable.
2. Let us use another algorithm to generate the sequence

= , > 0, define = 1, = and compute

 10 
=   – for 2
 3
Using five-digit rounding using this algorithm the results are:

Compiled by Zerihun M. Page 15


Basic concepts In Error Estimation

0 0
0.10000  10 0.10000  10
1 0 0.33333  10
0.33333  10
2 0.11110  10
0 0.11111  10
3 0.37000  10 0.37037  10−1
4 0.12230  10 0.12346  10−1
5 0.37660  10 0.41152  10

The same rounding error introduced by replacing by (0.33333) generates propagated error of

3 (0.12500  10 ) to produce . Hence, the error is exponential growth and the algorithm is
unstable.
Exercise
1. If =2 – 5 , find the percentage error in u at = 1, if error in is 0.05.
2. The value of ( , )=6 (log − sin 2 ) is corrected to two decimal places. If
= 15.2, = 57°, find the permissible errors in x and y
3. How accurately should the length and time of vibration of a pendulum should be
measured in order that the computed value of is correct to 0.01%.
4. The error in the measurement of the area of a circle is not allowed to exceed 0.1%. How
accurately should the diameter be measured?
5. In a , = 9.5 , = 8.5 and = 45°, find allowable errors in , , and
such that the area of may be determined nearest to a square centimeter.

Compiled by Zerihun M. Page 16

You might also like