UGC-NET Dec 2013 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0025

Big-O estimate for $f(x)=(x+1) \log(x^2 +1) + 3x^2 $ is given as
  1. A
    $O(x \log x)$
  2. B
    $O(x^2)$
  3. C
    $O(x^3)$
  4. D
    $O(x^2 \log x)$

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionBound each term for \(x>1\).\[\log(x^2+1)\le\log(2x^2)=\log 2+2\log x=O(\log x),\]so \((x+1)\log(x^2+1)=O(x\log x)\). Since \(x\log x\le x^2\) for large \(x\), the first term is \(O(x^2)\), and \(3x^2=O(x^2)\).\[f(x)=O(x^2).\]\(O(x^3)\) and \(O(x^2\log x)\) are also upper bounds but not the best estimate; \(O(x\log x)\) is too small.Answer: B

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com