Asymptotic Bounds, Order of Growth & Growth Hierarchy
“f(n) = Theta(g(n)) iff 0 < lim_{n -> inf} [f(n) / g(n)] < inf. If ratio is 0 => f(n) = o(g(n)). If ratio is inf => f(n) = omega(g(n)).”
- —Big-O (Upper Bound): 0 <= f(n) <= c * g(n) for all n >= n0.
- —Big-Omega (Lower Bound): 0 <= c * g(n) <= f(n) for all n >= n0.
- —Big-Theta (Tight Bound): 0 <= c1 * g(n) <= f(n) <= c2 * g(n) for all n >= n0.
- —Little-o (Strict Upper Bound): lim_{n -> inf} [f(n) / g(n)] = 0.
- —Little-omega (Strict Lower Bound): lim_{n -> inf} [f(n) / g(n)] = inf.
- —Growth Hierarchy: 1 < log(log n) < log n < (log n)^k < n^epsilon < sqrt(n) < n < n log n < n^2 < n^k < 2^(sqrt(n)) < 2^n < 3^n < n! < n^n.
- —Stirling's Formula: n! approx sqrt(2 * pi * n) * (n / e)^n => log(n!) = Theta(n log n).
- —f(n) = O(g(n)) DOES NOT imply 2^{f(n)} = O(2^{g(n)}). Counterexample: f(n) = 2n, g(n) = n. 2^{2n} = 4^n != O(2^n).
- —Little-o and Little-omega are NOT reflexive: f(n) != o(f(n)) and f(n) != omega(f(n)).
- —log(n!) = Theta(n log n), but n! = o(n^n) because (n/e)^n grows strictly slower than n^n.