Let f(n) = n^{2}Logn and g(n) = n (logn)^{10} be two positive functions of n. Which of the following statements is correct?

**(A)** f(n) = O(g(n)) and g(n) != O(f(n))

**(B)** f(n) != O(g(n)) and g(n) = O(f(n))

**(C)** f(n) = O(g(n)) but g(n) = O(f(n))

**(D)** f(n) != O(g(n)) but g(n) != O(f(n))

**Answer:** **(B)** **Explanation:**

Any constant power of Logn is asymptotically smaller than n.

**Proof:**

Given f(n) =n^{2}Logn and g(n) = n (logn)^{10}

In these type of questions, we suggest you to first cancel out the common factor in both the function. After removing these, we are left with f(n) = n and g(n) = (logn)^{9}. Removing a factor of nlogn from both functions.

Now n is very very large asymptotically as compared to any constant integral power of (logn) which we can verify by substituting very large value say 2^{100}.

f(2^{100}) = 2^{100} = 1030 and g(2^{100}) = 100^{9} = 1018.

Always remember to substitute very large values of n in order to compare both these functions. Otherwise you will arrive at wrong conclusions because if f(n) is asymptotically larger than g(n) that means after a particular value of n, f(n) will always be greater that g(n).

This solution is contributed by **Pranjul Ahuja**.

Quiz of this Question

## Recommended Posts:

- GATE | GATE CS 1999 | Question 36
- GATE | GATE CS Mock 2018 | Question 39
- GATE | GATE CS 2013 | Question 1
- GATE | GATE CS 2013 | Question 3
- GATE | GATE CS 2013 | Question 4
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 6
- GATE | GATE CS 2013 | Question 7
- GATE | GATE CS 2013 | Question 8
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 11
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 17
- GATE | GATE CS 2013 | Question 18
- GATE | GATE CS 2013 | Question 19
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 22
- GATE | GATE CS 2013 | Question 23