578 ANSWERS TO EXERCISES 4.2.4 (The latter integral (Web servers)
578 ANSWERS TO EXERCISES 4.2.4 (The latter integral is essentially a dilogarithm. ) Hence the probability of a carry when k = 0 is (1/ln10)2(.rr2/6-2~n,1 l/n210 ) = .27154. [Note: When b = 2 and k = 0, fraction overflow always occurs,.so this derivation proves that zn>i - l/n22 = ?/12 -f(ln2)2.] When k > 0, the probability is Thus when b = 10, fraction overflow should occur with probability ,272~s + .Ol i pl f .002p2 +. . . When b = 2 the corresponding figures are PO +.655p1+.288p2 +.137ps + .067p4 + . Now if we use the probabilities from Table 1, dividing by .91 to eliminate zero operands and assuming that the probabilities are independent of the operand signs, we predict a probability of about 14 percent when b = 10, instead of the 15 percent in exercise 1. For b = 2, we predict about 48 percent, while the table yields 44 percent. These results are certainly in agreement within the limits of experimental error. 15. When k = 0, the leading digit is 1 if and only if there is a carry. (It is possible for fraction overflow and subsequent rounding to yield a leading digit of 2, when b 2 4, but we are ignoring rounding in this exercise.) The probability of fraction overflow is .272 < log,, 2, as shown in the previous exercise. When k > 0, the leading digit is 1 with probability 16. To prove the hint [which is due to Landau, Race matematyczno-fizyczne 21(1910), 103-1131, assume first that lim sup a, = X > 0. Let E = X/(X + 4M) and choose N so that ]ai +. . . + a,] < &cXn for all n > N. Let n > N/(1 -E), n > 5/e be such that a, > +X. Then, by induction, an-k 2 a,, -kM/(n -En) > i1 for 0 5 k < En, and c n--en