Asymptotic Analysis
Warning
I personally prefer to write it as \(f(n) \in O(g(n))\), instead of \(f(n) = O(g(n))\) because \(O(g(n))\) is a set of functions. Therefore, it is only appropriate to use set notations.
Big-O
We say that \(f(n) \in O(g(n))\) if:
- Some \(c > 0\)
- Some large \(n_{0} > 0\),
\[
f(n) \leq c\cdot g(n), \text{for all } n \geq n_{0}
\]
Formal Mathematical Definition
\[
\exists c > 0, \exists n_0 > 0, \forall n \geq n_0, f(n) \leq c \cdot g(n)
\]
where
- \(c, n_0, n \in \mathbb{R}\)
Big-Omega
\(f(n) \in \Omega(g(n))\) if:
- Some \(c > 0\)
- Some large \(n_{0} > 0\),
\[
f(n) \geq c\cdot g(n), \text{for all } n \geq n_{0}
\]
Big-Theta
\(f(n) \in \Theta(g(n))\) if:
- \(f(n) \in \Omega(g(n))\) and
- \(f(n) \in O(g(n))\)