Worked Examples: Asymptotic Notation

These examples are designed to step through the logical process of applying the algorithmic concepts.

Example 1: Basic Polynomial
❓ Problem: Prove $3n^2 - 100n + 6 \in O(n^2)$.
💡 Solution: Choose $n_0$ such that $-100n$ is overwhelmed... $3n^2 + 6 \le 4n^2$ for $n \ge 3$.
Example 2: Big-Omega
❓ Problem: Prove $n^{1.1} \in \Omega(n)$.
💡 Solution: Use limits or definition. $n^{1.1}/n = n^{0.1} \to \infty$.
Example 3: Limits
❓ Problem: Compare $n \log n$ and $n^{1.5}$.
💡 Solution: Limit is 0. So $n \log n \in o(n^{1.5})$.
Example 4: Little-o
❓ Problem: Is $2n \in o(n)$?
💡 Solution: Limit is 2. Not 0. So False.
Example 5: Exponential
❓ Problem: Is $2^{n+1} \in O(2^n)$?
💡 Solution: Yes. $2^{n+1} = 2 \cdot 2^n$. Constant factor 2.
Example 6: Factorial
❓ Problem: Compare $n!$ and $2^n$.
💡 Solution: $n!$ grows much faster. $n! \in \Omega(2^n)$.