Question

Let f(n)=nf(n) = n and g(n)=n1+sin⁡ng(n) = n^{1 + \sin n}, where nn is a positive integer. Which of the following statements is/are correct?
I. f(n)=O(g(n))f(n) = O(g(n))
II. f(n)=Ω(g(n))f(n) = \Omega(g(n))

Choose one option
Official answer and solution
Official answer
D
From
Official GATE 2015 answer key

Solution

Analyze the asymptotic behavior of f(n) and g(n) under the oscillating term sin(n).

We are given f(n)=nf(n) = n and g(n)=n1+sin⁡ng(n) = n^{1 + \sin n} for positive integers nn.

The function sin⁡n\sin n oscillates continuously in the interval [−1,1][-1, 1] as n→∞n \to \infty:

  • For values of nn where sin⁡n≈−1\sin n \approx -1, the exponent is 1+sin⁡n≈01 + \sin n \approx 0, so g(n)≈n0=1g(n) \approx n^0 = 1. Here f(n)g(n)=n1=n→∞\frac{f(n)}{g(n)} = \frac{n}{1} = n \to \infty.
    Because f(n)g(n)\frac{f(n)}{g(n)} is unbounded as n→∞n \to \infty, there is no constant cc such that f(n)≤c⋅g(n)f(n) \le c \cdot g(n) for all large nn. Thus, f(n)≠O(g(n))f(n) \ne O(g(n)), and Statement I is false.
  • For values of nn where sin⁡n≈1\sin n \approx 1, the exponent is 1+sin⁡n≈21 + \sin n \approx 2, so g(n)≈n2g(n) \approx n^2. Here g(n)f(n)=n2n=n→∞\frac{g(n)}{f(n)} = \frac{n^2}{n} = n \to \infty.
    Because f(n)g(n)→0\frac{f(n)}{g(n)} \to 0, there is no positive constant cc such that f(n)≥c⋅g(n)f(n) \ge c \cdot g(n) for all large nn. Thus, f(n)≠Ω(g(n))f(n) \ne \Omega(g(n)), and Statement II is false.

Because neither asymptotic relation holds, the answer is Neither I nor II (Option D).

Final answer

D

Common trap

Averaging the sine function to 0 and assuming g(n) = n, ignoring that asymptotic bounds must hold for all sufficiently large n.

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

Source

Paper
GATE 2015 Computer Science and Information Technology (CS) Session 3
Question
52 of 65, printed as CS Q.42
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.