Question

Consider the following functions from positive integers to real numbers:

10,n,n,log⁡2n,100n10, \quad \sqrt{n}, \quad n, \quad \log_2 n, \quad \frac{100}{n}

The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:

Choose one option
Official answer and solution
Official answer
B
From
Official GATE 2017 answer key

Solution

Evaluate the asymptotic behavior of each function as n→∞n \to \infty to establish their order of growth.

Let us examine the limit of each function as n→∞n \to \infty:

  1. 100n\frac{100}{n}: As n→∞n \to \infty, 100n→0\frac{100}{n} \to 0. Its complexity is O(1/n)O(1/n), which decreases with nn and is asymptotically smaller than any positive constant.
  2. 1010: This is a constant function, Θ(1)\Theta(1).
  3. log⁡2n\log_2 n: This function grows unboundedly as n→∞n \to \infty, but slower than any polynomial function ncn^c with c>0c > 0.
  4. n=n0.5\sqrt{n} = n^{0.5}: This is a polynomial of degree 0.50.5.
  5. n=n1n = n^1: This is a linear function, which grows faster than n0.5n^{0.5}.

Arranging these functions in increasing order of asymptotic complexity gives:

100n<10<log⁡2n<n<n\frac{100}{n} < 10 < \log_2 n < \sqrt{n} < n

This corresponds to Option B.

Final answer

B

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2017 Computer Science and Information Technology (CS) Session 1
Question
4 of 65, printed as CS Q.4
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.