GATE / CS ARCHIVE

SIMILAR QUESTIONS / ALGORITHMS

Order reciprocal, logarithmic and polynomial functions

2 questions solved the same way, newest first. Back to Algorithms

How these are solved

Compare positive function ratios against constants or zero to distinguish logarithmic/polynomial dominance and strict versus non-strict asymptotic bounds. 2017 orders five elementary functions;2023 tests n against n² using O/o/Ω/Θ.

1 mark · MSQ
Report issue

Asymptotic Analysis & Recurrences

Question 29, GATE 2023: For f(n)=n and g(n)=n², select true claims: A f∈O(g); B f∈Ω(g); C f∈o(g); D f∈Θ(g).
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, C

f(n)/g(n)=n/n²=1/n tends to 0. Hence f=o(g), which also implies f=O(g). A positive constant lower bound proportional to n² cannot hold for all large n, so f is neither Ω(g) nor Θ(g). Answer A, C.

Teaching detail. The asymptotic definitions distinguish an upper bound from a tight bound. For n≥1, n≤n², so O(g) holds with constant 1. Little-o requires that for every ε>0, n≤εn² for all sufficiently large n; choosing n≥1/ε establishes it. An Ω(n²) lower bound would require 1/n≥c for some fixed c>0 eventually, which is impossible. Since Θ requires both O and Ω, it fails as well. A vanishing ratio is stronger evidence than a few sample comparisons.

Original paper, page 27 · Answer key

1 mark · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 4, GATE 2017: Arrange 10, √n, n, log₂n, 100/n in increasing asymptotic complexity. A log₂n,100/n,10,√n,n; B 100/n,10,log₂n,√n,n; C 10,100/n,√n,log₂n,n; D 100/n,log₂n,10,√n,n.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. Compare eventual growth rather than the values at a particular small n. The reciprocal 100/n tends to zero while 10 stays constant.

2. log₂n is unbounded, but log₂n/√n→0. Also √n/n=1/√n→0. These limiting ratios put logarithm below square root below linear growth.

3. Consequently 100/n < 10 < log₂n < √n < n in asymptotic growth, option B. Constants such as 100 do not reverse eventual ordering.

Original paper, page 3 · Answer key