Big $O$ notation - $n ^ {\log n}$ versus $2^n$

157 Views Asked by At

I received an asymptotics question for my homework, which is to compare the orders of growth for $f(n)$ and $g(n)$ where:

$f(n) = n^{\log(n)}$

$g(n) = 2^n$

I have an intuition that $f(n) = O(g(n))$, and plotting the functions on a graph suggests the same thing, but I'm not sure how to tackle this. Finding $\lim \limits_{n \to \infty} \dfrac{2^n}{n^{lg(n)}}$ seems like a dead end.

2

There are 2 best solutions below

1
On BEST ANSWER

$\log(f(n)) = \log^2(n)$,

$\log(g(n)) = n$.

Can you compare these two?

0
On

One more way: set $\log_2 n = t$. You get $2^{t^2}$ on LHS and $2^{2^t}$ on RHS. Now log base 2 and you get $t^2$ vs $2^t$, which is much easier.