Numerical Analysis Chapter 1 Exercises
Numerical Analysis Chapter 1 Exercises
Numerical Analysis Chapter 1 Exercises
Chapter
Errors in Numerical
Computations
The solutions of mathematical problems are of two types: analytical and numerical.
The analytical solutions can be expressed in closed form and these solutions are error
free. On the other hand, numerical method is a division of mathematics which solves
problems using computational machine (computer, calculator, etc.). But, for some
classes of problems it is very difficult to obtain an analytical solution. For example, the
Indian populations are known at the years 1951, 1961, 1971, 1981, 1991, 2001. There
is no analytical method available to determine the population in the year, say,
2000.
But, using numerical method one can determine the population in the said year. Again,
sometimes we observed that the solutions of non-linear differential
equations cannot be
determined by analytical methods, but, such problems can easily be solved by
numerical
methods. Numerical computations are almost invariably contaminated by errors,
and
1t 15 important to understand the source,
propagation, magnitude, and rate of growth
of these errors.
ln this age of computer, many complicated and large problems are solved in signifi-
catly Jess táme. But, without using numerical methods we cannot solve any umathemat-
Cal problem using computer, as analytical methods are not
suitable to solve a problem
Dyooputer. Thus, the numnerical methods are highly appreciated
y Mathematicians, Computer Scientists, Statisticians, Engineers and extensively used
and others.
sin =
This is an infinite
series expansion.
31T317
valye of sin z for If only first five pute t.
a given z, then we terms are taken to
Gue to
the truncation of obtain an approximate
error {Etrune) the series. result. Here, tne or ofeu
is given by Suppose, we retain t
terms, the truncäti
the first n terms L
Etrunc 2n+1
It may be noted
that the truncation (2n+1)!
error is independent
1.2 Exact of the computational mac
e compa
and Approximate
To solve Numbers
a problem,
Exact number two types
isclosed to thegives a true valueof numbers are
true value of a result used. They areexa approxim
and approximate
approximate number givos a value
numbo va
For example, in the statements 'a triangle has
three sides', 'there are 2000 people in a
locality', a book has 450 pages the numbers 3, 2000
and 450 are exact numbers. But,
in the assertions 'the height of a pupil is 178 cm', 'the radius of
the Earth is 6400 km',
the mass of a match box is ten gram', the numbers 178, 6400
and 10 are approximate
numbers.
This is due to the impertection of measuring instruments we
use. There are no
absolutely exact measuring instruments; each of
them has its own accuracy. Thus, the
height of a pupil is 178 cm is not absolute measurement.
In the second example, the
radius of the Earth is very concept; actually, the Earth is not
a sphere at all, and we
can use its radius only in approximate terms. In the last example,
the approximation
of the number is also defined by the fact that different bOxes may have
different masses
and the number 10 defines the mass of a particular box.
One important observation is that, same number may
be exact as well as approximate.
For example, the number 3 is exact when it represents
the number of sides of a triangle
and approximate if we use it to represent the number r
when calculating the area of a
circle using the formula rr2. -
Independently, the numbers 1,2,3,,2V2,T, e, etc.
written inthis manner are exact.
An approximate value of is 3.1416, a better approximation
of it is 3.14159265. But
one cannot write the exact value of r.
The accuracy of calculations is defined by the number of digits
in the result which
enjoy confidence. The significant digits or significant figures
of a number are all itš
digits, except for zeros which appear to the left of the first non-zero
digit. Zeros at the
end of a number are always significant digit.
For example, the numbers 0.001205 and
356.800 have 4 and 6 significant digits respectively.
in practical calculations, some numbers occur containing large
number of digits, and
1t will be necessary to
cut them to a usable number of figures. This process is called
rounding-off of numbers. That is, in rounding process the number is replaced by
another number consisting of a smaller number of digits. In that case, one or
several
digits keep with the number, taken from left to right, and
discard all others.
he following rules of rounding-off are commonly used:
5the discarded digits constitute a naumber which is larger than half the unit in the
last decimal place that remains, then the last digit that is left is increased by one.
fthe discarded digits constitute a number which is smaller than halfthe unit in
he last decimal place that remains, then the digits that remain do not change.
f the discarded diqits constitute a number which is equal to half the unit in the
sT decimal place that remains, then the last digit that is half is increased by one,
it is odd, and is unchonged if it is even.
ANALYSIS
4 NUMERICAL
Ar =T - TAl|
It may be noted firom the rounding
places then process that, if a
umber be rounded to m decimal
absoluteerror
x 10-. (1.2)
The absolute error measures
qualitative one, i.e., only the quantitative
does not show whether aspect of the error but
not the
accurate. For example, the measurement and calculation
the length and the width were
(whose division is 1 cm) of a table are measured
and the following results with a scale
cm and the lengthl = are obtained: the width w =
0.5 cm. It is obvious
1000.5 cm. In both cases the absolute error 5 +0.5
that the second measurement is same and it is
To estimate the quality was more accurate than
of calculations or measurements, the first.
is introduced. the concept of a relative error
Relative error:
The relative error (Sx) of
the number dA is
Ar Ar
or Trl#0 and jcA| # 0.
TA TT
This expression can be
written as
tT = TA(1tor) or tA = atT(1 + ox)
Note that relative error is
the absolute error when measuring 1 unit.
For the measurements of the length and the width
relative errors
ese
are
ow = = 0.1 and dl = 0.5
100
.
of the table (discussed earlier) the
= 0.005.
cases, one can conclude that the measurement of the length of
the table has
relatively more accurate than that of its width. So one conclusion can be drawn:
ETh relative error measures the quantity and quality of the calculation and measurement.
U8, the relative error is a better measurement of error than absolute error.
Percentage error:
The percentage
error of an approximate number c'a is dx x 100%.
It isa particular type of relative error. This error is sometimes called relative
per
tage error. The percentage error gives the total error while measuring 100 unit
of 1
unit. This error also calculates the quantity and quality of measurement.
Cn relative error ia
orT amall then t.he nercentage error is calculated.
ANALYSIS cann
SIgnilicant igures
NUMERICAL
6 n ot be
to
of a number correct
absolute error Exam
Note 1.3.1 The unit in the nth place.
greater than half a to the
independent of the 1:
unit o Solutic
percentage error are
relative error and measuring unit. The ab
Note 1.3.2 The absolute error depends on the
measurement, while The exa
(kamy
relative error and absolute error:
ifference between is bette
error and it 1s the total amount of
erro
ror
Absolute error measures only quantity of
by approximate value. While the
Solutie
relative error measures both the quantity Soluti
incurred
error while measuring one unit. The mumber
and quality of the measurement. It is the total
absolute error depends on the measuring unit, but, relative
error does not depend onTherefc
measuring unit.
and in
The rel
and rel
Example 1.3.1 Find the absolute, relative and percentage error in tA when cT =
In the
and A=0.333. error in
Solution. The absolute error
1.4 V
Ar=rA 0.333 1-0.999
3 A real n=
0.001
9 40000 c-
0.00033.
The relative error
0.00033 S
ample 1.3.3 Determine the absolute error and the exact number corresponding
to the approximate number TA 5.373 if percentage error is 0.010.
Solution. Here the relative error dr = 0.01%= 0.0001.
The absolute error Ar=|cA X ot|=5.373 x 0.0001= 0.00053730.00054.
The exact value=5.373 +0.00054,
Ranple 1.3.4 Find out in which of the following cases, the quality of calculations
15
is better: CT 08824 and yr= V517.141
17
Solution. To find the absolute error, we take the numbers
mumber of decimal digits as tA0.882353, y4V517.141428.
tA and YA with a larger
Therefore, the absolute error in rr is 0.882353 0.8824| 0.000047,
yr
and in is 7.141428. 7.1410.00043.
The relative error in TA is 0.00047/0.88240.00053 0.05%
and relative error in yAis 0.00043/7.141 0.00006020.006%
ww.w.w
In the second case the quality of calculation is better than the first case as relative
error in TT> relative error in yrT
+
a = d1 x 10 + da x 10 + dn x 10"m-n+I
nete d are the digits constituting the number (i = 1,2,...) with di # 0 and 10-itl
e
ne
value of the ith decimal position (counting from left).
digit du of the approximate number a is valid siguificant digit (or simply a
Valid digit) if it satisfies
the following inequality.
oie
number is correct up to n signijicant jigures and the first signijican
Theorem 1.1 f a
relative error is less than
digit of the number is k, then the
k x 10n-1
Proof. Let ta be the approximate value of the exact number wT. Also, let ca is Correc
up to n significant figures and m decimal places. Then there are three possibilities ma
occur:
) m <n
(i) m= n and
i) m> Tn.
We have by (1.2), the absolute error Ar 0.5 x 10-".
Case I. When m < n.
In this case, the total number of digits in integral part is
significant digit in zr, then
-
m. If k be the firs
Ar 0.5 x 10-m
T k x 107-m-1-
0.5 x 10-m
1
Since, 7n is a
2kx 10n-1-1
positive integer
and k is an integer
lies between l and
9,
2k 10x
for all k and
n except k =
-1>k x 10-
Hence n = 1.
an
Case III. When m> n.
T -
this case, the first signiticant digit k is at the (n -m+1) = (m-n-1)th position.
4Iso, the integer part is zero. Then Az 0.5x 10-m and Jzri k x 10-(m-n+1)
0.5 x 10-m
Therefore, 0.5 x 10-m
ec x 10-(m-n+1)- 0.5 x 10-m
ay 1 1
2kx10n-1-1kx 10-1
Hence the theorem.
Thus the absolute error in sum of approximate numbers is equal to the sum of the
absolute errors of the numbers.
From (1.4), it follows that the absolute error of the algebraic sum must not be smaller
than the absolute error of the least exact termn.
The following points should be kept in mind when adding numbers of different abso-
lute accuracy.
identify a number (or numbers) of the least accuracy (i.e., a number which has
the maximum absolute error),
(ii) more exact numbers so as to retain in them one digit more thn in the
nd-off
dentified number (i.e., retain one reserve digi)
perform addition taking into account all the retained digits,
(iv) round-off
the result by discarding one digit.
NUMERICAL ANALYSIS
10
corresponclin.
Subtraction vnlics of the
two approximate wwets
Consider ) and ra be
Ar are
where Ati and Arg
= t Ar2, theerrora
Then X Ari and A2 t2
t
and r spectivrly.
- a) |X1 zi|+ X, Hene - in
Therefore, 1X r|= |(X1-i)-(X2
Al= [Ar|+ |Arzl.
difference of two numbers is equal to tho. mlivi
Thus the absolute erTor in
absolute errors.
,
Example 1.5.1 Show that when an approximate mumber
t is mltiplied by an
act actor the relative error of the product is eqtial to the relative
appraxinnate number t and the absolute eiror is
error of the
absolnte number.
ktimes the absolute error of the
61
But, the absolute error A ATI kATi= k times the absoute error in
******ww*
***
X- = 1 +Ar1 1 C2 Ari -
t1 At2
2 + Ar2 2
2(2 + Ar2)
Tg tuth sides by s and taking absolute values:
Ari Ar2|
2
.
+Ar||
rr Lrz is sTnall as cnparel to r2, theu approxiately
Therefore, above r:]ation becocs
X Ar Ar2
(1.8)
t.heir91 f is2,
individual
Hence, tJe totanl relalive error in qquotient is equal to the sum of
relative i
ANALYSIS
NUMERICAL
12
also be written as
relation (1.8) can
The
At2 Aa
2
T2
difference of
or equal to the
particular case
Å
and 2, the equation (1.8) can easils. 1
For positive approximate numbers 1
dedue-
A1 Ara|
ie. 1 T2
.
:
'
.
.
Example 1.5.4 Find the product of the approxiinate numbers 8.6 and T2
84.359, all of whose digits are valid. Also find the relative and
the absolute errors
.
Solution. In the first number, there are two valid significant digits and in the second
there are five digits. Therefore, round-off the second number to three significant
digits. After rounding-off the nümbers ai and: r2 become i 8.6 and 2 =34,4.
Hence the productis
.,
In the result, there are two significant digits, because the least number of valid sig
nificant digits of the given numbers is 2. :
Example 1.5.5 Calculate the quotient c/y of the approximate numbers r6.845
ad y 2.53 if all the digits of the nuimbers are valid Find the relative and the
absolute errors.
:
,
.
. **
= .
ution. Here the dividendc 6.845 has four valid significant digits and the
Or as thrcc, so we perform division without rounding otf Thus
6.846.845 = 2.71. .
2.53 .
.
eSignificant digits are retained in the result, since, the least exact number (the
A
livisor
The ) contains three valid
significant digits.
absolute error in r and y are respectively **
14 NUMERIGAL
www.w.
quotiont is
relative error in
Hheraore the 0.005
Ay0.0005 0.000073 +0.00198
A G.8456.845 2.53
0.002= 0.2%.
:
Tre absoluteertot is
0.002 2.71x00020.00542 0.005. :
.
= = T1 T1* *U1.
m times
By (1.7), the relative error ôx
in the product is
where or
and brs reRpectively 6=61,
represent
TM
arithmetic compy
Error during
1,6 Significant loss of
digits
significantrepresentation of the
num
bers
the
occurs due to the finite significant digits
digits ocon
ore
Siçniticant error occurs mainly due to oft
error calculator). The loss
taton. 1his machine (computer or
omputational reasons
following two
due to the and
numbers are subtracted dividend.
two nearly equal compared to the
()when small divisor
by a very illustrated in
division is made which are
round-off error,
(i) when
more serious than
Siguificant error is
evaluate the relative
foliowing examples: and
diference X V6.36V5.35
1.6.1 Find the
Exampie
error of the result. V5.352.313 r2
X2
V5.362.315 21 and the approximate
differ
Solution. Let X1 =
and Arz 0.0005. Then
absolute errors Arj = 0.0005
The =0.002.
e is z = 2.315 -2.313 is Ar0.0005 +0.0005 =0.001.
error in the
subtraction
Tae total absoiute
Telative error óz 0.002 0.000.5 = 500
50%.
Te scheme of calculation we get a more accurateresult.
Howerer. by changing the
{V.36-v5.35)(V5.36 + V5.35
= V36- 5.35- V5.36 + V5.35
5.35-5.35 0.01
wew. 0.002=t (say)
V5.36+V5.35 V5.36+ V5.35
Solution. y at r=
82°
The value of cos82 .1392 01 ay) (correct up to four digits) and Aai =
00005. Then y1 1-0.1392 * 0.8608 and Ayi =0.00005 (from an exact num-
her equal to unity we subtract an approxiinate nuuber with an absolute error not
exceeding 0.00005).
Conseqently, the relative error is
mpu
0.00005
oy1 0.006%.
ccun 0.8608 0.000058=
10
at
We have cos (say). Aa2 = 0.00005.
100.9998 a2
2=1- 0.9998 0.0002. Ay20.00005,
Hence
0.00005
n
0y2 0.0002 25 25
ti
a
From this example it is observed that for small values of a, direct calculation of
y= 1-cos gives a relativeerror of the order 25% But at 82° the relative error
tive is only 0.006%
.
Now, change the calculation procedure and use the formula y= 1-cos t=2sin
to calculate the value of y for small values of ww.w
Let a= sin 0 300,0087 Then Aa 0.00005 and
fer 0.00005
0.0087
0.0058 0.58%
Thus y2=2 x0.00872=0.000151 and relative error
oyn = 0.0058 +0.0058 0.012=1.2% (using the formula
õa = 6a + oy if a =ay)
The absolute error is
A
n
= x oyp = 0.000151 x 0.012 0.000002.
Thus a sirnple transformation, of the computing formula,gives a more accurate result
.
for the same
data
Example 1.6.3 Find the roots of the equation x-10002 + 0.25 =0.
ion For simplicity, it is assurned that all the caleulations are performed using
tour significant equation are
digits. The roots of this
1000 106- 1