next up previous
Up: CSE 2320: Algorithms and Previous: Mathematical Induction

Example

Show \( \sum_{k=1}^n k^2 = O(n^3) \leq cn^3 \)

1. For n = 1, 1 $\leq$ c

2. Assume \( \sum_{k=1}^n k^2 \leq cn^3 \)

3. Show \( \sum_{k=1}^{n+1} k^2 \leq c(n+1)^3 \)

Note: (n+1)3 = n3 + 3n2 + 3n + 1


\begin{eqnarray*}\sum_{k=1}^{n+1} k^2 & = & \sum_{k=1}^n k^2 + (n+1)^2 \\
& \l...
... 2n + 1 \\
& \leq & c(n^3 + 3n^2 + 3n + 1) \\
& = & c(n+1)^3
\end{eqnarray*}




Copyright © 1998 The University of Texas at Arlington