-2

Question

I want to arrange which is asymptotically faster -:

$$n^{100},2^{n},n^{\log\,n}$$

My approach

I know that Exponential function will beat Polynomial function from here

but i am thinking of different way of solving it.

let $$f_{1}=n^{100},f_{2}=2^{n},f_{3}=n^{\log n}$$

Take log both sides-:

$$y_{1}=\log f_{1}=100 *\log\,n$$ $$y_{2}=\log f_{2}=n$$

$$y_{3}=\log \,f_{3}=\log\,(\log\,n*n)$$

hence $$f_{2}>f_{3}>f_{1}$$

Am i right?

laura
  • 2,530
  • 1
    Yes, this is correct. It works because of the continuity of $\log$ and $\exp$. $$\log f\leq\log g\iff \log\frac fg\leq 0\iff f\leq g$$ – Prasun Biswas Oct 06 '17 at 19:29
  • 1
    It seems more straight forward to rewrite your functions using $x = e^{\ln x}$. Then you're just comparing ${e^{100\ln n}, e^{(\ln 2) n}, e^{(\ln n)^2}}$. – user474330 Oct 06 '17 at 19:31
  • 1
    @PrasunBiswas No, it's not correct. – zhw. Oct 06 '17 at 19:42

1 Answers1

2

Take logarithms of the three quantities, it is then clear that (for sufficinetly large $n$) \begin{eqnarray*} 100 \ln n < (\ln n)^2 < n \ln 2. \end{eqnarray*} So your answer should be $ f_1 < f_3 < f_2 $.

Donald Splutterwit
  • 36,613
  • 2
  • 26
  • 73