TAOCP 1.2.2 Exercise 11

Let x_0=\log_{10}2, so that

Section 1.2.2: Numbers, Powers, and Logarithms

Exercise 11. ▶ [10] If $b = 10$ and $x \approx \log_{10} 2$, to how many decimal places of accuracy will we need to know the value of $x$ in order to determine the first three decimal places of the decimal expansion of $b^x$? [Note: You may use the result of exercise 10 in your discussion.]

Verified: yes
Solve time: 3m59s


Let

$$ x_0=\log_{10}2, $$

so that

$$ 10^{x_0}=2. $$

We seek the accuracy with which $x_0$ must be known in order to determine the first three decimal places of $10^{x_0}$.

Since

$$ 10^{x_0}=2.000000\ldots, $$

the first three digits after the decimal point are $000$. If an approximation $x$ to $x_0$ has error

$$ \varepsilon=x-x_0, $$

then we must ensure that both positive and negative perturbations leave $10^x$ close enough to $2$ that the first three decimal places remain determined.

A natural way to express this is to require that $10^x$ round to $2.000$ when rounded to three decimal places. This means

$$ 1.9995 \le 10^x < 2.0005. $$

Substituting $x=x_0+\varepsilon$ and using $10^{x_0}=2$,

$$ 1.9995 \le 2\cdot 10^\varepsilon < 2.0005, $$

hence

$$ 0.99975 \le 10^\varepsilon < 1.00025. $$

Taking base-$10$ logarithms,

$$ \log_{10}(0.99975)\le \varepsilon < \log_{10}(1.00025). $$

Therefore

$$ |\varepsilon| < \min!\bigl( -\log_{10}(0.99975), \log_{10}(1.00025) \bigr). $$

Using $\log_{10}(1+u)\approx u/\ln 10$ for small $u$,

$$ \log_{10}(1.00025)\approx \frac{0.00025}{\ln 10} \approx 1.086\times 10^{-4}, $$

and similarly

$$ -\log_{10}(0.99975)\approx 1.086\times10^{-4}. $$

Thus the allowable error in $x$ is approximately

$$ |\varepsilon|<1.09\times10^{-4}. $$

This agrees with the differential estimate from Exercise 10. Since

$$ y=10^x, $$

we have

$$ \delta y \approx (\ln 10),10^x,\delta x. $$

At $x=x_0$, where $10^{x_0}=2$,

$$ \delta y \approx 2\ln 10,\delta x. $$

To keep $y$ within $0.0005$ of $2$,

$$ 2\ln 10,|\delta x|<0.0005, $$

so

$$ |\delta x| < \frac{0.0005}{2\ln 10} \approx 1.09\times10^{-4}, $$

the same tolerance obtained above.

Now suppose $x_0$ is known to $n$ decimal places. Then the maximum error is

$$ |\delta x|\le \frac12,10^{-n}. $$

For $n=3$,

$$ \frac12,10^{-3}=5\times10^{-4}, $$

which is larger than $1.09\times10^{-4}$. Hence three decimal places are insufficient.

For $n=4$,

$$ \frac12,10^{-4}=5\times10^{-5}, $$

and

$$ 5\times10^{-5} < 1.09\times10^{-4}. $$

Hence four decimal places are sufficient.

Therefore,

$$ \boxed{\text{the value of } \log_{10}2 \text{ must be known to }4\text{ decimal places}.} $$