I am trying to refresh on algorithm analysis. I am looking for a refresher on summation formulas.
E.g.
I can derive the $$\sum_{i = 0}^{N-1}i$$ to be N(N-1)/2 but I am rusty on the and more complex e.g. something like $$\sum_{i = 0}^{N-1}{\sum_{j = i+1}^{N-1}\sum_{k=j+1}^{N-1}}$$
Is there a good refresher material for this?
In my example my result of the inner most loop is:
$$N(N-1)(N-2)/2$$
which is wrong though
UPDATE
The sums I am describing are basically representing the following algorithm:
for (i = 0; i < n; i++) {
for( j = i+1; j < n; j++) {
for (k = j +1; j < n; j++) {
//code
}
}
}
This algorithm is O(N^3) according to all textbooks by definition of its structure. I am not sure why the answers are giving me an O(N^4)
Well, the basic time proven technique for simpler problems like this is guessing + proof by induction, something you can learn best by excercise. There certainly is way more advanced stuff even going into analytic number theory, but at least initially I would suggest you should get some problem book on induction or google a bit for excercises (there are hundreds around) and just start. This really helps to get some intuition, which I believe is really important to understand the more complex things.
If you want some literature instead, you should search for some books about discrete mathematics, there are several that are centered around computer science and should cover the topics you need. I've always been told that "Concrete Mathematics" by Graham, Knuth and Patashnik is a classic, but I haven't read it myself, so I won't guarantee anything.