576 ANSWERS TO EXERCISES 4.2.4 3. log,, 2.4 (Web design programs)
576 ANSWERS TO EXERCISES 4.2.4 3. log,, 2.4 -log,, 2.3 z 1.84834%. 4. The pages would be uniformly gray (same as random point on a slide rule ). 5. The probability that 1Ofu 5 r is (r -l)/lO + (r -l)/lOO + … = (r -1)/9. So in this case the leading digits are uniformly distributed; e.g., leading digit 1 occurs with probability 4. 6. The probability that there are three leading zero bits is log,s 2 = a; the probability that there are two leading zero bits is log,, 4 -log,, 2 = $; and similarly for the other two cases. The average number of leading zero bits is 11, so the average number of significant bits is p + a. The worst case, p -1 bits, occurs however with rather high probability. In practice, it is usually necessary to base error estimates on the worst case, since a chain of calculations is only as strong as its weakest link. In the error analysis of Section 4.2.2, the upper bound on relative rounding error for floating hex is 21pp. In the binary case we can have p + 1 significant bits at all times (cf. exercise 4.2.1-3) with relative rounding errors bounded by 2-imp. Extensive computational experience confirms that floating binary (even with p-bit precision instead of p + 1) produces significantly more accurate results than (p + 2)-bit floating hex. Tables 1 and 2 show that hexadecimal arithmetic can be done a little faster, since fewer cycles are needed when scaling to the right or normalizing to the left. But this fact is insignificant compared to the substantial advantages of b = 2 over other radices (cf. also Theorem 4.2.2C and exercises 4.2.2-13, 15, 21), especially since floating binary can be made as fast as floating hex with only a tiny increase in total processor cost. 7. For example, suppose that xm(F(lOk . sk) -F(lOk )) = log5k/log 10k and also that xm(F(lOkm . 4k) -F(lOk )) = log4k/ log 10 ; then c (F(lOk . 5k) -F(lOkm 4k)) = log,, 2 4 m for all k. But now let E be a small positive number, and choose 6 > 0 so that F(z) < E for 0 < x < 6, and choose A4 > 0 so that F(z) > 1 - E for x > M. We can take k so large that 10pk . 5k < 6 and 4k > M; hence by the monotonicity of F, c (F(lOk 5k) -F(lOkm . 4k)) 5 c (F(lOk . sk) -F(lOk@- ) 5k)) m ?7%<0 + c (WO k(m+l) .4k) _ F(lOkm . 4k)) WI20 = F(10-k5k) + 1 -F(10k4k) < 2~. 8. When s > r, Ps(lOns) is 1 for small n, and 0 when [lO s] > [lO r]. The least n for which this happens may be arbitrarily large, so no uniform bound can be given for NO(E) independent of s. (In general, calculus textbooks prove that such a uniform bound would imply that the limit function So(s) would be continuous, and it isn t.) 9. Let ql, q2, . be such that PO(n) = ql(n;l) + q2( y1) +. . . for all n. It follows that P,(n) = l-mqi(n;l) + 2-,qs(,, ) $ 9.. for all m and n.