Chapter One
Chapter One
Chapter One
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.
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
≈ 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
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.
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
- 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.
( )= + +⋯
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
−
= = 0.25
= × 100% = 25%
Example: Three approximate values of the number are given as 0.30, 0.33, and 0.34
i) = ii) = iii) =
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.
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.
+∆ = ( +∆ , + ∆ ,…, +∆ )
+∆ = ( , , ,…) + ∆ +⋯
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.
∆ ∆ ∆ ∆ ∆
≤ + + + ⋯+
|∆ | ≤ ∆ + ∆ + ∆ +⋯+ ∆
(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
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
= |∆ | = |∆ | + |∆ |
Solution:
( , , ) = 3 + 5 –7 + 38
=6 − 14
=6 + 10
= 10 − 14
(∆ ) = |∆ | + |∆ | + |∆ |
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.
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 ∆ , =
∆ = ∆
∆
=
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,
=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
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?
=
2
By inverse problem, we have
∆
∆ = , =1
∆ 1 ∆ 1 ∆
= =
∆ 1 ∆
× 100 = × 100 = 0.05%
≅ (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.
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:
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
(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
10
= – for 2
3
Using five-digit rounding using this algorithm the results are:
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.