You are on page 1of 7

Contents

1 Basic concepts in error estimation 1


1.1 Sources of errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Rounding off errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Absolute and relative errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Propagation of errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Instability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1
Numerical Method

Ulfata E.

July 28, 2022


Chapter 1

Basic concepts in error estimation

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.

1. The significant figure in a number in positional notation consists of:

a. All non-zero digits and


b. Zero digits which
– lie between significant digits
– lie to the right of decimal point, and at the same time to the right of a non-zero digit
– are specifically indicated to be significant

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.1 Sources of errors


Usually we come across the following types of errors in numerical analysis.

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.

1.2 Rounding off errors


Definition: 2 The error that is produced when a calculator or computer is used to perform real number
calculations is called round-off error.

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

a. Less than 5, leave the remaining digits unchanged


b. Greater than 5, add 1 to the last retained digit
c. Exactly 5 and there are non-zero digits among those discarded, add unity to the last retained
digit. However, if the first discarded digit is exactly 5 and all the other discarded digits are 0s’,
the last retained digit is left unchanged if even and is increased by unity if odd.

Example: 1 Round the following number to four significant figures


Numbers Using Chopping Using Rounding
1.6583
30.0567
0.859378
3.14159

1.3 Absolute and relative errors


Definition: 3 The absolute error of an approximate number x is the absolute value of the difference between
the corresponding exact number X and the number x. It is denoted by EA . Thus,

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

a. X = 0.3000 × 101 and 3.100 × 101

b. X = 0.3000 × 10−3 and 3.100 × 10−3

c. X = 0.3000 × 104 and 3.100 × 104

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

Example: 4 The derivative of f (x) at a particular value of x can be approximately calculated by

′ f (x + h) − f (x)
f (x) ≊
h

. For f (x) = 7e0.5x and h = 0. find



a. the approximate value of f (2)

b. the true value of f (2)

c. the absolute error in approximating f (2)

d. the absolute relative error in approximating f (2)

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 )

u + ∆u = f (x1 + ∆x1 , x2 + ∆x2 , ..., xn + ∆xn )

Using Taylor’s theorem for a function of several variables and expanding the right hand side we get

1.5 Instability

You might also like