Significant Figure Rules for General Arithmetic Functions D. M. Graham Vancouver Community College, Langara Campus, 100 West 49th Avenue, Vancouver, BC, Canada V5Y 226 Near the beeinnine of our first-vear colleee courses, most of us who teach chemistry spend a greater or lesser amount oftime exolaininesienificant figures (SF),their importance, and the &echani& of handling them. First-year textbooks do the same thing. We and the textbooks explain the rule for addition and subtraction, then the rule for multiplication and division, usually ignoring other operations. We then watch with frustration, exasperation, or resignation, as our temperament dictates, while those students who pay any attention a t all to the concept apply the multiplication/ division rule t o everything from addition to antilogarithms. Many calculations in chemistry involve logarithms, exponentiation, and sometimes trigonometric functions. How many of us teach our students to calculate S F properly with such operations? When i t comes right down to it, how many of us even know how to do i t ourselves? Despite having examined numerous recent textbooks, I have seen only one1 that does so, and even that deals only with logarithms and antilogarithms. Clever2 also discusses logarithms but adds an extra digit to the logarithm because of errors that may be introduced by premature rounding before taking the antilogarithm. If premature rounding is guarded against by presenting only those digits that are significant, but using in later steps all the digits in the calculator's display or memory, this misleading extra digit is unnecessary. An excellent general discussion of the topic is given by Pinkerton and Gleit.3 who discuss some of the problems associated with defining exactly what we mean when we say that some auantirv has a certain number of SF. However, they do n o t folio; through with a discussion of what happens to the number of S F as various types of mathematical operation are performed upon uncertain quantities. Statistics texts may deal with more sophisticated types of error and uncertainty analysis, but the humble S F case remains untouched. What follows is an attempt to rectify this situation. General Theoretlcal Basis Let us introduce the following notations: m ( r ) ,the exponent of the number r when it is written in standard
exponential notation; n(x),the number of SF in r; p ( x ) , the number of significant decimal places (SDP) in x.
Here and in the remainder of the paper, all logarithms are to the base 10 unless otherwise specified. If we were to work in a number hase other than 10, the hase of logarithms would have to be changed accordingly. The fractional uncertainty falls in the following range:
Similarly for y . (At first sight it might appear that the range of possible values of Ih/xI is 5 X lo-"-' t o 5 X lo-", but this does not allow for the possihility that the mantissa of the quantity x may itself have been obtained by rounding up from a number as low as 1 - 5 X lo-", or down from a number up to, but not including, 10 - 5 X lo-". The reason for the 5 on the left and the < on the right is that a number such as (for example) 9.95 would he rounded up to 10.0, rather than being rounded down to 9.9. This follows from the rule that anumber ending in 5 is rounded in such a way as t o make the LSD even.) Nevertheless, unless n is very small, eq 6 approximates t o the simpler expression,
By taking logarithms and rearranging, this yields the following: log 1x1 - Log lhl - log 2 5 n(x) < log 1x1 - log lkl + Log 5 (7) and
+
log lyl - logi~yl- log2 5 n b ) < l o g b - lag iAy1 log5 (8) Either by definition, or by substituting eqs 4 and 5 into eqs 7 and 8, respectively, then using eq 1, we obtain log GI - 1 5 m(x) < log 1x1
(9)
Similarly, Now for small Ax and Ay, we have
When there is no ambiguity as to the argument, here calledx, these may he abbreviated to m, n , a n d p , respective-
b.
From the above definitions, i t follows that
k 1 log IAY! = log ly'l+ log 1
Combining this with eqs 4 and 5 yields the following key result: p b ) = p(x) - log IY'I
Let us now consider the function y f Ay = f ( x f AX), where AX and Ay are the uncertainties in x and y , respectively. If we assume that the least significant digit (LSD) of a number carries an uncertainty of f%, i t follows that the absolute uncertainty, Ax or Ay, in the number itself is f1'2 X 10-p. Taking logarithms, this reduces to
(11)
Porile. N. T . Modern University Chemistry: Harcourt Brace Jovanovich: Orlando. FL, 1987. Clever. H. L. J. Chem. Educ. 1979,56.824. Pinkerton, R. G.: Gleit, C. E. J. Chem. Educ. 1967, 44, 232-234. Volume 66
Number 7 July 1989
573
Substituting this into eq 2 yields our second key result, (12) n b ) = p(x) + mb) - log ly'(+ 1 Note that the inequalities have disappeared. I t therefore follows that, provided we are internally consistent, these results are independent of the precise definition we use for the numher of S F in an uncertain quantity. We could, for example, have chosen a range other than f1/2 for the uncertainty in the LSD. Alternatively, we could have selected a specific point within (or even outside) the range in eq 7 as our definition of n(x), and assigned noninteger values to other points. This latter is precisely what Pinkerton and Gleit3do when they define the numher of S F (which they call Flo) to he equal to 1+log R, where R (the resolution) is itself defined to he equal to 1xI2Ax1. Now the two general rules above, one for SDP and one for SF, are simple t o express hut are not practical for everyday classroom use. There follow applications to specific functions commonly used in chemistry. Logarithms and Antilogarithms
If y = log, x, then y' = l/(x In a). Now, pCy) = P(X) - log ly'l = p(x) - log 1x1 log lln al = p(x) + m(r) + 1 log iln a1 = n(x) + Log lln a1
+
(11)
+
The right-hand side of this is equal to n(x) for natural logarithms, and to approximately n(x) 0.36 for decimal logarithms. Thus the number of SDP in the logarithm is equal to the number of SF in the original quantity. This is strictly correct for natural logarithms but only approximately so for the decimal variety. If we were to use it for decimal logarithms, we would he right, on average, about 64% of the time. If, on the other hand, we were to use Clever's2 rule, we would he wrong 64% of the time. The inverse of this rule is plainly true for antilogarithms.
+
Example 1:h 8.3 X (twoSF) = -50.84 (twoSDPandfourSF). Example 2: if pH = 12.3 (one SDP and three SF), then [Ht] =5X 10-13 (one SF). These examples show plainly the error in the common practice of using the multiplication/division rule for logarithms and antilogarithms. Exponentlatlon (with an Exactly Known Exponent)
-
If a = a1180 (i.e., y = sin xO),i t reduces to the following: pCy) p(r) - Log lcos xoI 1.8 Similarly, if y = cos xc,thenp(y) = p(x) -log lsinxcI, and if y = cos xo, thenp(y) = p(x) - log lsin xoI'+ 1.8.
+
-
Example 3: sin 89.31' (two SDP and four SF) = 0.999927 (six SDP and six SF), since 2 -Lag leos 89.31'1 - log lrll801 = 5.7 6. Example 4: cas 1.56"two SDP and three SF) = 0.01 (two SDP and one SF), since 2 -log Isin 1.56~1= 2. The rules for hyperbolic sines and cosines are of exactly the same form. Clearly, this process of determining the rules for specific functions could go on forever. However, the rules are already hecoming unwieldy, and the more of them there are, the more difficult they are t o remember. Besides, we have not even begun to look a t functions with more than one argument. In fact, except possibly for logarithms and antilogarithms, i t would he pedagogically counterproductive to attempt to introduce this plethora of procedures to our students. But if that is the case, how do we reconcile encouraging them to handle S F properly with all the functions they meet with the practical difficulties of teaching them specific rules that are not likely to he needed often enough to he rememhered? As i t happens, there is a remarkably simple solution to this. The last trick we have up our sleeve is a surprisingly easy procedure that can be used for any differentiable function whatsoever (including the familiar additionlsuhtraction and multiplication/division processes, as well as more complex single- and multiargument functions). This may he called the extreme value rule. I t comes in two versions, and it is described in detail in the following section. The Extreme Value Rule
Assume an uncertainty of f 1'4 in the LSD of each argument (i.e., f1IzAxl, f 1/2Ax2, etc.), then calculate the following ratio:
The f and r signs are t o be interpreted in whatever way maximizes the absolute value of the numerator and minimizes that of the denominator. By taking n(y) to he the integer nearest to the midpoint of the range in eq 8, we then have:
If y = x", then y' = ax=-' = aylx. Now, n b ) = p(x) + mCy) - log Iy'lt 1 = p(x) + mCy) - log la1 - log lyl + log 1x1 + 1 = p(x) + mCy) - Log la1 - ImCy) 11+ lm(x) + 1)+ 1 = p(x) + m(x) - Log la1 + 1 = n(x) - Log la1 Once again, of course, n(y) must he rounded to the nearest integer. In most cases of interest in chemistry, this means that the numher of S F is unchanged when exponentiation is performed. The only exception that comes t o mind is the LennardJones potential, which involves exponents of 6 and 12. Physicists may also he interested in the Stefan-Boltzmann fourth-power law, where log la1 = 0.6.
+
Sines and Cosines
If y = sin ax, then y' = a cos ax. Now, P W = P(X) - log ly'l = p ( r ) - log la cosaxl If a = 1 (i.e., y = sin xC, where the superscript c means radians), this reduces to the following: pCy) = p(x) - log lcos x'l 574
Journal of Chemical Education
This can he modified to give an easily rememhered and easy-to-use rule that does not require the use of logarithms and that even mathematically unsophisticated students can learn with little difficulty. Nevertheless, the earlier version may he more suitable for machine implementation. The motivation for the various steps in the derivation will he easier to understand if the rule itself is stated first. Although i t takes longer to describe than the earlier version, it is very quick and easy t o use in practice. The symbol ifl will he used to mean the ahsolute value of the function a t the point of interest. Since this is our most important result, it is boxed for emphasis and shown a t the top of the next page. When teaching this rule, i t mi h t he advisable t o warn our students that lfl d l l , x2, . . .)llf~m&l, XQ,. . .) is not neces(x2)msr,. . .I. sarily equal to ljfi(xdmin,(xdmin,. . .l/~fll(xdmax. Particular care is needed near maxima and minima, and the rule breaks down altogether if the range of f h , xz, . . .) f Af(xl, xz, . . .)straddles a zero crossing or a singularity. However, singularities are rare in elementary chemistry, and zero-straddling can occur only if the uncertainty is larger than the numher itself, which would imply a negative number of SF. This is also uncommon.
Reverting to functional notation, this becomes The Extreme Value Rule
Assume an uncertainty of fY2* in the LSD of each argument, and calculate the following ratio: r=
x2.. . .) lflrni"(~1. lfirn&,,xm.. .)
In general, the result will be a number consisting of a zero, followed by a decimal polnt, usually some 9% then other digits. Thenumber of SF in the function ( x , , x2,. . .)is then one more than the number of 9's between thedecimalpoint and the first digit other than 9 in the ratio r. Do not round the number r before counting nines. Thus. for example, 0.99899 counts as two 9's, and therefore three SF, even though, when rounded, it gives 0.9990.
Not f%, as might be expected from lhe earlier venlon.
~~~
Nevertheless, i t does occur occasionally (such as, for examnle, in findine the pH of asolution in which IH+l= . . 1.000). In such cases, item be dealt with as follows: Define a new function z(x) = k X lom y(x). Then the number of SDP in y is equal to the number of S F in z, less the number of digits to the left of the decimal point in k X 10". Since the result denends on the value we choose for k. we need to standardize: The range of possible valuesfor k i s 1 5 k < 10:. the eeometrir m i d ~ o i n of t this ranee is \ 10. so this is the most appropriate vaiue to use. The Galue'ofm makes little difference. Usually we can assume that m = 0, but all that is really necess is that it be sufficiently large t o ensure that k X 10" > g A y ~ . We can apply this to the introductory example as follows:
+
rn + log 0.9995 = 0.9998 rn + log 1.0005
-
4 SF
+ log 1.000 = 3.162
. .. ..
log 1.000 = 0.000 pH = 0.000
I t is perhaps also worth pointing out that the "function" f(xl, xz, . . .)may mean the result of an entire complex calculation. Indeed, in this context, i t usually will mean this. The derivation follows. Note first that a number r in the ranee 0 5 r < 1. with a decimal representation such that there are n - 19's between the decimal mint and the first dirit other than 9 lies in the subrange 1- lo1-" 5 r < 1- lo-". Consider next the quantity y X lom = f(xl, xz, . . .), and such that y (and therefore also y X 10") has n SF. The uncertainty in y is then given by Ay = i 5 X lo-". The range of possible values for y itself, before allowing for this uncertainty, is given by the following: 1- 5 X
lo-"
5
lyl < lo - 5 X lo-"
(See the note following eq 6.) The range of possible values of the quantity (lyl - I ~ y l ) / (lyl I ~ y l is ) then given by the following:
+
(1- 5 X lo-") (1- 5 x lo-")
- 5 X lo-"