0% found this document useful (0 votes)
14 views9 pages

Error Estimation in Numerical Methods

Uploaded by

ahmedhas0966
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views9 pages

Error Estimation in Numerical Methods

Uploaded by

ahmedhas0966
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Numerical Methods for Statistics (Math-3061)

Chapter One: Basic concepts in error estimation


Introduction
Analytical and Numerical methods are two general methods in which we solve a wide range of
mathematical problems related to Engineering, and other sciences.

Analytical methods are those which produce exact solutions for mathematical problems. These methods
have limited practical applications & are used only for few classes of mathematical problems.

Numerical methods are those by which approximate solutions are obtained for mathematical problems.
These methods involve large number of tedious arithmetic calculations. Numerical methods may be
divided in to two types: direct and indirect methods.

Direct methods: refers to a procedure for computing solutions using a formula that is mathematically
exact. Direct methods are subjected to rounding errors and hence, they don’t give exact solutions.

Iterative methods: are that which start with an initial approximation and which, by applying suitable
chosen procedures, leads to successive, better approximations. The process will be repeated until the
required accuracy is achieved.

The study of error is a central concern of numerical analysis since most numerical methods give answers
that are only approximations to the true desired solution.

Error = true value – approximate value

The errors associated with both calculations & measurements can be characterized with regard to their
accuracy & precision.

 Accuracy refers to how closely a computed or measured or calculated or approximated value


agrees with the true value.
 Precision refers to how closely individual computed or measured values agree with each other.

We will use the collective term error to represent both the inaccuracy & imprecision of our predictions.

1.1 Sources of errors

The following are the main sources of errors in obtaining numerical solutions in mathematical problems.
1. Modeling error: an error which is caused by during an attempt to give mathematical relationships
between certain quantities or parameters of the physical situation.
 It is an error comes from the mathematical model used to represent a physical system.
2. Inherent/ human error Data uncertainty: an error involved due to uncertainty of physical/ input
data. This error exists before any numerical method applied. Measurement error
3. The numerical methods used: a numerical method is usually applied to solve some other simpler
problems; which approximates the originally given problem, even if initial datas are void of errors
all the arithmetic operations are ideally performed, they yield the solution of the original with
some error which is called the error of the method.

Page 1 of 9
4. Computational error: in numerical computations, we usually come across two types of errors;
round off and truncation errors.
I. Round off error: is an error created due to approximate representation of numbers. It arises
because it is impossible to represent all real numbers exactly on a finite- state machine as a
computer numbers have limited number of digits.

Although quantities such as represent specific quantities, they cannot be expressed exactly
by a limited number of digits. Because computers retain only a finite number of significant figures, such
numbers can never be represented exactly. Therefore, we are forced to approximate numbers with a fixed
finite number of digits in a computer even though they are actually infinite digits representation. The
omission of the remaining significant figures is called round off error.

For example: , then when we consider some of the digits for a


computation, we may take 3.1, 3.14, 3.142, … using round off a number to two, three, four, … digits
rounding. Here the round off error will be obtained by subtracting these numbers from the number
 Here may be represented as 0.33333 on pc. Then the round of error in this case is:
.
II. Truncation error: are those that result from using an approximation in place of an exact
mathematical procedure to make it easier (or possible) to solve a problem. This includes
truncation of an infinite series to a finite number of terms. Generally it is defined as the
error caused by truncating (cutting off) a mathematical procedures.

Example. Consider by chopping a part of the series one can use the following to
calculate ;

Taylor’s theorem
Suppose f has n+1 continuous derivatives on [a, b]. Then the Taylor series for about in [a, b] is given by:

In the case , the Taylor series is called Maclaurin series.


For example, the Maclaurin series for is given by:

The series has an infinite number of terms but when someone use this series to calculate , only a finite
number of terms can be used.
For example, if one used three terms to calculate , then . Therefore the truncation error
for such an approximation is given by:
Truncation error =
Exercise 1:
Evaluate for the following terms then after, find the truncation error for these terms:
a) three terms b) four terms c) five terms
Page 2 of 9
1.2 Approximation of errors

Although the numerical technique yielded close estimates to the exact analytical solutions, there are errors
the numerical methods involve ‘’approximations’’

Decimal places & significant digits (or figures)


Round off rule to discard the and all subsequent decimals (rounding up, rounding down).
A number is rounded off by dropping one or more digits at its right. If the digit to be dropped is less than
5, then we leave the digit to its left as it is and if the digit to be dropped is greater than or equal to 5, then
we increase the digit to its left by 1.

Let be a real number having decimal representation. If a number x is correctly rounded to k decimal
places, we denote the resulting approximation of x by .

Example: Let x = 21.71938, then


, ,

Significant digits are digits beginning with the left most non-zero digit and ending with the right most
correct digit, including final zeros that are exact.
Rules apply to find the number of significant digits in a number:
1. All non-zero digits in the number are significant figures.
Example: 178, and 254368 have 3 and 6 sig. figures/digits respectively
2. All zeros between two non-zero digits in the number are significant figures.
Example: 20.3, and 102043 have 3 & 6 sig. figures/digits respectively
3. Any zeros before (left of) the first non-zero digit in the number are not significant figures. (They
serve as place holders)
Example: 0.45, and 0.0002506 have 2 & 4 sig. figures/digits respectively
4. (a) Any zeros after non-zero digits in the number without a decimal point are not significant figure
Example: 200 and 237000 have 1 & 3 sig. figures/digits respectively
(b) Any zeros after non-zero digits in the number with a decimal point are significant.
Example: 132.0, 0.47000 and 0.00507600 have 4, 5 and 6 sig. figures/digits respectively

N.B: 200 may have 1, 2 or 3 sig. figures/digits, depending on the context


If a number x is correctly rounded to n significant digit number, we denote the resulting approximation of
x by .
Example 1): let x = 67.3065419, then , ,
2) let x = 0.0029539, then ,

Exercise 2:
1) Let x = 207.81097830, then find
, , , , ,
2) Determine the number of sig, figures/digits of the following numbers
a. 140.00234 b. 0.0045090 c. 154100 d. 154100.0
3) Approximate the numbers correct to three decimal places & four sig, figures/digits.
a. 18.34209 b. 0.024009 c. 100.0068 d. 678

Page 3 of 9
1.3 Rounding off errors
Number system
The number system that we are most familiar with is the decimal (base-10) number system. A base is the
number used as the reference for constructing the system. The base-10 system uses the 10 digits 0, 1, 2,
…,9 to represent numbers.
Numbers on the computer are represented with a binary (or base-2) number system. The base-2 number
system uses the 2 digits; 0 and 1to represent numbers.
For example the binary number system 101 is equivalent to

Computer Representation of Numbers


Numerical round off errors are directly related to the manner in which numbers are stored in a computer. It
produced because computers use a base-2 representation, they cannot precisely represent certain exact
base-10 numbers. The discrepancy introduced by such omission of significant figures is called round off
errors.

When we consider storage scheme of computers, numbers are classified as integers (numbers without
decimal point) and real numbers (those with a decimal point).
Integer Representation
The most straightforward approach to represent integers on a computer is the signed magnitude method,
employs the first bit of a word to indicate the sign, with a 0 for positive and a 1 for negative the remaining
bits are used to store a number.
Example: Represent -109 on a 16 bit computer using the sign magnitude method
Solution: the base-2 representation of -109 is
Of 16 bits, the first bit holds the sign, the seven bits in the binary representation of -109 can be stored in
the right most bits of the memory word & the remaining are filled with zeros.

Therefore the integer value -109 would be stored on a 16 bit computer as: 100000001101101
Floating point representation
Fractional quantities are typically represented in a computer using floating point format. In this approach
which is a very much like scientific notation, the number is expressed as:

Example 1: A value like 254.589 could be represented by the floating point base-10 system number as:
, which is often displayed as 0.254589E3. However, normalization would
yield
In both situations, we have normalized the floating point representation, meaning that we have shifted the
decimal point to make the leading digit non zero.

Remark! Another name often used for floating point numbers is real numbers.

Page 4 of 9
The institute for Electrical & Electronic Engineers (IEEE) provides standards for binary and decimal
floating point numbers. This IEEE 754 floating point format specifies how real numbers can be stored in
two major formats: single precision, which uses 32 bits & double precision which uses 64 bits.

In the IEEE 754 format for single & double precision (the number of bits used for

precision length sign exponent Mantissa


Single 32 1 8 23
double 64 1 11 52

In any precision the leftmost bit also known as the most significant bit (MSB) stores the sign of a
signed number, 0 for positive & 1 for negative
The next 8 bits (for single precision) & 11 bits (for double precision) store the binary
representation of (the exponent & the exponent ) respectively, the numbers
127 & 1023 are called bias. And this stored exponent are called biased exponent.
The right most 23 bits & 52 bits called the mantissa store the bits to the right of the binary point (or
the fractional part of the normalized binary bits) of a number padded to 23 & 52 bits number
respectively for single & double precisions.

Example 2. A value 39.125 can be represented in a binary (base-2) number system as:
and its normalized floating point format as .

Since 39.125 is a positive number, the sign bit is 0.

The stored exponent


And the stored mantissa would be padded to 23 bits for (single) & 52 bits for (double)
precisions.

Hence the number 39.125 is typically stored using the IEEE 754:
in single precision floating point format as:

In double precision floating point format as:

Exercise 3:
What could be the stored bits of the decimal number -57.625 using single & double precision floating
point format?

Page 5 of 9
1.4 Absolute & Relative error
Numerical errors arise from the use of approximations to represent exact mathematical operations &
quantities.

There are three ways in which we measure the magnitude or quantity of an error (or ways of expressing
the size of the error in a computed result)

If is an approximation to the exact value x, then

 The absolute error (true error) in is


 The relative error in is

 The percent relative error in is

Example 1. Compute the absolute, relative and percent relative error of the approximation
by

solution:

One of the challenges of numerical methods is to determine error estimates in the absence of knowledge
regarding the true value. For example, certain numerical methods use an iterative approach to compute
answers. For this situation, an alternative is to normalize the error using the best available estimate of the
true value, that is, to the approximation itself, as in

In such an approach, the present/current approximation is made on the basis of the previous
approximation. This process is performed repeatedly, or iteratively, to successively compute better and
better approximations.

The sign of may be positive or negative, we interested in whether the absolute value is lower than a pre
specified tolerance ( , not to the sign of the error.

Thus, the computation is repeated until


… stopping criteria

We can relate ( to the number of significant figures in the approximation, so we can assure that the
result is correct to at least n significant figures if the criteria is met

Example: given the Maclaurin series expansion of the exponential function


. Estimate using series, add terms until the absolute value of
approximate error fall below a pre specified error conforming with the three significant figures.

Page 6 of 9
Solution:
Using one term:
Using two terms: here

Using three terms:


here

terms Summation
result
1 1 -
2 2 0.5
3 2.5 20
4 2.666666667 6.25
5 2.708333333 1.538461538
6 2.716666667 0.306748466
7 2.718055556 0.05109862
8 2.718253968 0.00729927

Thus, after 8 terms are included, the approximate error falls below the pre specified error and the
computation is terminated i.e., . Hence 8 terms are required to get a
solution with less than a pre specified error.

Exercise 4:
1) The three approximations of are given as 0.6, 0.66, 0.67. Then find the absolute, absolute relative
and percent absolute relative errors for each approximation.
2) Let . Estimate using series, add terms until the absolute value of
approximate error fall below a pre specified error conforming with the two significant
figures.

1.5 Propagation of error (or uncertainty of errors)


Errors of input numbers of an arithmetic procedure cause errors in output numbers. The transmission of
this initial error through the procedure is called propagation of errors
i. Addition and subtraction
Example: Let and , then find the bounds for the propagation in
adding & subtracting the two lengths .
Solution:
 Maximum possible value of
 Minimum possible value of
 Maximum possible value of the sum
 Minimum possible value of the sum
 The median value of the sum is when
Hence, . The required sum is therefore
 Maximum possible value the difference
 Minimum possible value the difference
 The median value of the sum is when
Hence, . The required difference is therefore
Page 7 of 9
Note: when adding & subtracting two quantities, the uncertainty (propagation error) in the result is the
sum of the individual uncertainties.
That is, if , then , where are the uncertainties on quantity a and
quantity b respectively. And is the total uncertainty (or propagation error)
ii. Multiplication & Division
Example: Let the length and the width of a rectangle are and respectively.
Then find the propagation error of the area of a rectangle.
Solution:
Let
 Maximum possible value of &
 Minimum possible value of
 Maximum possible value of the area
 Minimum possible value of the area
 The median value of the area is
Here the propagation error under the area
Thus,
Or! Using the formula

Note: when multiplying and/ or dividing measure values, the uncertainty (propagation error) in the result
is the sum of the individual fractional uncertainties.
That is, if , then , where are the uncertainties on quantity a , b
and quantity c respectively. And is the total uncertainty (or propagation error)
Exercise 5:
Let . Then find the propagation error in
a) adding & subtracting b) multiplying & dividing the two numbers .

Propagation of errors in function evaluation


Function of a single variable
Let be a function that depends on x which is in error. Let the absolute error in x be x .
Then , we have
The error in y is given by
From Taylor series, we have

Dropping the second and higher order derivatives and rearranging, we get

Hence the absolute error in y can be estimated by


Example: Let an let x be approximated by 2 with all error
. Then determine the error in .
Solution: here ;
Hence the error in
Function of more than one variable
For n independent variables having errors
If is a function of several variables with an error in each be , then

Page 8 of 9
Example: let and with errors 0.002, 0.001, and 0.003 respectively.
Determine the error in
Solution: here

Hence

Exercise 6:
a) Let and let x be approximated by 3 with all error
. Then determine the error in .
b) let and with errors 0.002, 0.001, and 0.002 respectively.
Then determine the error in
c) In the formula , determine the error in if and with errors
and respectively.

1.6 Stability in Numerical Analysis


Sometimes a single calculation can be done in several ways, all of which are algebraically equivalent but
in practice when we perform on digital computers yield different results. Some calculations might damp
out errors that occur; others might magnify such errors.

A numerical method is said to be stable if it doesn’t magnify the computational errors, otherwise it is
called instable (or an algorithm is instable if rounding errors cause large errors in the result). Generally in
numerical analysis, we want to use numerical methods that have no greater sensitivity to small errors.

Example: Consider the function In four significant digits arithmetic,

while, actually, f (123456)= 0.00142303 in six sig. figures.


Here
So, our calculated answer is with an error 29.7%.
However, we can write the function equivalently by , using this
formula:

Here our calculated answer is with an error 0%.


Thus, even though, these two formulae are of the same, they brought different answers with errors 29.7%
& 0%. Therefore, the second formula is stable while the first formula is instable.
As we observe in the example above, we have to select formulae carefully to get a good accuracy. Using
large number of digits or taking more terms in the series may also minimize the error.

Page 9 of 9

You might also like