Professional Documents
Culture Documents
Chapte 01
Chapte 01
1
Numerical Method
Ulfata E.
One of the most important aspects of numerical analysis is the error analysis. Errors may occur at any stage
of the process of solving a problem. By the error we mean the difference between the true value and the
approximate value.
There are two kinds of numbers; exact and approximate numbers. An approximate number x is a number
that differs, but slightly, from an exact number X and is used in place of the latter in calculations.
The numbers 1, 2, 3, . . . , 43 , 35 , . . . , etc., are all exact, and π, 2, , e. . . , etc., written in this manner are
√ √
also exact. 1.41 is an approximate value of 2, and 1.414 is also an approximate value of 2. Similarly
3.14, 3.141, 3.14159, . . . , etc., are all approximate values of π.
Definition: 1 The digits that are used to express a number are called significant digits.
A significant digit of an approximate number is any non-zero digit in its decimal representation, or any zero
lying between significant digits, or used as place holder to indicate a retained place.
The digits 1, 2, 3, 4, 5, 6, 7, 8, 9 are significant digits. 0 is also a significant figure except when it is used
to fix the decimal point, or to fill the places of unknown or discarded digits. For example, in the number
0.0005010, the first four 0s′ are not significant digits, since they serve only to fix the position of the decimal
point and indicate the place values of the other digits. The other two 0s′ are significant.
Two notational conventions which make clear how many digits of a given number are significant are given
below.
2. The significant figure in a number written in scientific notation (M × 10n ) consists of all the digits
explicitly in M .
1
Significant figures are counted from left to right starting with the left most non zero digit.
Number significant figures Number of Significant figures
37.89 3,7,8,9 4
5090 5,0,9 3
7.00 7,0,0 3
0.00082 8,2 2
0.000620 6,2,0 3
5.2 × 104 5,2 2
3.506 × 10 3,5,0,6 4
−3
8 × 10 8 1
1. Inherent Errors: These are the errors involved in the statement of a problem. When a problem
is first presented to the numerical analyst it may contain certain data or parameters. If the data or
parameters are in some way determined by physical measurement, they will probably differ from the
exact values.
2. Truncation Errors These are the errors introduced due to transforming a physical or mathematical
problem into a computational problem. Once a problem has been carefully stated, it is time to begin
the analysis of the problem which involves certain simplifying assumptions. The functions involved in
mathematical formulas are frequently specified in the form of infinite sequences or series.
x3 x5 x7
For example, consider sin(x) = x − 3! + 5! − 7! + .... If we compute sin(x) for a given value of x by
x3 x5
the formula sin(x) = x − 3! + 5! , then it leads to an error.
The magnitude of the error in the value of the function due to cutting (truncation) of its series is equal
to the sum of all the discarded terms.
3. Round-off error Occurs because the arithmetic performed in a machine involves numbers with only
a finite number of digits, with the result that calculations are performed with only approximate repre-
sentations of the actual numbers.
It occurs because the arithmetic performed in a machine involves numbers with only a finite number of
digits, with the result that calculations are performed with only approximate representations of the actual
numbers. A number can be shortened either by
1. Chopping off, or discarding, the extra digits. That is, the digits in the mantissa beyond the length
that can be stored are simply left out.
2. Rounding, in which the last digit that is stored is rounded.
Rounding rule In order to round-off a number to n significant digits drop all the digits to the right
of the nth significant digit or replace them by 0s’ if the 0s’ are needed as place holders, and if this
discarded digit is
EA = |X − x|
Definition: 4 The relative error of an approximate number x is the ratio of the absolute error of the number
to the absolute value of the corresponding exact number X, where X ̸= 0. It is denoted by ER and given by
EA
ER =
X
Definition: 5 The percentage error is 100 times the relative error. It is denoted by Ep .
Ep = ER × 100%
Example: 2 Determine the absolute and relative errors when approximating X by x when
Example: 3 Consider the two nearly equal numbers X = 9890.9 and Y = 9887.l. Use decimal floating point
representation (scientific notation) with three significant digits in the mantissa to calculate the difference
between the two numbers, (X − Y ) and determine the absolute and relative errors using
a. Rounding
b. Chopping
′ f (x + h) − f (x)
f (x) ≊
h
In the previous section, we discussed how to calculate true errors. Such errors are calculated only if true
values are known. But mostly we will not have the luxury of knowing true values as why would you want to
find the approximate values if you know the true values. So when we are solving a problem numerically, we
will only have access to approximate values. We need to know how to quantify error for such cases.
Definition: 6 Approximate error is denoted by Ea and is defined as the difference between the present
approximation xk+1 and previous approximation xk . That is
Ea = xk+1 − xk
Definition: 7 Relative approximate error is denoted by ϵa and is defined as the ratio between the approximate
error and the present approximation. That is
Ea
ϵa =
xk+1
In a numerical analysis that uses iterative methods, a user can calculate relative approximate error ϵa at
the end of each iteration. The user may pre-specify a minimum acceptable tolerance called the pre-specified
tolerance, ϵs .
If the absolute relative approximate error ϵa is less than or equal to the pre-specified tolerance ϵs , that
is, ϵa < ϵs , then the acceptable error has been reached and no more iterations would be required.
Alternatively, one may pre-specify how many significant digits they would like to be correct in their
answer. In that case, if one wants at least m significant digits to be correct in the answer, then you would
need to have the absolute relative approximate error,
ϵa ⩽ (0.5 × 102−m )
Example: 5 If one chooses 6 terms of the Maclaurin series for ex to calculate e0.7 , how many significant
digits can you trust in the solution? Find your answer without knowing or using the exact answer.
1.4 Propagation of errors
Let u be a function of several independent quantities x1 , x2 , . . . , xn which are subject to errors of magnitudes
∆x1 , ..., ∆xn respectively. If ∆u denotes the error in u then
u = f (x, x2 , ..., xn )
Using Taylor’s theorem for a function of several variables and expanding the right hand side we get
1.5 Instability