`Theta`-notation
To begin, let's be precise in what we mean by the notation `Theta(g(n))` for some function `g`.
Definition. For a given function `g(n)` (which we will assume is usually from `NN -> ZZ`), we denote by `Theta(g(n))`
the set of functions:
`Theta(g(n)) = { f(n): text{there exists } c_1, c_2 > 0 text{and } n_0`
`text{ such that } 0 le c_1g(n) le f(n) le c_2 g(n) text{ for all } n ge n_0}.`
- Intuitively, a function `f` is in `Theta(g(n))` when for large enough `n` it can always be bounded above and below by some constant times `g(n)`.
- Since `Theta(g(n))` is a set of functions, we should write `f(n) in Theta(g(n))` to denote membership.
- It is a longstanding tradition in computer science to abuse notation and write `f(n) = Theta(g(n))`.
- Because `f(n)` is within a constant factor of `g(n)` both above and below, we say that `g(n)` is an asymptotically tight bound for `f(n)`.
- The definition above requires that every member `f(n) in Theta(g(n))` be asymptotically non-negative as `c_1g(n) ge 0` for `n > n_0`.
- So for the set `Theta(g(n))` to be nonempty `g(n)` itself must be asymptotically nonnegative.