Function Growth: Big-O Notation
The previous slide taught us that not only are the values of $2^n - 1$ larger than those of $n^2$ for large values of $n$ (specifically, $n \ge 5$), but also that the function $f(n) = 2^n - 1$ growth at a much bigger rate than $g(n) = n^2$. That is, even if we multiply $g(n) = n^2$ by a huge constant, the function $f(n) = 2^n - 1$ will still keep surpassing $g(n) = n^2$ for a large enough $n$.
A couple more fun facts:
- On the previous slide, we said that $\log_{10} n = \Theta(\log_2 n)$. This is true because $\log_{10} n$ and $\log_2 n$ are constant multiples of one another! We know this because of the "change of base" logarithms formula: $\log_b a = \frac{\log_d a}{\log_d b}$.
In our case, we have: $\log_{10} n = \frac{\log_2 n}{\log_2 10} \Rightarrow \log_2 10 \cdot \log_{10} n = \log_2 n \approx 3.3219 \cdot \log_{10} n = \log_2 n$.
- On the other hand, $2^n$ and $e^n$ ($e \approx 2.72$ and is called "Euler's number") are not constant multiples. This means that $e^n$ will grow strictly faster than $2^n$ since $e > 2$. In other words, the following statements are all true: $2^n = \mathcal{O}(e^n)$, $2^n = \mathcal{o}(e^n)$, $e^n = \Omega(2^n)$, and $e^n = \omega(2^n)$.