Skip to main content

GATE CSE 2015Algorithms › Growth of Functions & Complexity AnalysisVerified

GATE CSE 2015 PYQ: Consider the equality ∑ i = 0 n i 3 = X \displaystyle{\sum_{i=0}^n} i^3 = X i = 0 ∑ n ​ i 3 = X and the…

Consider the equality ∑i=0ni3=X\displaystyle{\sum_{i=0}^n} i^3 = X and the following choices for XX:

  1. Θ(n4)\Theta(n^4)
  2. Θ(n5)\Theta(n^5)
  3. O(n5)O(n^5)
  4. Ω(n3)\Omega(n^3)

The equality above remains correct if XX is replaced by

  1. A
    Only I
  2. B
    Only II
  3. C
    I or III or IV but not II
    Correct answer
  4. D
    II or III or IV but not I

Answer

(C) I or III or IV but not II

Approach

Evaluate the closed-form value of the sum of cubes to get a tight bound, then test each of the four asymptotic statements (I–IV) against that tight bound, and finally match the true set to the given option choices.

Since $\sum_{i=0}^{n} i^3 = \left(\frac{n(n+1)}{2}\right)^2 = \Theta(n^4)$, the tight bound I is true while the tight bound II is false. A $\Theta(n^4)$ function is also $O(n^5)$ (statement III, since upper bounds may be loose) and also $\Omega(n^3)$ (statement IV, since lower bounds may be loose). Hence I, III and IV are correct and II is not, giving option C.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.