Sub topic 15
Estimating Logs and Counting Digits of Large Powers
Assume you know the definition and laws of logarithms, powers of 10, and floor notation. The floor of a number is the greatest integer less than or equal to it. These tools let you estimate large quantities without calculating every digit.
Estimating logarithms
A common logarithm is a logarithm with base 10. It measures the power of 10 needed to produce a number:
\[ \log_{10}(1000)=3 \]
because \(10^3=1000\).
To estimate \(\log_{10}(x)\), place \(x\) between nearby powers of 10. For example,
\[ 100 < 350 < 1000 \]
so
\[ 2<\log_{10}(350)<3. \]
A closer estimate uses known values:
\[ \log{10}(2)\approx0.301,\qquad \log{10}(3)\approx0.477,\qquad \log_{10}(5)\approx0.699. \]
Since \(350=35\times10=7\times5\times10\),
\[ \log{10}(350) =\log{10}(7)+\log_{10}(5)+1. \]
If a calculator is allowed, this gives approximately \(2.544\). Without one, the first bound, \(2<\log_{10}(350)<3\), may be enough to identify an answer choice.
Counting digits with \(\log_{10}\)
For a positive integer \(N\), the number of decimal digits is
\[ \lfloor\log_{10}(N)\rfloor+1. \]
For a power \(a^n\), use the power law:
\[ \log{10}(a^n)=n\log{10}(a). \]
Therefore, the number of digits in \(a^n\) is
\[ \boxed{\lfloor n\log_{10}(a)\rfloor+1}. \]
For example, the number of digits in \(2^{100}\) is
\[ \lfloor100\log_{10}(2)\rfloor+1 =\lfloor30.1\ldots\rfloor+1 =31. \]
The fractional part also gives the leading size. Since
\[ 100\log_{10}(2)=30.103\ldots, \]
we have
\[ 2^{100}=10^{30.103\ldots} =10^{0.103\ldots}\times10^{30}. \]
Thus \(2^{100}\) is slightly larger than \(10^{30}\), which agrees with its 31-digit size.
import math
base, exponent = 2, 100
digits = math.floor(exponent * math.log10(base)) + 1
exact_digits = len(str(base ** exponent))
assert digits == exact_digits
print(digits)A CAT checking strategy
| Task | Useful method |
|---|---|
| Bound a logarithm | Compare with powers of 10 |
| Count digits of \(a^n\) | Use \(\lfloor n\log_{10}(a)\rfloor+1\) |
| Compare large powers | Take logarithms, preserving order for positive bases |
Exercise
How many digits does 5^12 have if log10(5) is approximately 0.699?
Show answer
floor(12 × 0.699) + 1 = floor(8.388) + 1 = 9 digits.