You are on page 1of 46

Numerical Analysis I

Chapter 1

Basic concepts in
error estimation

2
Characteristics of Numerical Methods

1. The solution procedure is iterative, with the accuracy of the solution

improving with each iteration.

2. The solution procedure provides only an approximation to the true,

but unknown, solution.

3. An initial estimate of the solution may be required.

4. The algorithm is simple and can be easily programmed.

5. The solution procedure may occasionally diverge from rather than

converge to the true solution.


Error ?

4
true value – approximate value

5
 The solution of a problem obtained by numerical
methods contains some errors.

To minimize the errors, it is most essential to identify


the causes or sources of the errors and their growth and
propagation in numerical computation.

6
1.1 Sources of Error
 In general, errors can be classified based on their sources as
non-numerical and numerical errors.

Non numerical Errors:

This type of errors present in the statement of the problem itself,


before determining its solution.
These occur due to the simplified assumptions made in the
process of mathematical modeling of a problem.
7
Non-numerical errors:

(1) modeling errors: generated by assumptions and


limitations.

(2) blunders and mistakes: human errors /example:


programming errors, arithmetic errors/

(3) uncertainty in information and data

8
Some of the sources of Numerical Error:

1) Truncation: - It is a usage of an approximation in


place of an exact mathematical procedure, and hence
results an error called truncation error.
Example:-

This is an exact equation.

9
If is approximated by a finite number of terms of the
series; for example up to 10 terms …

10
2) Rounding: -
It is a process of cutting numbers with large number of digits to a usable
number of figures by some procedures.

Round off error under different rounding rules

There are two common rounding rules, round-by-chop and round-to-


nearest.

The rounding rule, round-to-nearest, leads to less round off error in general.

11
Example:

12
Note:
There is a lose of significance during the subtraction of
nearly equal number, which is the great source of round-off
error.
A similar problem arise while dividing by a smaller
number.

Example: compute the values of the roots of a quadratic


equation with a = 1 , b = 3000.001 and c = 3.
ROOTs: -0.001 and -3000

13
Significant Figure

1. Non-zero digits are always significant.


2. Any zeros between two significant digits are significant.
3. A final zero or trailing zeros in the decimal portion ONLY are
significant.
Example:
How many significant figures does the following numbers
have ?
1) 0.010954
2) 100.00
3) 73.2564
4) 36.0050
5) 25000

15
1.2 Approximations of errors

 The errors associated with both calculations and


measurements can be characterized with regard to their
accuracy and precision.

16
 Accuracy refers to how closely a computed or measured
value agrees with the true value.

 Precision refers to how closely individual computed or


measured values agree with each other.

17
18
1.3 Rounding off

The following exact


numbers are rounded
to 5
significant figures.

19
Example:
Round the following numbers to 3 and 5 significant digits.

i) 123.4557
ii) 1.00457
iii) 2.457456
iv) 1240
v) 49.000088

20
1.4 Absolute and relative errors

1.4.1 Absolute Error


 It is given as; absolute error
is the truth value
is the approximate value.

21
Note:
 Let be a number such that , then is an upper limit on
the magnitude of the absolute error.

If the number is rounded to decimal places, then


.

22
Example:
Find the maximum absolute error in the approximation of
correct up to 4 decimal places.

23
1.4.2 Relative error (true fractional relative error)
 It is given as; provided that .
 It gives total error measuring in 1 unit.
 It measures both the quantity and quality of the
calculation and measurement. And hence it is a better
measurement for error than absolute error.

24
1.4.3 Percentage error (true percent relative error)

 Particular type of relative error.


 It is sometimes called as the relative percentage error.
 It is given as .
 It gives total error measuring in 100 units.

25
 One of the challenges of numerical methods is to
determine error estimates in the absence of knowledge
regarding the true value.

26
For example:
certain numerical methods use an iterative approach to
compute answers.
 In such an approach, a present approximation is made
on the basis of a previous approximation.
 For such cases, the error is often estimated as the
difference between previous and current
approximations.

27
 Thus, percent relative error is determined according to

 And the process terminates when .

28
Example 1:
Suppose that student A scores 9 out of 10 and student B scores
99 out of 100.
compute
(a) the true error and
(b) the true percent relative error in each case.
Which student scores better ? How?

29
Solution:
 true error for Student A = 1
 true error for Student B
 true percent relative error for Student A

 true percent relative error for Student B

As shown by the percentage error, student B performs better.

30
31
Example 2:

Suppose the measured value of the temperature is Ta = 37.1, but


the true temperature is T = 36.9.
Then find the:
i) Error
ii) Absolute error
iii) True relative error
iv) True percentage error

32
Exercise:

1) Given
Absolute error =
Relative error =
Then find the (truth value)

2) If then find the .

33
Exercise:

1) Calculate the absolute, relative and percentage error in


the approximation of
A) 1/3 by 0.3 , 0.333 ,and 0.334
B) by 3.14, 3.141, 3.142 (Take the true value of as 3.1415)
Which approximation is the best in each case? Why?

34
Why do we use base 10 number system ?

35
We use base 10 number system as we have 10 fingers and 10
toes. And it uses 10 digits namely 0,1,2,3,4,5,6,7,8,and 9.

But if humans have 8 fingers and 8 toes, we would


undoubtedly have developed base -8 or octal number system.

In the same sense, how many fingers and toes does a


computer have ?

36
Computer representation of Numbers
Computers use base-2 or binary number system which
consists of 0 and 1.
The standard numerical data types available in most
programming languages are integers, reals and double
precision reals.

37
Floating – point Representation
Fractional quantities are typically represented in
computers using floating – point form.
In this approach, a number is expressed as a fractional
part, called MANTISSA or SIGNIFICAND, and an integer
part, called the EXPONENT or CHARACTERISTIC, as in

m – manitssa , b – base , e – exponent

38
Example:
The number 123.45 could be represented as in a floating – point
base – 10 system.

Machine epsilon
We know that a computer has a finite word length, so only a fixed
number of digits is stored and used during computation.
Hence, even in storing an exact decimal number in its converted
form in the computer memory, an error is introduced.
This error is machine dependent and is called machine epsilon.

39
Propagation error

Suppose you measure some quantities a, b, c . . . with


uncertainties δa, δb, δc, . . .. Now you want to calculate some
other quantity Q which depends on a and b and so forth.
What is the uncertainty in Q?
The answer can get a little complicated, but it should be no
surprise that the uncertainties δa, δb, etc. “propagate” to the
uncertainty of Q.

40
Addition or Subtraction
If Q is some combination of sums and differences, i.e.

Then,

Note:
In particular, if Q = a + b or a - b, then

41
Multiplication and Division
If

Then,

N.B
In practice, it is usually simplest to convert all of the
uncertainties into percentages before applying the
formula.

42
Example:
1) Suppose you measure the height H of a door and get 2.00
± 0.03 m. This means that H = 2.00 m and δH = 0.03m.
The door has a knob which is a height h = 0.88 ± 0.04m
from the bottom of the door. Then the distance from the
doorknob to the top of the door is Q = H - h = 1.12 m.
What is the Propagation error in Q?
2) Let , , , .
Then, find the approximation of , absolute and relative errors
and the number of significant digits of the result.

43
Numerical Stability
In numerical algorithms the concern is the growth of round-off errors
and/or small fluctuations in initial data which might cause a large
deviation of final answer from the exact solution.
Some numerical algorithms may damp out the small fluctuations (errors)
in the input data; others might magnify such errors. Calculations that can
be proven not to magnify approximation errors are called numerically
stable.
One of the common tasks of numerical analysis is to try to
select algorithms which are robust – that is to say, do not
produce a wildly different result for very small change in the
input data.

44
A method is called stable if When it is possible to have small
small changes in the initial changes in the initial data producing
data produce large changes in the final results, the
correspondingly small method is unstable.
changes in the final results.
Some methods are stable ONLY for
certain choices of initial data. These
methods are called conditionally
stable.

45
End

46

You might also like