1
$\begingroup$

How does $n < 2^n$ become $\log n < n$ by taking the log of both sides?

I understand the left side but I do not understand the right side of the inequality. The once was $\log 2^n$ becomes $n$ for some reason...

$\endgroup$
5
$\begingroup$

The logarithm function is an increasing function, which means it is valid to take the $\log$ of each side of the equation.

$$\log (n) \lt \log(2^n) \iff \log(n) < n\log 2$$

This is because one of the laws of exponents tells us $$\log a^b = b\log a.$$

If you are using $\log_2$, then $\log_2(n) < n\log_2(2) = n$

$\endgroup$
15
  • 1
    $\begingroup$ ...and $\log$ is increasing. $\endgroup$ Dec 18 '14 at 19:00
  • $\begingroup$ Also, sometimes (like in complexity analysis) multiplicative constants (like $\log 2$ here) are ignored. $\endgroup$ Dec 18 '14 at 19:03
  • $\begingroup$ is log always increasing by default or what hint tells me it is increasing? If the constant was not 2, but 100, do we just omit the constant all the time? $\endgroup$
    – user983246
    Dec 18 '14 at 19:04
  • 1
    $\begingroup$ $\log_a$ is increasing if $a>1$ and decreasing if $0<a<1.$ $\endgroup$
    – mfl
    Dec 18 '14 at 19:10
  • 1
    $\begingroup$ The definition is that $\log_a b$ is the number $c$ for which $a^c=b$. ${}\qquad{}$ $\endgroup$ Dec 18 '14 at 20:39
3
$\begingroup$

$ n < 2^n $ then $\log n <n \log 2$, since $\log 2 < 1$, we claim that $$\log n < n$$

$\endgroup$
2
  • $\begingroup$ is log 2 < 1 true if the base was any arbitrary number? $\endgroup$
    – user983246
    Dec 18 '14 at 19:09
  • 2
    $\begingroup$ No. Only if the basis is bigger than $2.$ $\endgroup$
    – mfl
    Dec 18 '14 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.