10.5 KB · commit a9602da
There are two kinds of numbers, exact and approximate numbers. Examples of exact numbers are 1,2,3,…, 1/2,3/2,…, 2,π,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 π is 3.1416, or if we desire a better approximation, it is 3.14159265. But we cannot write the exact value of π.
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.56×104, 2.560×104 and 2.5600×104 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.
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
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 10−38 to 1039. 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 10−308 to 10308. 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 truncated 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 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 X1 is its approximate value, then the absolute error EA is given by EA=X−X1=δX.(1.2)
The relative error ER is defined by ER=XEA=XδX,(1.3) and the percentage error (EP) by EP=100ER.(1.4)
Let ΔX be a number such that ∣X1−X∣≤ΔX.(1.5) Then ΔX is an upper limit on the magnitude of the absolute error and is said to measure absolute accuracy. Similarly, the quantity ∣X∣ΔX≈∣X1∣ΔX 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 EA1,EA2,…,EAn are the absolute errors in n numbers, then the magnitude of the absolute error in their sum is given by ∣EA1∣+∣EA2∣+⋯+∣EAn∣.
To find the absolute error, EA, in a product of two numbers a and b, we write EA=(a+EA1)(b+EA2)−ab, where EA1 and EA2 are the absolute errors in a and b respectively. Thus,
EA=aEA2+bEA1+EA1EA2=bEA1+aEA2,approximately(1.6)Similarly, the absolute error in the quotient a/b is given by
b+EA2a+EA1−ba=b(b+EA2)bEA1−aEA2=b2(1+EA2/b)bEA1−aEA2=b2bEA1−aEA2,assuming that EA2/b is small in comparison with 1=ba(aEA1−bEA2).(1.7)and ER=3.1415926−0.0012645=−0.000402.
◀
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 are: 0.15,15.45,0.00,8.12,0.02,0.64and0.17. The sum S is given by
S=305.1+143.3+0.15+15.45+0.00+8.12+0.02+0.64+0.17=472.95=473To 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
EA=2(0.05)+7(0.005)=0.1+0.035=0.135=0.14In 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 S=0.14+0.01=0.15. Thus, S=472.95±0.15.
◀
Here the number 2.5 is the one with the greatest absolute error. Hence, we round-off the second number to three significant digits, i.e., 48.3. The required product is given by
P=48.3×2.5=1.2×102In the product, we retained only two significant digits, since one of the given numbers, viz. 2.5, contained only two significant digits.
◀