[Math] Calculating logs in your head

logarithmsmental-arithmetic

I quite often need to estimate $\log_2(x)$ for positive integer values of $x$. I find it frustrating that I have to rely on a calculator/computer to do this. By way of contrast, I can happily compute as many decimal places as I like of $\frac{x}{y}$ in my head as long as $x$ and $y$ aren't too large using simple schoolbook long division.

What is a good way to estimate $\log_2(x)$ in your head?

To make the question more concrete, take $\log_2(10)$ or $\log_2(10^{20})$.

Best Answer

You can use the rough approximation of $10^3 \approx 2^{10}$ for 1sf computations.

$\log_2(10) = \frac{1}{3} \log_2(1000) \approx \frac{1}{3} \log_2(1024) = \frac{10}{3}$.

If you want more precision, remember that $\ln(1+x) \approx x - \frac{1}{2} x^2$ as $x \to 0$, so taking just the first-order term we get $\log_2(1.024) = \frac{\ln(1.024)}{\ln(2)} \approx \frac{0.024}{\ln(2)}$. Now you can either use $\ln(2) \approx .693$ for 3sf precision, or you can use a rational approximation $\ln(2) \approx \frac{9}{13}$, which gives $\log_2(1.024) \approx \frac{104}{3000}$, and hence $\log_2(10) \approx \frac{10}{3} - \frac{104}{9000}$, which is good to 4 significant figures!

And from that we get $\log_2(10^{20}) \approx \frac{200}{3} - \frac{208}{900}$.

Related Question