0% found this document useful (0 votes)
3 views17 pages

Math 323 Error PDF 2.

The document discusses the concepts of exact and approximate numbers, significant digits, and the importance of rounding off in numerical computations. It explains absolute, relative, and percentage errors, along with methods to evaluate and minimize these errors in calculations. Additionally, it covers the implications of using approximate formulas and introduces a general error formula for functional relations.

Uploaded by

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

Math 323 Error PDF 2.

The document discusses the concepts of exact and approximate numbers, significant digits, and the importance of rounding off in numerical computations. It explains absolute, relative, and percentage errors, along with methods to evaluate and minimize these errors in calculations. Additionally, it covers the implications of using approximate formulas and introduces a general error formula for functional relations.

Uploaded by

Joel Paade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 17
Section 1.3: Errors and Their Computations 7 1.3. ERRORS AND THEIR COMPUTATIONS There are two kinds of numbers, exact and approximate numbers. Examples of exact numbers are 1, 2,3,..., 1/2, 3/2, ...J2.7, e, etc., written in this manner. Approximate numbers are those that represent the numbers to a certain degree of accuracy. Thus, an approximate value of ris 3.1416, or if we desire a better approximation, it is 3.14159265. But we cannot write the exact value of 2. The digits that are used to express a number are called significant digits or significant figures, Thus, the numbers 3.1416, 0.66667 and 4.0687 contain five significant digits each. The number 0.00023 has, however, only two significant digits, viz., 2 and 3, since the zeros serve only to fix the position of the decimal point. Similarly, the numbers 0.00145, 0.000145 and 0.0000145 all have three significant digits. In case of ambiguity, the scientific notation should be used. For example, in the number 25,600, the number of significant figures is uncertain, whereas the numbers 2.56x10', 2.560x10" and 2.5600%10" have three, four and five significant digits, respectively. In numerical computations, we come across numbers which have large number of digits and it will be necessary to cut them to a usuable number of figures. This process is called rounding off. It is usual to round-off numbers according to the following rule: To round-off a number to n significant digits, discard all digits to the right of the nth digit, and if this discarded number is (a) less than half a unit in the nth place, leave the nth digit unaltered; (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; otherwise, leave it unchanged. The number thus rounded-off is said to be correct to n significant figures. Example 1.1 The numbers given below are rounded-off to four significant figures: 1.6583 to 1.658 30.0567 to 30.06 0.859378 to 0.8594 3.14159 to 3.142 In hand computations, the round-off error can be reduced by carrying out the computations to more significant figures at each step of the computation. A useful rule is: at each step of the computation, retain at least one more significant figure than that given in the data, perform the last operation and then round-off. However, most computers allow more number 8 Chapter 1: Errors in Numerical Calculations of significant figures than are usually required in engineering computations. ‘Thus, there are computers which allow a precision of seven significant figures in the range of about 1078 to 10°. Arithmetic carried out with this precision is called single precision arithmetic, and several computers implement double precision arithmetic, which could be used in problems requiring greater accuracy. Usually, the double precision arithmetic is carried out to 15 decimals with a range of about 107° to 10°. In MATLAB, there is a provision to use double precision arithmetic. In addition to the round-off error discussed above, there is another type of error which can be caused by using approximate formulae in computations, —such as the one that arises when a fruncated infinite series is used. This type of error is called truncation error and its study is naturally associated with the problem of convergence. Truncation error in a problem can be evaluated and we are often required to make it as small as possible. Sections 1.4 and 1.5 will be devoted to a discussion of these errors. Absolute, relative and percentage errors Absolute error is the numerical difference between the true value of a quantity and its approximate value. Thus, if X is the true value of a quantity and X, is its approximate value, then the absolute error Eq is given by Ex= X-X,=8X. (1.2) The relative error Ep is defined by Ep Bt, a3) and the percentage error (Ep) by Fp =100 Ex. (ay Let AX be a number such that |%-X|s ax. (1.5) Then AVis an upper limit on the magnitude of the absolute error and is said to measure absolute accuracy. Similarly, the quantity lat 1M measures the relative accuracy. It is easy to deduce that if two numbers are added or subtracted, then the magnitude of the absolute error in the result is the sum of the magnitudes of the absolute errors in the two numbers. More generally, if E}, E%...., £2 are the absolute errors in m numbers, then the magnitude of the absolute error in their sum is given by LER I+LER le +] BX. Section 1.3: Errors Their Computations 9 Note: While adding up several numbers of different absolute accuracies, the following procedure may be adopted: (i) Isolate the number with the greatest absolute error, Gi) Round-off all other numbers retaining in them one digit more than in the isolated number, (ii) Add up, and (iv) Round-off the sum by discarding one digit, To find the absolute error, Eq, in a product of two numbers a and 6, we write Ey = (a+ E4) (b+ E4) ab, where Ey and Ej are the absolute errors in a and b respectively. Thus, Ey = ak} +bE\ + EXER = bE} + aE, approximately (1.6) Similarly, the absolute error in the quotient a/b is given by at En q b+ ER “Ps EY) 2 bE} - ake FE assuming that Ej/bis small in comparison with 1 (1.7) Example 1.2 \f the number X is rounded to N decimal places, then Lage =e lo ). If X = 0.51 and is correct to 2 decimal places, then AY = 0,005, and the percentage accuracy is given by CO 5 100 = 0.98%, Example 1.3 An approximate value of x is given by X,=22/7=3.1428571 and its true value is X=3.1415926, Find the absolute and relative errors We have Ey= X- X,=-0.0012645 10 Carrer tz Errors in Numerical Calculations and =0.0012645 _ 5 oood02. 31415926 Example 1.4 Three approximate values of the number 1/3 are given as 0.30, 0.33 and 0.34. Which of these three values is the best approximation? We have +-o30|-4 3 30 |-o39 = 001 1 3 3 300 4934] 002 2 3 150 It follows that 0.33 is the best approximation for 1/3. Example 1.5 Find the relative error of the number 8.6 if both of its digits are correct. Here Ex=0.05 Hence 0.0058. 6 Example 1.6 Evaluate the sum $= /3+ {5+ J7 to 4 significant digits and find its absolute and relative errors. We have J3=1.732, {5 =2.236 and J7 = 2.646 = 6.614. Then Ey, = 0.0005 + 0.0005 + 0.0005 = 0.0015 The total absolute error shows that the sum is correct to 3 significant figures only. Hence we take $= 6.61 and then Hen 0.0015 = 0.0002. e661 Example 1.7 Sum the following numbers: 0.1532, 15.45, 0.000354, 305.1, 8.12, 143.3, 0.0212, 0.643 and 0.1734, where in each of which all the given digits are correct. Secrion 1.3: Errors and Their Computations a Here we have two numbers which have the greatest absolute error. These are 305.1 and 143.3, and the absolute error in both these numbers is 0.05. Hence, we round-off all the other numbers to two decimal digits. These a 0.15, 15.45, 0.00, 8.12, 0.02, 0.64 and 0.17, The sum S is given by $= 305.1+143.3+0.15+15.45 +0.00+8.12+0.02 + 0.64+0.17 = 472.95 = 473 To determine the absolute error, we note that the first-two numbers have each an absolute error of 0.05 and the remaining seven numbers have an absolute error of 0.005 each. Thus, the absolute error in all the 9 numbers is 2(0.05) +7 (0.005) 1+ 0.035 135 14 In addition to the above absolute error, we have to take into account the rounding error in the above and this is 0.01. Hence the total absolute error is $=0.14+0.01=0.15, Thus, S= 472,950.15. Example 1.8 Find the difference V6.37 - J6.36 to three significant figures. We have EST = 2.523885893 and 636 = 2.521904043 Therefore, /6.37 - 6.36 = 0.001981850 = 0.00198, correct to three significant figures. Alternatively, we have 6.37 - 6.36 6.37 - V6.36 = > V6.37 + J6.36 ___001 © 2.524 + 2.522 = 0.198 x10, which is the same result as obtained before. Example 1.9 — Two numbers are given as 2.5 and 48.289, both of which being correct to the significant figures given. Find their product, 12 Chaprer 1: Errors in Numerical Calculations the one with the greatest absolute error. Hence, its, ie., 48.3. ‘The Here the number 2. we round-off the second number to three significant digi required product is given by In the product, we retained only two significant digits, since one of the given numbers, viz. 2.5, contained only two significant digits. 1.4 A GENERAL ERROR FORMULA We now derive a general formula for the error committed in using a certain formula or a functional relation. Let w= fr) (8) and let the errors in x, v, = be Ax, Ay and Az, respectively. Then the error Au in w is given by ut du = f(x + Ax. y + Ay, z + Az) (1.9) Expanding the right-side of Eq. (1.9) by Taylor’s series, we obtain ut Au = f(x, y, 2) + ea Baws Says eae + terms involving higher powers of Ax, Av and Az (1.10) Assuming that the errors Ax, Ay, Az are small, their higher powers can be neglected and Eq. (1.10) becomes dua Si Art Says SoA aay The relative error in w is then given by poate du Ax, du Ay , du Az RE Dew ay Or (1.12) Example 1.10 Find the value of * ib o where a = 6.54 + 0.01, b = 48.64 + 0.02, and c = 13.5 + 0.03. Also, find the relative error in the result. We have a@ = 42.7716, Vb = 6.9742 and c = 2460.375 Section 1.4: A General Error Formula 13 Therefore, pc f2TTIGXO.9T2 9 9104, 2460.375 =0.121 Also, logs = 2loga + Flow — 3loge As} [dal 140] lac] (O01), 1/ 0.02 203) = Vel tal Aad), lado 20) (tea) * (ia = 0.009931 Example 1.11 Given that Sa =. find the relative error at x = 0.001. = | when the errors in each of x, », z is We have Then In general, the errors Ax, Ay and Az may be positive or negative. Hence, we take the absolute values of the terms on the right side. We then obtain +2 of fp leaf but Av = Ay = Az = 0,001 and x 1. Then, the relative maximum error (Ep)mnx 18 given by (44) max (At) ax u (Ep) max = 0.03 =—— = 0.006. 5 18_/ Numerical Methods / 1.5.1. Function Approximation Consider the function F= flay Xap Xap wo Rnd aay where x}, X7, X53, «+s X» are variable: ‘Suppose Ax, represents error in each x, so that the error in F is, FAR = f(xy + Ais £2 + At, n+ Bt) (132) Taylor’s series expansion of the right hand side of Eq. (1.31) gives FEAF = Sxpnts) +S bs, + 01087) (133) Aas, If we assume the errors in x, as small, and AY et, so that the second and higher powers of Ax, can be x ignored, Eq, (1.33) gives ea of of x AF = Yay, = Lan +Lay +--+ ay, 4) 2s, 1 ag a 2 a, as The relative error E, is then given by af _ a am, af a a ax, ee Oe eee 35 OF ax fax fax, F its approximation 6(/) and denoting the known error bound as 1 (/#"), where Replacing the function f(h) nis a positive integer, we have LF (h) —f (0) $ pF for small h Thus, 6(4) approximates f(/i) with order of approximation O(/1") and we can write L(A) = Oh) + Oe) (136) ("Example E115 Determine the maximum relative error for the function F= 3x42 + 572? - 722? + 38 Forx= T and Ax =~ 0.05, Ay = 0.001 and Az Solution: F = 3x2y? + Sys? — 7x22? + 38 ar we ebay — 14 22? Gy 7 OUP = M4 oF ee Gi yo? By 7 Hy + 1D) ar = 10y?2 - 14x? yy Numerical Computations ui 4x2)de| = 0.496 ie error is given by = (Gy? -14 xz) Bx| + [(6°y + 1oye?)dy4 + 1103 ; (02, we have the maximum relativ 1 and Ax = — 0.05, Ay = 0.001 and A= = 04 For x=. Eg. (1.34). Ea, = OE 1272 (Ednan = SR Go 7 04 5.) jility and Condition . ' ene mstable if the uncertainty of the input values is grossly ‘A numerical computation is said to be numerically w magnified by numerical method employed. Consider the first-order Taylor’s series of a function given by SO) =a) +fta) («-a) as The relative error of f(x) then becomes L0)- Sa) _ f(alx~a) aon Se) F(a) ‘The relative error of x becomes = (139) a A condition number is often defined as the ratio of the relative errors given by Eqs. (1.38) and (1.39) as a _ af) Condition number = 773) (140) The condition number given by Eq, (1.40) indicates the extent to which an uncertainty in x is magnified by Fe). Condition number = 1. (function’s relative error = relative error in x) Condition number > 1 (relative error is amplified) Condition number <1 (relative error is attenuated) (at Condition number > very large number (the function is ill-conditioned) Example E1.16 Compute and interpret the condition number for (a) f(x) = sin.x for a= 0.510 (6) f(x) = tan x for a= 1.7 Solution: (@)_ The condition number is given by a f(a) F(a) Condition number = 20_/_Numerical Methods // i = 055m, (1a) = cos(051 n) = -0.03141,f(@) = sin(0.51 m) = 0.99951 af'(a)_ (0.5Im)(- 0.03141) . number =“ F(ay (0.99951) (1.41), we conclude that the relative error is atten Cond 0.05035, 0 ; uated. Since the condition number is < 1, from (b) f(x) = tanx, fa) = ~7.6966 for a= 1.7 F'G) = Woostx, f(a) = Voos*(1.7) = 60.2377 a f(a) _ 1.160.237) __ 13.305 fla) 7.6966 Condition number = ‘Thus, the function is ill-conditioned. 1.5.3 Uncertainty in Data or Noise Uncertainty or error in the physical data based on which the computation model is based can introduce the data can affect the accuracy of the numerical errors in the analysis. This type of error is known as noise. TI computations performed. The errors can exhibit both inaccuracy and imprecision. If the input data has d Sienificant digits of accuracy, then the results obtained from the numerical computation should be reported ind significant digits of accuracy. For instance if @= 5.358 and 6 = 0.06437 both have 4 significant digits of accuracy, then although a ~ 6 = .29363, we should report the correct answer as a ~ b= 5.293. The following observations can be made from the results in Tables 1.6 and 1.7. (a) Negligible addition: Round-off error has crept into the fourth significant digit when we compare a~c (rounded) to 4 - C. ‘There is a difference in the fourth significant digit when 6 + d (rounded) are compared to B + D. (b) Error magnification: Comparing a/c (rounded) to A/C we find a difference in the fourth significant digit when bd (rounded) and BD are compared, the two answers differ substantially by ~40000. ()_ Creeping round-off: In the calculations of a ~ ¢, 6d, alc and 6 + d we find the result of working in four significant digits as opposed to working “exactly” and then rounding would lead to a loss of precision in the fourth significant digit. These calculations show the creeping round-off that is the gradual loss of precision as repeated rounding errors accumulate. (@ Subtractive calculations: Comparing a ~ 6 = - 0.1808 to 4 - B introduced by working in fixed-precision arithmetic. 0.1, we find significant error {A sequence may converge toa limit ina linear fashion or in a nonlinear fashion. Ifthe sequence is convergent, then an iterative operation produces a sequence of better and better approximate solutions. * 1.6.1. Linear Convergence Here, we consider a sequence {9 X15» %y} generated by the iteration xjey = i soon y 1 = g(y). Table 18 lists x4 2 (= xi, — x0) and Argyy/Axy for g(x) = 1 + x/2 where the starting value is taken as 0.85. cul 1 Computations /_21 M Numeri ee Table 1.8: Linear convergence of the iteration process for *.~ 2) Ba | k X Ax Rr N | AQ | 0 | 0.850000000 | 0.575 12 1 | 1.425000000 | 0.2875 12 2| 1.712500000 | 0.14375 Ww 3 | 1.856250000 | 0.071875 V2 4 | 1,928125000 | 0.0359375 V2 5 | 1,964062500 | 0.01796875 | 1/2 6 | 1.982031250 | 0,008984375 | 1/2 7| 1.991015625 | 0.004492188 | 1/2 8 | 1.995507813 | 0.002246094 | 1/2 9 | 1.997753906 | 0.001123047 | 1/2 10 | 1,998876953 | 0.000561523 | 1/2 11 | 1.999438477 | 0.000280762 | 1/2 12 | 1.999719238 | 0.000140381_| 1/2 Notice that the ratios of successive increments in the last column of Table 1.8 are all exactly equal to 1/2 and the convergence of the sequence to x = 2 is linear. We call this sequence exactly linear since Axy = cy xy for all k> 0. Here c= 1/2. The sequence {x4} is said to converge linearly provided the ratio of increments Ax, .;/Axy tends to a constant cy, where 0<| ¢| <1. Linear Convergence Theorem (a) X= g(X), sox = Visa fixed point of the iteration x4. = g(t). (6) g(x) is continuous in a neighbourhood of the fixed point X. (142) © gyro. Therefore, (@) {x} converges to X linearly, with C; = (0) if 0 1 (143) (©) {x4} converges or diverges slowly if g(\) = #1 If'sy = 0 and s; = r, the general term in a sequence that converges exactly linearly with convergence constant C is given by stot 12 xc m0 2 c= (44) ‘The increments are then given by As, = Siei ~ s4 = rC'. Appropriate conditions on C and r would then guarantee convergence. 1.6.2 Quadratic Convergence Consider a sequence {X9, x1, Xx) generated by the iteration Xi = 8O)s 22_/ Numerical Methods // 2.15x? +2.87 where x) BO 965+ 12 a function with fixed points. Table 1.9 lists k, x1, Aty [= (xee1 —20) and Axgay/ (Any)? for which the starting value is xo = 2. We observe that the sequence converges very rapidly to the point x = 1. The last column of Table 1.9 shows that the ratios Ar,,;/(Ax,)? are tending towards the constant C, = -0.4. This confirms the quadratic convergence of the sequence {x,} to the point x = 1. “The sequence {x1} is said to converge quadratically provided the ratio of increments Axy.,/(Ax,)” tends to a constant Cy #0, # 22. If Axe; = Co(Axy)? for all k > 0, then the sequence is said to be exactly quadratically convergent. 2.15x? + 2.87 Table 1.9: Quadratic convergence of the iteration process for %.1 = “355-4 5~ X x= Ne — Xe | Axia /(AXD? 2,000000000 | -0.7423245614 | -0.4276521490 1,257675439 | -0.2356559011 | -0.3930757235 1,022019537 | -0.0218289508 | -0.3999390216 1,000190587 | -0.0001905722 | -0.3999999952 1000000015 | -0.0000000145 1,000000000. jAnunool> Table 1.10: The structure of a sequence which is exactly quadratically convergent k 5k As, = Sie — Se | Asi /(AS" ofo r Cc 1}r FC c 2] Pc+r rc c 3[fC+PC+r Ac c 4a} fcl+r'C+Pc+r reels c 3 | rch artc’+hC+rctr ric" 6] cts rch +ACl+ nC +rC+r Quadratic Convergence Theorem (2) X= g(X), sox = X is a fixed point of the iteration x41 = g(x). (6) g"(x) is continuous in a neighbourhood of the fixed point X. (1.45) (©) g(X)=0. ‘That i, {x4} converges to X’quadratically, with C, = -F8"0. Table 1.10 lists As,, Asy = 5¢+1— 54, and the ratios As, ,/(Asi)? for a sequence whose convergence is exactly quadratic, with convergence constant C, and with starting values s9 = 0 and sy =r. UY Numerical Computations //_ 23 1.6.3. Aitken’s Acceleration Formula . i Quadratic convergence or any convergence of order higher than 2 is faster than the linear converte Aitken’s acceleration process is used to accelerate a linearly converging sequence to a qi ik ewe converging sequence. Aitken’s process will give better results in an iterative numerical technique wil number of iterative operations. Letx be the limit of the sequence. That is, If (x), A= 1 toe, is a linearly convergent sequence with limit x, and e, = x; —%, then tim lesa) le % and O

You might also like