StreakPeaked· Practice

ExamsGATETechnical

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?

  1. f(n) = O(g(n)); g(n) = O(h(n))
  2. f(n) = Ω(g(n)); g(n) = O(h(n))
  3. g(n) = O(f(n)); h(n) = O(f(n))
  4. 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 →