Skip to content
Official PYQ · 2021

GATE CS 2021 Set 1 Q3 — Asymptotic Worst Case Time and Space Complexity

Explain with AI

Consider the following three functions.

f1=10nf2=nlog⁡nf3=nnf_1=10^n\quad f_2=n^{\log n}\quad f_3=n^{\sqrt {n}}

Which one of the following options arranges the functions in the increasing order of asymptotic growth rate?

Choose one option
View worked solution

Answer: D

To compare the asymptotic growth rates of the given functions, we can take the logarithm (base 22) of each function. Since the logarithm is a strictly increasing function, the order of growth of the logarithms will be the same as the order of growth of the original functions.

Let's analyze each function:

  1. For f1=10nf_1 = 10^n: log⁡2(f1)=log⁡2(10n)=nlog⁡210≈3.32n∈Θ(n)\log_2(f_1) = \log_2(10^n) = n \log_2 10 \approx 3.32 n \in \Theta(n)
  2. For f2=nlog⁡nf_2 = n^{\log n} (assuming base 22 for the exponent log): log⁡2(f2)=log⁡2(nlog⁡2n)=log⁡2n⋅log⁡2n=(log⁡2n)2∈Θ((log⁡n)2)\log_2(f_2) = \log_2\left(n^{\log_2 n}\right) = \log_2 n \cdot \log_2 n = (\log_2 n)^2 \in \Theta((\log n)^2)
  3. For f3=nnf_3 = n^{\sqrt{n}}: log⁡2(f3)=log⁡2(nn)=nlog⁡2n∈Θ(nlog⁡n)\log_2(f_3) = \log_2\left(n^{\sqrt{n}}\right) = \sqrt{n} \log_2 n \in \Theta(\sqrt{n} \log n)

Now, we compare the growth rates of the logarithmic terms for large values of nn:

  • Polylogarithmic functions grow slower than sub-linear polynomial functions: (log⁡2n)2<nlog⁡2n(\log_2 n)^2 < \sqrt{n} \log_2 n
  • Sub-linear polynomial functions grow slower than linear functions: nlog⁡2n<n\sqrt{n} \log_2 n < n

Thus, the order of growth of the logarithms is: log⁡2(f2)<log⁡2(f3)<log⁡2(f1)\log_2(f_2) < \log_2(f_3) < \log_2(f_1)

This directly translates to the growth rate of the original functions: f2<f3<f1f_2 < f_3 < f_1

Therefore, the increasing order of asymptotic growth rate is f2,f3,f1f_2, f_3, f_1.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Asymptotic Worst Case Time and Space Complexity questions