0.7: Asymptotics (Big-O)
- Page ID
- 85513
Let \(f: \mathbb{N} \rightarrow \mathbb{N}\) be a function. We characterize the asymptotic growth of \(f\) in the following ways:
\[\begin{aligned} f(n) \text { is } O(g(n)) & \stackrel{\text { def }}{\Leftrightarrow} \lim _{n \rightarrow \infty} \frac{f(n)}{g(n)}<\infty \\ & \Leftrightarrow \exists c>0: \text { for all but finitely many } n: f(n)<c \cdot g(n) \\ f(n) \text { is } \Omega(g(n)) & \stackrel{\operatorname{def}}{\Leftrightarrow} \lim _{n \rightarrow \infty} \frac{f(n)}{g(n)}>0 \\ & \Leftrightarrow \exists c>0: \text { for all but finitely many } n: f(n)>c \cdot g(n) \\ f(n) \text { is } \Theta(g(n)) & \stackrel{\text { def }}{\Leftrightarrow} f(n) \text { is } O(g(n)) \text { and } f(n) \text { is } \Omega(g(n))
\\ & \Leftrightarrow 0<\lim _{n \rightarrow \infty} \frac{f(n)}{g(n)}<\infty
\\ & \Leftrightarrow \exists c_{1}, c_{2}>0: \text { for all but finitely many } n : c_{1} \cdot g(n)<f(n)<c_{2} \cdot g(n)\end{aligned}\]