Sie sind auf Seite 1von 8

Errors in Numerical Calculation

Contents:

Numbers & Their Accuracy


Different Types of Errors
Mathematical Preliminaries
General Error Formula
Convergence
Assignment 1

Page

o
o
o
o
o
o

Prepared By
Er. Shree Krishna Khadka

NUMBERS & THEIR ACCURACY


There are two kinds of numbers:
i) Exact numbers, e.g. 1, 2, 3 1/2, 5/2 etc.
ii) Approximate numbers, e.g. PI, K etc
o Significant Digit:
Digits that are used to express a number are called significant digits/figures.
The following statements describe the notion of significant digits.
- All non-zero digits.
- All zeroes occurring between non- zero digits.
- Trailing zeroes following a decimal point, e.g. 3.50, 65.0, 0.230 have three
significant digits.
- Zeroes between the decimal point are preceding a non-zero digits are not
significant, e.g. 0.01234, 0.001234, 0.0001234 all have four significant digits.
- When the decimal point is not written, trailing zeroes are not considered to
be significant, e.g. 4500 contain only two significant digits.
o Accuracy & precision
The concept of accuracy and precision are closely related to significant digits.
- Accuracy refers to the number of significant digits in a value. E.g. the number
57.345 is accurate to five significant digits.
- Precision refers to the number of decimal position, i.e. the order of
magnitude of last digit in a value. E.g. 57.396 have a precision of 0.001.
In numerical computation, we come across numbers which have large numbers
of digits and it will be necessary to cut them to usable numbers of figures. This
process is known as rounding off. The error caused due to cut-off a large
number into usable number of figure is called round-off error.
o Rules for rounding off:
To round off a number to n-significant digits, discard all digits to the right of the
nth digit if this discarded number is:
- Less than half a unit in the nth place, leave the nth digit unaltered.
- Greater than half a unit in nth place, increase the nth digit by unity.
- Exactly half a unit in the nth place, increase the nth digit by unity if it is odd;
otherwise leave it unchanged.

Prepared By
Er. Shree Krishna Khadka

Page

1.6583(1.658), 30.0567(30.06), 0.859378(0.8594), 3.14159(3.142)

Examples: Following numbers are rounded off to four significant figures.

DIFFERENT TYPES OF ERROR:

a) Absolute Error: Numerical difference between true value of a quantity and


its approximate value.
Mathematically;
Absolute Error(EA ) = True Value X Approximate Value(X1 ) = X

b) Relative error: Ratio of absolute error to a true value of that quantity being
concerned.
Mathematically;
Relative Error(ER ) =

Absolute Error (E A )
True Value X

c) Percentage Error: The percentage value of relative error.


Mathematically;
Percentage Error(EP ) =

Absolute Error (E A )
True Value X

100%

d) Truncation Error: Occurs due to truncation or terminating an infinite


sequence of operation after a finite number have been performed.
Example:

cos x = 1

x2

, ex = 1 + x +
2

x2
2

e) Relative Accuracy: Ratio of change in true value to the modulus of true


value.
Mathematically;

|True Value X |

Absolute Error (E A )

~ |Approximate

Value X 1 |

Absolute Error (E A )

Page

Relative Accuracy ( R A ) =

Prepared By
Er. Shree Krishna Khadka

NUMERICAL EXAMPLES:

An approximate value of PI is given as 3.1428571 and its true value is


3.1415926. Find EA and ER.
Solution:
EA =| X-X1| = |3.1415926-3.1428571| = 1.265*10-3
ER = EA/X = 1.265*10-3/3.1415926 = 4.025*10-4

Three approximate values of the number 1/3 are given as 0.30, 0.33 and 0.34,
which of these is the best approximation?
Solution:
E1 = |(1/3)-0.30| = 1/30
E2 = |(1/3)-0.33| = 1/300
E3 = |(1/3)-0.34| = 1/150
Since, E2<E3<E1, 0.33 is the best approximation.

Evaluate the sum S=_/3 + _/5 + _/7 to four significant digits and find its
absolute and relative error.
Solution:
_/3 = 1.73205 = 1.732
_/5 = 2.23606 = 2.236
_/7 = 2.64574 = 2.646

Absolute Error (EA) = 0.0005 + 0.0005 + 0.0005 = 0.0015


Relative Error (ER) = EA/S = 0.0015/6.614 = 2.268*10-4 = 0.0002

10

S = 1.732 + 2.236 + 2.646 = 6.614

Page

Prepared By
Er. Shree Krishna Khadka

MATHEMATICAL PRELIMINARIES
Theorem 1: If f(x) is continuous in a x b, and if f(a) and f(b) are of opposite
signs, then f = 0 for at least one number , such that a < < .
Theorem 2 (Rolles Theorem): If f(x) is continuous in a x b, f (x) exists in
a < < and f(a)=f(b)=0, then there exist at least one value of x say , such that
f = 0.
Generalization: If f(x) be a function, which is n-times differentiable on [a, b]. If
f(x) vanishes at the (n+1) distinct points x0 , x1 , x2 , , xn in (a,b), then there exist
a number in (a,b) such that , f n = 0.
Theorem 3 (Intermediate Value Theorem): If f(x) be continuous in [a, b] and
let K be any number between f(a) and f(b), then there exists a number in (a, b)
such f() = K.
Theorem 4 (Mean Value Theorem for Derivative): If f(x) is continuous in [a,
b] and f(x) exists in (a, b), there exists at least one value of x, say between a
and b such that:
f b f(a)
f =
;
a<<
ba
Theorem 5 (Taylors Series for a function of one variable): If f(x) is
continuous and passes continuous derivates of order in an interval and includes
x=a, then:
x a 2
x a n1 n1
f x = f a + x a f a +
f a + +
f
a + R n (x)
2!
(n 1)!
Where; R n x : Remainder term =

xa n n
f
n!

; a < < .

Theorem 6 (McLarens Expansion):


x 2
xn n
f x = f 0 + xf 0 + f 0 + + f 0
2!
n!

Theorem 7 (Taylors Series for 2-variables):


f x1 + x1 , x2 + x2
2 x 1 2

2 f

2 f

(x1 ) + x 2 (x2 ) + + x
2

(xn ) } +

11

2 f

+ x x1 + x x2 + + x xn +

Page

= f x1 , x2

Prepared By
Er. Shree Krishna Khadka

Theorem 8 (Taylors Series for several variables):


f x1 + x1 , x2 + x2 , x3 + x3 xn + xn
f
f
f
= f x1 , x2 , x3 xn +
x1 +
x2 + +
x
x1
x2
xn n
1 2 f
2 f
2 f
2
+ { 2 (x1 )2 +
(x
)
+

+
(xn )2 }
2
2 x1
x2 2
xn 2
2 f
2 f
+2
x1 x2 +
x2 x3
x1 x2
x2 x3
2 f
+
xn1 xn +
xn1 xn

GENERAL ERROR FORMULA


Formula for the error committed in using a certain formula or a functional
relation.
Let; u=f(x1, x2, x3, x4, x5, xn) be the function of several variable xi (i=1,2n) and let
the error in each xi be xi , then the error u in u is given by:
u + u = f( x1 + x1 , x2 + x2 , x3 + x3 xn + xn ) .(i)
On expansion of RHS using Taylors Series, we get:
f x1 + x1 , x2 + x2 , x3 + x3 xn + xn
f
f
f
= f x1 , x2 , x3 xn +
x1 +
x2 + +
x
x1
x2
xn n
1 2 f
2 f
2 f
2
2
+ { 2 (x1 ) +
(x2 ) + +
(xn )2 }
2
2
2 x1
x2
xn
2
2
f
f
2 f
+2
x1 x2 +
x2 x3 +
xn1 xn
x1 x2
x2 x3
xn1 xn
+
i.e. u + u = f x1 , x2 , x3 xn

f
n
i=1 x

xi + term involving (xi )2

So, ignoring powers of errors, we get:

xi = x x1 + x x2 + + x xn (ii)

Now, Relative Error: ER =

u
u

f x 1

= x

1 u

f x 2

+ x

2 u

f x n

+ + x

Prepared By
Er. Shree Krishna Khadka

(iii)

12

f
n
i=1 x

Page

u=

CONVERGENCE

Page

13

- Numerical computing is based on the idea of iterative process.


- Iterative processes involve generation of sequence of approximation with the
hope that, the process will end of the required solution.
- Certain methods convert faster than others.
- It is necessary to know that convergence rate of any method to get the
required solution.
- Rapid convergent take less execution time.

Prepared By
Er. Shree Krishna Khadka

ASSIGNMENT 1
Full Marks: 20
Pass Marks: 10
Que: 1 (3X2=6 Marks)
1.1)
Round off the following numbers to two decimal places.
2.3742, 81.255, 52.275, 48.21416
1.2)
Round off the following numbers to four significant digits.
0.70029, 0.00022218, 2.36425, 38. 46235
1.3)

Calculate (_/102 - _/101) correct to four significant digits.

Que: 2 (2X2=4 Marks)


2.1) if u = 3v7-6v, find the percentage error in u at v=1, if the error in v is 0.05.
2.2) if y = (0.31x+2.73)/(x+0.35), where the coefficients are rounded off; find
the absolute and relative error in y when x=0.5 0.1.

Que: 3 (3X2=6 Marks)


If a = 10.00 0.05, b = 0.0356 0.0002, c = 15300 100 & = 62000
500, find the maximum absolute error in:
a) a+b+c+d
b) a+5c-d
c) c3

Que: 4 (1X4=4 Marks)

Page

Find the maximum value of relative error.


(Hint: Use general error formula)

14

If u=5xy2/z3,
x = y = z = 1 &
x = y = z = 1;

Prepared By
Er. Shree Krishna Khadka

Das könnte Ihnen auch gefallen