Let \(𝑓(𝑛) = 𝑛\) and \(𝑔(𝑛) = 𝑛^{(1+ sin \ 𝑛)}\) , where \(𝑛\) is a…

2015

LetΒ \(𝑓(𝑛) = 𝑛\) and \(𝑔(𝑛) = 𝑛^{(1+ sin \ 𝑛)}\) , whereΒ \(𝑛\) is a positive integer. Which of the following statements is/are correct?

I. 𝑓(𝑛) = 𝑂(𝑔(𝑛))

II. 𝑓(𝑛) = Ω(𝑔(𝑛))

  1. A.

    Only I

  2. B.

    Only II

  3. C.

    Both I and II

  4. D.

    Neither I nor II

Attempted by 270 students.

Show answer & explanation

Correct answer: D

Key idea: sin n oscillates between -1 and 1, and for infinitely many integers n it can be made arbitrarily close to -1 or to 1.

  • If sin n is very close to -1 (along some subsequence), then 1+sin n is near 0, so g(n)=n^{1+sin n}=n^{Ξ΅} with Ξ΅β†’0. In that case g(n)=o(n) and f(n)/g(n)β†’βˆž, so f(n) is not O(g(n)).

  • If sin n is very close to 1 (along another subsequence), then 1+sin n is near 2, so g(n)β‰ˆn^2 and f(n)/g(n)β‰ˆ1/nβ†’0, so f(n) is not Ω(g(n)).

Conclusion: Because g(n) can be arbitrarily much smaller than n for some n and arbitrarily much larger for other n, neither f(n)=O(g(n)) nor f(n)=Ω(g(n)) holds. Therefore neither statement is correct.

A video solution is available for this question β€” log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir