I'm a programmer who never studied Algorithms formally, and have always wanted to fill in that gap in my learning. I'm currently working my way through some books and online material, and I understand conceptually Big O, i.e. what it's for, and the different categories of performance, e.g. constant, linear, quadratic, etc. I can code up problems and intuitively understand the performance implications of different approaches.
However, the thing I keep getting stuck at is the notation for proof of an algorithm, and I'm not sure where to look to figure this part out. All the books I've looked at assume this level of knowledge.
For example, this statement from Skiena's Algorithm Design Manual has me stumped:
f(n) = O(g(n)) means c * g(n) is an upper bound on f(n).
Thus there exists some constant c such that f(n) is always ≤ c * g(n), for large enough n (i.e. n ≥ n0 for some constant n0).
This is the corollary exercise the reader should complete:
3n^2 − 100n + 6 = O(n^2), because I choose c = 3 and 3n^2 > 3n^2− 100n + 6;
I can make some sense of both statements, and can logically see that the second one holds true. I also understand the concept of upper bound, i.e. this is for the worst case scenario.
But I'm stuck on simple things like, what do the following above refer to?
g(n)
n ≥ n0 for some constant n0
Overall, I can't put the pieces together to make sense of the entire proof.
Can anyone help me parse the above statements in plain English, and show how they relate to the exercise, in a way that would make sense to someone non-technical