Exams › GATE › Technical
Consider the following functions:
f(n) = 2ⁿ
g(n) = n!
h(n) = n^(log n)
Which of the following statements about the asymptotic behaviour of f(n), g(n), and h(n) is true?
- f(n) = O(g(n)); g(n) = O(h(n))
- f(n) = Ω(g(n)); g(n) = O(h(n))
- g(n) = O(f(n)); h(n) = O(f(n))
- h(n) = O(f(n)); g(n) = Ω(f(n))
Correct answer: h(n) = O(f(n)); g(n) = Ω(f(n))
Solution
h(n)=n^(log n)=2^((log n)^2), which is sub-exponential, so h(n)=O(f(n)) with f(n)=2^n. Also n! grows faster than 2^n, so g(n)=Omega(f(n)). Thus the correct statement is 'h(n)=O(f(n)); g(n)=Omega(f(n))'. Stored option 0 fails because g(n)=n! is not O(h(n)).
Related GATE Technical questions
⚔️ Practice GATE Technical free + battle 1v1 →