1

If I want to find the nearest integer of $log_2(1,000,000,000)$

What I tried was to use the change of base rule for logarithms, using base 10 should simplify this down.

$$\dfrac{log_{10}(1,000,000,000)}{log_{10}(2)}$$

$$\dfrac{9}{log_{10}(2)}$$ Again the change of base, but this time to get rid of the 2 $$\dfrac{9}{(\dfrac{log_{2}(2)}{log_2(10)})}$$

$$9\cdot log_2(10)\approx 9 \cdot3 = 27$$

Although the nearest integer is 30. I'm a bit off, is there a way to improve this to actually get to 30?

  • if $\log_2(1000000000)=x$, then this is equivalent to finding $x$ such that $2^{x}=1000000000$. then could just double away until we reach it. – thesmallprint Apr 20 '19 at 16:29
  • If is worth to remember that $\log_{10}2\approx0.30103$. Then $9/0.30103\approx30$. –  Apr 20 '19 at 16:32
  • 1
    You first change the base to 10 and then change it back to 2. What you have done is essentially $\log_2(1,000,000,000)=\log_2(10^9)=9\log_2(10)$ – CY Aries Apr 20 '19 at 16:33

1 Answers1

2

$$2^{10}=1024\approx1000$$ hence $$10^9\approx(1024)^3=2^{30}.$$

As the initial relative error is $2.4\%$, after cubing the value the relative error will be close to $7.2\%$, which is not enough to be wrong by one half on the exponent.