Use the definition of Big-O notation to prove the following:
$\sum\limits_{k=3}^n(k^2 - 2k)$ is $O(n^3)$.
Can someone please give me some hints on how to expand $\sum\limits_{k=3}^n(k^2 - 2k)$?
Use the definition of Big-O notation to prove the following:
$\sum\limits_{k=3}^n(k^2 - 2k)$ is $O(n^3)$.
Can someone please give me some hints on how to expand $\sum\limits_{k=3}^n(k^2 - 2k)$?
The easiest way to conclude that it is $\mathcal{O}(n^3)$ is to note that $$k^2 - 2k < k^2 \leq n^2, \,\,\,\,\, \forall k \in \{3,4,\ldots,n\}$$ You could in fact evaluate the sum exactly and then prove that it is $\mathcal{\Omega}(n^3)$. Make use of the fact that $$\sum_{k=1}^n k^2 = \dfrac{n(n+1)(2n+1)}6 \text{ and } \sum_{k=1}^n k = \dfrac{n(n+1)}2$$
Move your mouse over the gray area below for the complete solution.