Midterm review

Exercise 9 (d) asks to show i=0 to n    i2   =   (n3).

First you would need to get the in closed form. I claim that
i=0 to n    i2   =   n(n+1)(2n+1)/6

First, this is easy to see since we have stated the from i=1 to n at our review page.

Now, if the only difference is that we also have the sum for when i is 0, well, that just means we add 02 to the sum. Big deal, 02 = 0, so the sum is the same. Nonetheless, in case the is not one you know, you should be familiar with proofs by induction. So, here is the proof to remind you. I will go over it on the review day.

Big Oh, Omega and Theta

So, we have i=0 to n   i2   =   n(n+1)(2n+1)/6

Now we need to show that n(n+1)(2n+1)/6   =   (n3). We will do this below


Def. f(n) = O(g(n)) iff there exists positive constants c and no such that f(n) < cg(n) for all n , n > no

iff there exists positive constants c1, c2 and no such that c1g(n) < f(n) < c2g(n) for all n , n > no


Show that the following inequalities are correct: