Skip to content
Official PYQ · 2023

GATE CS 2023 Q19 — Asymptotic Worst Case Time and Space Complexity

Explain with AI

Let ff and gg be functions of natural numbers given by f(n)=nf(n)=n and g(n)=n2.g(n)=n^{2}. Which of the following statements is/are TRUE?\text{TRUE}?

Select all correct options
View worked solution

Answer: A;C

We are given two functions of natural numbers:

f(n)=nandg(n)=n2f(n) = n \quad \text{and} \quad g(n) = n^2

Let us analyze each asymptotic relation between f(n)f(n) and g(n)g(n):

  1. Big-O notation (OO):

    f(n)∈O(g(n))f(n) \in O(g(n)) if there exist positive constants cc and n0n_0 such that f(n)≤c⋅g(n)f(n) \le c \cdot g(n) for all n≥n0n \ge n_0.

    Since n≤1⋅n2n \le 1 \cdot n^2 for all n≥1n \ge 1, this condition holds. Thus, f∈O(g)f \in O(g) is TRUE (Option A).

  2. Big-Omega notation (Ω\Omega):

    f(n)∈Ω(g(n))f(n) \in \Omega(g(n)) if there exist positive constants cc and n0n_0 such that f(n)≥c⋅g(n)f(n) \ge c \cdot g(n) for all n≥n0n \ge n_0.

    Since nn grows strictly slower than n2n^2, we cannot find such a constant c>0c > 0 for large nn. Thus, f∈Ω(g)f \in \Omega(g) is FALSE (Option B).

  3. Little-o notation (oo):

    f(n)∈o(g(n))f(n) \in o(g(n)) if lim⁡n→∞f(n)g(n)=0\lim_{n \to \infty} \frac{f(n)}{g(n)} = 0.

    Evaluating the limit:

    lim⁡n→∞nn2=lim⁡n→∞1n=0\lim_{n \to \infty} \frac{n}{n^2} = \lim_{n \to \infty} \frac{1}{n} = 0

    Thus, f∈o(g)f \in o(g) is TRUE (Option C).

  4. Theta notation (Θ\Theta):

    f(n)∈Θ(g(n))f(n) \in \Theta(g(n)) if and only if f(n)∈O(g(n))f(n) \in O(g(n)) and f(n)∈Ω(g(n))f(n) \in \Omega(g(n)). Since f(n)∉Ω(g(n))f(n) \notin \Omega(g(n)), f∈Θ(g)f \in \Theta(g) is FALSE (Option D).

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Asymptotic Worst Case Time and Space Complexity questions