Numbers and Errors: Approximation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Chapter

Numbers and Errors


1.1 INTRODUCTION

Numerical analysis is widely used by engineers and scientists to solve their problems. A major
advantage for numerical analysis is that a numerical answer can be obtained even when a problem
has no analytical solution. However, result from numerical analysis is an
approximation, in general.
which can be acquired as desire. The reliability of the numerical result will depend on an error
estimate or bound, therefore the analysis of error and the sources of error in numerical methods
is also a critically important part of the study of numerical analysis.
1.2 REPRESENTATION OF NUMBERS
There are two kinds of numbers, exact and approximate numbers. Examples of exact numbers
are
1, 2, 3, , 2 , T, e etc. Approximate number is those that represents a number to
a certain degree of accuracy. Thus, an approximate value of t is 3.1416.
In the usual decimal system of representation, any positive real number x may be written as

X=Tnn-1 1o-1'-2
where each r, takes one of he values of 0, 1, 2, .,9 and r, #0. This representation is known as fixed
point representation. There is another type of representation, called floating point representation.
In this representation, any positive real number x may be written.as
X = 0.s_S_ . S_mX 10°
where each , takes one of the values of 0, 1, 2, .., 9 and s #0. Here x is said to have m significant
digits, wheres is the first significant digit or first significant figure, s.g is the second significant
digit and so on. The fraction s 2 . is called mantissa and the integer n is called exponent.
For example, the numbers 2.135, 0.6046 contain four significant digits, but the number 0.0044 has
because 0.0044 44 x 102.
significant digits,
=
two
The exponent n is limited to a range < n< L. During the calculation, if some computed
number has an exponent n > L then we say, the memory overflow or if n <1, we say the memory
underflow
In the case of overflow, computer will usually produce meaningless results or simply prints the
to such a calculation is not a number. The
symbol NaN, which means, the quantity obtained due
underflow is less serious because in this case, a computer will simply consider the number as zero.

1.3 RoUND OFF


In carrying out various numerical computations, there often arises the necessity of rounding
of numbers, that the number of decimal places. It is usual to round off numbers
is, decreasing
according to the following rule:
2 NUMERKAL MiHODs Wm4 BASIC CONCE1S IN C PrOGRAMMING
To rounud ott a number
discard all the digits to the ''o''- (n ) to n places of decimal,
right of the n th place and it
M1 has one oft the values 0. 1, 2. 3, 4, then the round off number is

mm1. 'o-'-2
() (n1) has one of the values 6, 7, 8, 9, then the round off number is

"
1 ) , tollowed by al least one nonzero digit, then the round off number is
m-1.. F1"o:-1'2 . ( t1)
(iv (n1) and r(n ) is the last nonzero digit, then the round off number is
m m 1 . "'u-1'-2 . (r,, + 1) if r_ is odd
or, mm-1.. "1'o-1'-2 . n if r , is even
Moreovet, if x" is the rounding off value of x up to n decimal places, then we can say that x is
the approximate value ofx correct up to n decimal places and x =x + e10- where - ses

NOTE: In floating point representation, if y" is the


off value of y up to n significant
rounding
fgures, then we can say that y" is the approximate value of y correct up to n significant
figures or digits. For examples
1. The number 10.0572 rounded off to 2 decimal
places is 10.06.
2. The number 2.5391 rounded off to 4 significant figures is 2.539 (2.5391 = 0.25391
x
10 = 0.2539 x
10 =
2.539).
3. The number 0.009155 rounded off to 3 significant figures is 0.00916 (0.009155 =
0.9155 x 102 =0.916 x 10-2 =
0.00916).
1.4 ERRORS IN COMPUTATIONS
In numerical computation, the quantity "exact value approximate value" is called the error.
(a) Sources of error: The errors in numerical computation
may occur in following three ways.
G) Inherent Error: The inherent error is that error which is already present in the data
of the problem before its solution. The inherent error arises either due to the
simplified
assumptions in the mathematical formulation of the problem or due to the errors in
the physical measurements of the parameters of the problem. Inherent
error can be
minimized by obtaining better data, but can not be removed even if the
problem is
solved correctly.
(ii) Truncation Err«:: Truncation error: arise when an infinite process is replaced by a
finite one. For ex mple, conside. thi Tay.cr series expansion
e
If the formula is used to calculate eu.l we get
12 1"
=1++
1! .+ n!
Where do we stop the calculation ? How many terms do we include ? Theoretically
the calculation will never stop. There are always more terms to add on. If we do stop
NUMRER AN ERRORS
atter a
hnite number
ef teTms,
erms, we will not get the exact answer For example tt we d
take the thrst we will not get the exact
three teTms
as the anse
approximation We et

For this
-19.0-
calculation. the truncation
(iii) Round off
Error: ihis ertor
s
error arises due to
x-x errot

utalon tor
rounding off the numbers during numerica
rounding o
example. a number like may be represented as 0.9
ouna ot efror
in this case
|-0.3333. Then there are other numbers that
ca
not be
Tepresented exactly. For example, and
in calculation.
T are numbers that need to be
apprun
(6) Loss of
Significance: Loss of sienificance occurs when two nearly equal numbers
subtracted to produce a result
much smaller than either of the
are
1s that the
number of significant original numbers. Ihe eect

of digits in the result may be reduced unacceptably. Loss


significance also arises during multiplication or division of a small number by
small number. For
example. let x = 2.123456 and y 2.123434. then both
anone
seven
significant figures, however x y =0.000022 has two significant figures. numbers nave =

Theretore
X
y losses five significant figures
-

although x and y are both seven signihcant hgures.


1.5 MEASUREMENT OF ERRORS

(i) Absolute Error If x is a true value of a quantity and x* is the approximate value, then
E = |x - x| is called the absolute error. 'The unit of exact or unit of approximate values

expresses the absolute error.


(ii) Relative Error If x is a true value of a quantity and x" is the approximate value, then Ep
. (provided x * 0) is called the relative error. The relative error is independent
of units.
(ii) Percentage Error : If x is a true value of a quantity and x is the approximate value, then

FEp
of units.
x 100% is called the percentage error. The percentage error is also independent

NOTE 1 If a number is correct up to n decimal places then E S x 10-". For example, if x


= 3.125434 is the rounding off value of x = 3.1254 up to 4 decimal places, then E=

10-4.
- x =0.000034 x

10", the number is surely correct up to n significant figures.


NOTE 2: If E, s x
Theorem: If a number is correct up ton significant digits and the first significant digit of the
is less than
number is k, then the associated relative error
kx10-1
number x and n be the
decimal places of an exact
Proof Let m be the number of correct
of X.
number of correct significant figures - m. If k be the first
number of digits of integral part of x is n
Case 1 : Let m < n. Here the
error
Significant figure of x, then the absolute

You might also like