You are on page 1of 12
1 APPROXIMATIONS AND ERRORS IN COMPUTATION | 1, Introduction 2. Accuracy of numbers 3. Errors 4. Usetul rules for estimating errors 5. Error propagation 6, Error in the approximation of a function 7. Error in a series approximation 8. Order of approximation 9. Growth of error 10. Objective Type of Questions 1.1, INTRODUCTION The limitations of analytical methods in practical applications have led scientists and engineers to evolve numerical methods. We know that exact methods often fail in drawing plausible inferences from a given set of tabulated data or in finding roots of transcendental equations or in solving non-linear differential equations. There are many more such situa- tions where analytical methods are unable to produce desirable results. Even if analytical solutions are available, these are not amenable to direct numerical interpretation. The aim of numerical analysis is therefore, to provide constructive methods for obtaining answers to such problems in a numerical form. With the advent of high speed computers and increasing demand for numerical solu- tion to various problems, numerical techniques have become indispensible tools in the hands of engineers and scientists. The input information is rarely exact since it comes from some measurement or the other and the method also introduces further error. As such, the error in the final result may be due to error in the initial data or in the method or both. Our effort will be to minimize these errors, so as to get best possible results. We therefore begin by explaining various kinds of approximations and errors which may occur in a problem and derive some results on error propagation in numerical calculations 1.2. ACCURACY OF NUMBERS (1) Approximate numbers. There are two types of nu Exact numbers are 2, 4, 9, 13, 7/2, 6.45, ... ete. But there are numbers such as 4/3 ( = 1.33333 .), V2 (= 1.414213 ...) and x ( = 3.141592 ...) which ann. digits. These may be approximated by numbers 1.33; numbers which represent the given numbers to approximate numbers. mbers exact and approximate. ot be expressed by a finite number of 33, 1.4142 and 3.1416 respectively. Such a certain degree of accuracy are called = 1, The digits used to express a number are called significant digits Significant figures. The digits used I oO Eee of the numbers 7845, 3.589, 0.4758 contains four significant figures a 6, 0.000587 and 0.0000296 contain only three significant figures the position of the decimal point. Similarly the numbers 45000 ifigures). while the numbers 0.00: since zeros only help to fi and 7300.00 have two significant figures only. : (3) Rounding off. There are numbers with large number of digits e.g., 22/7 = 57143. In practice, it is desirable to limit such numbers to a manageable number of uch as 3.14 or 3.143. This process of dropping unwanted digits is called rounding off. (4) Rule to round off a number to n significant figures : (i) Discard all digits to the right of the nth digit (ii) If this discarded number is (a) less than half a unit in the nth place, leave the nth digit unchanged ; (b) greater than half a unit in the nth place, increase the nth digit by unity ; (c) exactly half a unit in the nth place, increase the nth digit by unity if it is odd other- wise leave it unchanged. For instance, the following numbers rounded off to three significant figures are : 7.893 to 7.89 3.567 to 3.57 to 12.9 84767 to 84800 6.4956 to 6.44 5.8254 to 582° Also the nyfnbers 6.284359, 9.864651, 12.464762-rounded off to four places of decimal at 6.2344, 9.8646, 12.4648 respectively. numbers thus rounded off to n significant figures (or n decimal places) are said to be correct to n sfnificant figures (or n decimal places). In any numerical computation, we come across the following types of errors : (1) Inherent errors. Errors which are alread, ( . Err 'y present in the statement of a problem before its solution, are called inherent errors. Such errors arise either duc to the given data 2 ats eae or due to the limitations of mathematical tables, calculators or the digital - Inherent error i i mae 7 ee vs can be minimized by taking better data or by using high precision @) i ‘i ee rors qarise from the process of rounding off the numbers during the ofthe conan aie ens wnaveidable in mast of the calculations due to the limitations ; a oe errors can, however, be reduced : changing the calculat numbers or division by a small soy ae S0 as to avoid subtraction of‘nearly equal or (ti) by retaining at least o data and rounding off at the last step. (8) Truncation errors ate causes sare caus process by a finite one. If we are wae Using digits, rounding off of 13.658 gives mi i ¢ More significant figure at each step than that given in the '8 approximate results or on replaci infini : I placing an infinite ng a sein computer having a fixed word length of 4 Whereas truncation gives 13.65, For example, if e* “APPROXIMATIONS AN ERRORS IN COMPUTATION — = nz x Pd is replaced by L+x+ 9797 =X (say), then the truncation error is X - X’. ‘Truncation error is a type of algorithm error. (4) Absolute, Relative and Percentage errors. If X is the true value of a quantity and X” approximate value, then | XX’ | ie. | Error | is called the absolute error E,, ‘The relative error is defined by E, = |=" | elon | [True value] and the percentage error is E X-X' 100 E, = 100) : z | x If ¥ be such anumber that | X-X’ | < X, then X is an upper limit on the magnitude of absolute error and measures the absolute accuracy. Obs. 1. The relative and percentage errors are independent of the units used while absolute error is expressed in terms of these units. Obs. 2. If a number is correct to n decimal places then the error = $10". For example, if the number is 3.1416 correct to 4 decimal places, then the error = $10 = 0.00005. 1.4. USEFUL RULES FOR ESTIMATING ERRORS To estimate the errors which creep in when the numbers in a calculation are trun- cated or rounded off to a certain number of digits, the following rules are useful. If the approximate value of a number X having n decimal digits is X’, then (1) Absolute error due to truncation to k digits =|X-x | <10"* (2) Absolute error due to rounding off to k digits 1 as Lips |x-X <5) (8) Relative error due to truncation to k digits 7 < 10" a x A) Relative errortturtorounding off to k digits =|X=*"| <2 10 Fare ee Obs. 1. If a number is correct to n significant digits, then the maximum relative <410" relative error $ $10". Ifa number is correet to d decimal places, then the absolute error < 4 10-1 or s 410~. Obs. 2. If the first significant figure of a number is y figures , then the relative error < 1I(k x 10°"). and the number ts correct to n significant Let us verify this result by findi 5) be eal y finding the relative érror in the number 864.32 correct to five sienifi- = NUMERICAL METHODS IN ENGINEERING AND. science | Here k= 8, n = 5 and absolute error # 0.01 x 3 = 0.005. 0.005 < ie, —1__. Hence the result is verified. 8x1ot kxio™t MExample 1.1. Round off the numbers 865250 and 37.46 and compute E,, E,, E, in each case. ; = Sol. (i) Number rounded off to four significant figures = 865200 to four significant figures E,= | X—X, | = | 865250 - 865200 | = 50 50 =< =6.71x 105 365250 = &71 * E, = E, x 100 = 6.71 x 103 Gi) Number rounded off to four significant figures = 37.46 ee E,= | X-X, | = | 37.46235 - 37.46000 | = 0.00235 =| X2%1|_ 0.00235 : | x | 37.46235 E, = E,, x 100 = 6.27 x 10°) Wi Example 1.2. Find the absolute error if the number X = 0.00545828 is (© truncated to three decimal digits. (ii) rounded off to three decimal digits. Sol. We have X = 0.00545828 = 0.545828 x 10-2 (© After truncating to three decimal places, its approximate value X’ — 0.545 x 10-2 Absolute error = | X-X’ | = 0.000828 x 10 = 0.828 x 10° < 10-23 = 6.27 x 10% This proves rule (1). (Gi) After rounding off to three decimal Absolute error ~ = | X_ x’ | | 0.545828 ~ 0.546 | x 10-2 = 0.000172 x 10 = 0.172 x 10-5 which is < 0.5 x 10°. This proves rule (2), ae MExample 1.3. Find the relative error if the number X = 0.001997 is (i) truncated to three decimal digits oe (ii) rounded off to three dest, places, its approximate value X’ = 0.546 x 102 = 0.4997 x 19-2 ree decimal places, its approximate value X = 0.499 x102, Relative error =| X=X"} | 0.4997 19-2 — 0.499 x 10-2 eel 0.4997 x10? = 0.140 x 102 < rors This proves rule (3). [ ,pPROXIMATIONS AND ERRORS IN COMPUTATION oe a tii) After rounding off to three decimal places, the approximate value of the given number X’ = 0.500 x 102 Relative error = |“ | 0.4997 10? - 050010 ? | | 2 : | 0.4997 x 10 * ' = 0.600 x 10-3 = 0.06 x 10-1 which is less than 0.5 x 10°". This proves rule (4). Eco ee il 2. 10. n. 12, 13, 14, . Round off the following numbers correct to four significant figures : 3.264% 5, 35.46735, 4985561, 0.70035, 0.00032217, 18.265101. Round off the number 75462 to four significant digits and then calculate the absolute error and percentage error. (U.P.T.U., B. Tech., 2004) . If 0.333 is the approximate value of 1/3, find the absolute and relative errors. (Bhopal, B.E., 2007) . Find the percentage error if 625.483 is approximated to three significant figures. . Find the relative error in taking 1 = 3.141593 as 22/7. (V.T.U. MCA, 2007) . The height of an observation tower was estimated to be 47 m, whereas its actual height was 45 m. Calculate the percentage relative error in the measurement. . Suppose that you have a task of measuring the lengths of a bridge and a rivet, and come up with 9999 and 9 cm, respectively. If the true values are 10,000 and 10 em respectively, compute the percentage relative error in each case. (Pune, B. Tech., 2004) - 2 Find the value of e* using series expansion e* = 1+x + 4 a aI for x = 0.5 with an absolute error less than 0.005. V2 = 5.385 and Vx = 3.317 correct to 4 significant figures. Find the relative errors in their sum and difference. Given : a = 9.00 + 0.05, 6 = 0.0356 + 0.0002, ¢ = 15300 + 100, d = 62000 + 500. Find the maximum value of absolute error ina +6 +¢ +d. (P.T.U, B. Tech., 2001) Two numbers are 3.5 and 47.279 both of which are cor joni : Find their product. ee eres ven Find the absolute error and the relative error in the product of 432.8 and 0.12584 using four digit mantissa. : : (Kerala B. Tech., 2003) The discharge @ over a notch for head His calculated by the formula Q = RH” where k is a given constant. If the head is 75 cm and an error of 0.15 em i ible in i ment, estimate the percentage error in computing the deere a eames If the number p is correct to 3 si igi ae P significant digits, what will be the maximum relative 1.5. ERROR PROPAGATION = i s are carried out for the solution of a problem. ft is f computational steps are carried out f tion j A numbe' erstand the way the error propagates with progressive computation. et approximate values of two numbers X and Y be X’ and Y’ respectively, then che absolute error E,,2X-X' and E,,=Y-Y (1) Absolute error in addition operation X+Y=X+E,,) + (V+ Ey) fe [| X+N-K+Y) |= 1B +B, |S 1B | +1 Bay | Thus the absolute error in taking (X’ + ¥") as an approximation to (X + Y) is less than or equal to the sum of the absolute errors in taking X’ as an approximation to X and Y’ as an approximation to Y. (2) Absolute error in subtraction operation X-Y=(X+E,)-(+E,) (X’- ¥) + (E,,-E,y) 1&-Y-O-¥) |=] B,- By 1S | Ea + | Ey | Thus the absolute error in taking (X’ — Y’) as an approximation to (X - Y) is less than or equal to the sum of the absolute errors in taking X’ as an approximation to X and Y’ as an approximation to Y. (8) Absolute error in multiplication operation To find the absolute error Z,, in the product of two numbers X and Y, w E, =X +E,,) (¥+E,,)-XY¥ where E.,, and E,, are the absolute errors in X and ¥ respectively. Then E,=XE,, + YE,, + E,.E, Assuming £.,, and E,, are reasonably small so that E,, E., can be ignored Thus E, = XE,, + YE, approximately. (4) Absolute error in division operation ‘e write Similarly the absolute error E, in the quotient of two numbers X and Y B= XK +B X LY By -X Ey Y+E,, ¥ “YOE,) is given by MeExample 14. Find the absolute error and relative error in V6 + V7 + VB correct to 4 significant digits. Sol. We have V6 = 2.449, /7 = 2.646, /g = 2.828 - S= V6 +7 +8 = 7.923. Then the absolute error E, in S, is E, = 0.0005 + 0.0007 + 0.0004 = 0.0016 This shows that $ is correct to 3 significant digits only. Therefore, we take $ = 7.92 Then the relative error E, is 0.0016 r= 7gg = 0.0002. @ Example 1.5. The area of cross-section of a rod is desired upto 0.2% error. How accu- rately should the diameter be measured? (Pune, B. Tech.,,2003) Sol. If A isthe area and D is the diameter of the rod, then A = #(2) -%D-D, Now error in area A is 0.2% i.e., 0.002 which is due to the error in the product D x D. We know that if Z, is the absolute error in the product of two numbers X and Y, then E,=X,yE + YE,x Here X = Y= D and Ex = E,y = E,, therefore E,=DE,+DEy or 0.002 = 2DE, Thus E, = 0.001/D i.e., the error in the diameter should not exceed 0.001 D*. Ml Example 1.6. Find the product of the numbers 8.7 and 52.378 both of which are correct to given significant digits. Sol. Since the absolute érror is greatest in 3.7, therefore we round off the other number to 3 significant figures i.e. 52.4. ‘Their product P = 3.7 x 52.4 = 193.88 = 1.9388 x 10% Since the first number contains only two significant figures, therefore retaining only two significant figures in the product, we get P=19 x10? 1.6. ERROR IN THE APPROXIMATION OF A FUNCTION Tet y = Ax,, x3) be a function of two variables x,,.,. If &x,, 8t, be the errors in xy, then the error dy in y is given by : yt By = fla, + Bry x + Bx) Expanding the right hand side by Taylor's series, we get ie ta ae aes =) yey = fey) +[ + terms involving higher powers of ax, and dx, eg If the errors &x,, Sx, be so small that their squares and higher powers can be neglected. then (i) gives 2 oj dey 82 Approximately. Ea a NUMERICAL METHODS IN ENGINEERING AND SCIENCE | Hence corresponding to the errors In general, the error Sy in the function y = lx, Xyy +++ X,) COrresPo ie ox ing, = _ n) is given by © Oxy by _ ay dy and the relative error iny is E, = er ae Example 1.7. if u = 4x°y"/z‘ and errors in x, ¥, 2 be 0.001, compute the relative maxi- mum error in u when x Sol. Since — Su = — ix + ee og eae z z z Since the errors éx, dy, 8z may be positive or negative, we take the absolute values of the terms on the right side, giving 3 2y2 16x*y° Bay? gy 4 12829’ by - 1829 8xy? x 12x29? | -| 16x?y> 2 | = 80.001) + 12(0.001) + 16(0.001) = 0.036 Hence the maximum relative error = (8u),,,,/u = 0.036/4 = .009. Wexample 1.8. Find the relative error in the function y = ax, ese ge, Sol. We have logy = log a + m, log.x, +m, log x, + .. +m, log x, ae, +m, y Since the errors 8, 8, wma, Bt, may be values of the terms on the right side. This gives : Xn Positive or negative, we take the absolute (Enaz $y ot then 4.7. ERROR IN A SERIES APPROXIMATION We know that the Taylor's series for flx) at x = @ with a remainder after n terms is a (x-a)? (x-a)"t x) = fla + x~a)= fla) + (x-a)f(a) + ———— f" A eal "(a) + Se fla) + + ay frMa) +R, (x) ‘a where R,(x) = & f"0),a and hence if fix) is approximated by the first n terms of this series, then the maximum error will be given by the remainder term R,{2). On the other hand, if the accuracy required in a series approximation is preassigned, then we can find n, the number of terms which would yield the desired accuracy. MExample 1.9. Find the number of terms of the exponential series such that their sum gives the value of & correct to six decimal places at x = 1. nad +7— +R, wali) 2 Sol. Wehave e=1+x+ = (n-D! 2! where R,(x) = = 0°, 0<@2x 108 which gives n = 10. n! "Thus we need 10 terms of the series (i) in order that its sum is correct to 6 decimal places. Example 1.10. The function f(x) = tan“ x can be expanded as 2n-1 tan! x . +n" woit . find n such that the series determine tan“ x correct to eight significant digits at x = 1. (U.P.T.U., B. Tech. 2007) Sol. If we retain n terms in the expansion of tan x, then (n + 1)th term 2nt1 = (Cys ¢ oo in co Soe Ea ~ NUMERICAL METHODS IN ENGINEERING AND Science | ji 2 cy" To determine tan“ (1) correct to eight significant digits accuracy | one 2 ie., 2n+1>2x108 or n> wos- 3 Hence n = 108 + 1, 1.8. ORDER OF APPROXIMATION We often replace a function ti) with its approximation (h) and the error bound is known to be uth"), n being a positive integer so that | fh) h) | 1, the exponential error yrows indefinitely as n — ©, and 0 <8 <1, the exponential error decreases to zero as n — ~, Eee 1.2 a h Find the smaller root of the equation x? — 400x + 1 = 0, correct to 4 decimal places. Ifr = A(4h® — 5), find the percentage error in r at h = 1, if the error in h is 0.04. (W.B.T.U., 2005) If R = 10 x*y%z? and errors in x, y, z are 0.03, 0.01, 0.02 respectively at x = 3, y = 1,z Calculate the absolute error and % relative error in evaluating R ? IfR = 4xy*/z9 and errors in x, y, z be 0.001, show that the maximum relative error at x =. is 0.006. 2 v= ; = + | and the error in Vis at the most 0.4%, find the percentage error allow- able in'r and h when r = 5.1 cm and h = 5.8 cm. sinx Find the value of J = ie * dx correct to 4 decimal places. 5 : eae Oe eee x (xe Using the series sina = x- 37+ 5 Determine the number of terms required in the series for log (1 + x) to evaluate log 1.2 correet to six decimal places. evaluate sin 25° with an accuracy of 0.001. xox Use the series log, (4) =2 (= +e 4h } to compute the value of log (1.2) correct Bien 5 to seven decimal places and find the number of terms retained. (U.P.T\U., B.Tech., 2003) 10. Find the order of approximation for the sum and product of the following expansions : ee Be was Palehe +57 +h) and cosh) = Fk sou. 12 eS ae METHODS IN ENGINEERING AND SCIENCE M1. 1.40. Given the expansions : denice 7 Sta tO) and cosit)=1- 5! Determine the order of approximation for their sum and product. sin (t) OBJECTIVE TYPE OF QUESTIONS Sacer ee Ee 1. t t or fill up the blanks in the following questions i - Sens 10. iL, 12, 13. 14, ifs is the true value of a quantity and x, is its approximate value, then the relative error is (a) | x,~x |b, () | x—x, [ie (0) | xe | (d)x/| x,-x |. ‘The relative error in the number 834.12 correct to five significant figures is... . Ifa number is rounded to k decimal places, then the absolute error is 1 1 2 get digs (a) 5 10 @) 510 1 1 = 10¢ digs 31 @7z lot. If is taken = 3.14 in place of 3.14156, then the relative error is ...... Given x= 12, y=256 and z=4.5, then the elative error in evaluating w = x2 +ylz is Round off values of 43.38256, 0.0326457 and 0.2537623 to four significant digits are : Round relative maximum error in 3x°y/z when 8x = oy = 82 = 0.001 atx =ysz=1is..... If both the digits of the number 8.6 are correct, then the relative error is Ifa number is correct to n significant digits, then the relative error is 2 1 (a) > 10" (6) S10 a. ()s5 10" @

You might also like