Numerical CH One
Numerical CH One
October 5, 2023
Chapter 1
1
Many of the linear problems can be solved analytically
However, many nonlinear equations have no such explicit solution. For these,
numerical methods based on approximation can be developed which produce roughly
correct results.For instance
δ = |a − A| ≤ δa i.e. a − δa ≤ A ≤ a + δa
Manalebish D: 2 2
An error of 0.01cm in a measurement of 10m is better than the same error in a
measurement of 1m. Thus
The relative error of a is given by
δ a−A a
ε= = = −1
|A| A A
δa δa
εa = ≈
a − δa a
1
Here εR = 0.1x 100 = 0.001 Then δR = RεR = (29.25)(0.001) ≈ 0.03 Therefore,
R − δR ≤ R ≤ R + δR Then 29.22 ≤ R ≤ 29.28.
Percentage error: The percentage error in a which is the approximate value of
A is given by ε × 100 = εa × 100 it also does not have units.
Manalebish D: 3 3
1. Errors of the problem (instability) When setting up a mathematical model,
i.e. formulating the problem in mathematical terms.
3. Experimental (or inherent errors) These errors are found in the statement of
the problem and not in the solution. These are errors of the given data when
‘a’ is determined by physical measurements, the error depends upon the mea-
suring instrument. or due to the simplified assumption in the mathematical
formulation of a the problem.
4. Truncation (residual) errors This type of error is rising from the fact that
(finite or infinite) sequences of computational steps necessary to produce an
exact result is truncated prematurely after a certain number of steps. Trun-
cation error is a type of algorithm error. a good example is using Taylor series
formula for finite terms.
Example 4
∞
x
X xn x2 x3
e = is approximated as ex = 1 + x + +
n=0
n! 2! 3!
5. Rounding errors This error is due to the limitation of the calculating aids,
numbers have to be rounded off during computations. It is a process of
dropping unwanted digits.
6. Programming errors (Blunders) These are due to human errors during pro-
gramming (in using computers) bugs/debugging. This can be avoided by
being careful
Manalebish D: 4 4
7. Machine errors This is due to machine malfunctions (Land calculators) usu-
ally it may be obtained as a result of a calculation involving several steps
each of which is subject to errors of one or more of the above steps.
Significant digits (figures)are the numbers of digits used to express the number.
The digits 1, 2, 3, . . . , 9 are significant digits and ′ 0′ is also a significant figure except
when it is used to fix the decimal point or used to fill the space of discarded digits.
A significant digit of a number ‘a’ is any given digit of a, except possible for
zeros to the left of the first nonzero digit that serve only to fix the position of the
decimal point. Those which carry real information as to the size of the number
apart from exponential position. Significant digits are counted from left to right
starting with the left most non zero digit.
Decimal place express the number of digits after(to the right of) the decimal
point.
Manalebish D: 5 5
Example 6 The numbers 2384, 0.2384, 0.0002384 have 4 significant digits
2, 380, 000 = 2.38 × 106 with 3 significant digits and 2 decimal place
0.000486 = 4.86 × 10−4 with 3 significant digits and 2 decimal place
2.0682 contain 5 significant digits and 4 decimal place
We say that the first n significant digits of an approximate number are correct if
the absolute error does not exceed one half unit in the nth place. That is if in
equation (1.1)
1
δ = |a − A| ≤ 10m−n+1
2
Then the first n digits αm , αm−1 , · · · , αm−n+1 are correct (and we say the number
a is correct to n significant figures.)
Example 7
with
1 1 1
δ = |35.97 − 36.0| = 0.03 ≤ (10−n+1 ) = (10−2+1 ) = (10−1 ) = 0.05
2 2 2
1 1
δ = |5.18 − 5.2| = 0.02 ≤ (10−2+1 ) = (10−1 ) = 0.05
2 2
Manalebish D: 6 6
3. A = 1596 ≈ 1600 correct to 2 significant digits Since we want 2 significant
digits we go up to 15 then the first of the digits being left out is 9 > 5 hence
rounding up gives 16 here the place value of 9 is is 101 implies m = 1 with
1 1
δ = |1596 − 1600| = 4 ≤ (10m+1 ) = (101+1 ) = 50
2 2
1 1
δ = |1796 − 2000| = 204 ≤ (10m+1 ) = (102+1 ) = 500
2 2
1. If the first of the discarded digits is less than 5 leave the remaining digits
unchanged (rounding down)
2. If the first of the discarded digits is greater than 5, add 1 to the nth digit
(rounding up)
Example 8
Manalebish D: 7 7
6.125753 ≈ 6.1round to (1 decimal place) δ ≤ 12 10−1 = 0.05
Since we want 2 significant digits we go up to 6.1 then the first of the
digits being left out is 2 < 5 hence rounding down gives 6.1 here the
place value of 2 is 10−2 implies n = 2 with
δ = |6.125753 − 6.1| = 0.025753 ≤ 12 (10−2+1 ) = 12 (10−1 ) = 0.05
≈ 6.12 round to (2 decimal place) δ ≤ 12 10−2 = 0.005
≈ 6.126 round to (3 decimal place) δ ≤ 21 10−3 = 0.0005
≈ 6.1258 round to (4 decimal place) δ ≤ 21 10−4 = 0.00005
Since we want 5 significant digits we go up to 6.1257 then the first of the
digits being left out is 5 and since 7 is odd then even digit rule gives 6.1258
here the place value of 5 is 10−5 implies n = 5 with
δ = |6.125753 − 6.1258| = 0.000047 ≤ 21 (10−5+1 ) = 12 (10−4 ) = 0.00005
Rounding errors are most dangerous when we have to perform more arithmetic
operations.
22 355
Example 9 Approximate π = 3.14159265 using 7 and 113 correct to 2 decimal
place and 4 decimal place and find the corresponding absolute and relative errors.
22 355
= 3.1428571 = 3.1415929
7 113
22 355
δ1 = | − π| = 0.0012645 δ2 = | − π| = 0.0000002668
7 113
δ1 δ2
ε1 = = 4.025 × 10−4 ε2 = = 8.49 × 10−8
|π| |π|
Manalebish D: 8 8
then δ2 = f1 (a′ ) − f (a′ ) is the truncation error. But in calculations we obtain, say,
f2 (a′ ) instead of f1 (a′ ) which is wrongly computed value of a wrong function of a
wrong argument. The difference δ3 = f2 (a′ ) − f1 (a′ ) is termed as the error from
the rounding. The total error is then the propagating error δ = f2 (a′ ) − f (a) =
δ1 + δ2 + δ3 .
1
Example 10 Determine e 3 with 4 decimal places.
We compute e0.3333 instead of e0.3̇ with initial error
1
δ1 = e0.3333 − e 3 = e0.3333 1 − e0.0000333... = −0.0000465196
2 3 4
Next, we compute ex from ex = 1 + x + x2! + x3! + x4! for x = 0.3333 with truncation
error
(0.3333)2 (0.3333)3 (0.3333)4
δ2 = 1 + 0.3333 + + +
2! 3! 4!
(0.3333)2 (0.3333)3 (0.3333)4
− 1 + 0.3333 + + + + ...
2! 3! 4!
(0.3333)5 (0.3333)6
= − + + . . . = −0.0000362750
5! 6!
Finally, the summation of the truncated series is done with rounded values giving
the result
x2 x3 x4
1+x+ + + = 1 + 0.3333 + 0.0555 + 0.0062 + 0.0005 = 1.3955
2! 3! 4!
instead if we go upto 10 decimal places we would have 1.3955296304 Then
Note:-
Investigation of error propagation are important in iterative processes and compu-
tations where each value depends on its predecessors
Manalebish D: 9 9
1.5 Instability
In some cases one may consider a small error negligible and want to suppress it
and after some steps the accumulated error may have a fatal error on the solution.
Small changes in initial data may produce large changes in the final results.
This property is known as ill-conditioned. ill-conditioned problem of computing
output value y from input value x by y = g(x) : when x is slightly perturbed to x
the result y = g(x) is far from y
A well conditioned problem has a stable algorithm of computing y = f (x), The
out put y is the exact result y = f (x), for a slightly perturbed input x which is close
to the input x. Thus if the algorithm is stable and the problem is well conditioned
the computed result y is close to the exact y
Algorithm is a systematic procedure that solves a problem. It is said to be
stable if its output is the exact result of a slightly perturbed input.
Numerical instability is a concept that refers to the propensity of an algo-
rithm or computational procedure to produce inaccurate results due to round-off
errors, truncation errors, or other computational issues. These errors may
be small initially but can accumulate and escalate in the course of iterations, lead-
ing to results that are significantly far-off from the expected or precise value.
Numerical stability is essential in performing precise and consistent compu-
tational operations. When an algorithm is numerically stable, it ensures that the
round-off or truncation errors do not markedly affect the end result.
Performance features that may be expected from a good numerical algorithm.
Accuracy:- This is related to errors, how accurate is the result going to be when
a numerical algorithm is run with some particular input data.
efficiency:- How fast can we solve a certain problem, rate of convergence of
floating point operations
If an error stays at one point in an algorithm and does not aggregate further
as the calculation continues, then it is considered a numerically stable error. This
Manalebish D: 10 10
happens when the error causes only a very small variation in the formula result.
If the opposite occurs and error propagates bigger as the calculation continuous,
then it is considered numerically unstable.
Manalebish D: 11 11