01 / 20

Growth Rates &
Function Classes

Learn how to compare functions by their asymptotic growth, master Big-O notation, and rank the most common function classes from slowest to fastest.

Discrete Math

Why Do Growth Rates Matter?

When we analyze algorithms or mathematical processes, we need to understand how their resource usage scales as the input size \( n \) grows. A function that looks fast at \( n = 10 \) might become impossibly slow at \( n = 10{,}000 \).

Algorithm Design
Choose between competing solutions by comparing how they scale
Feasibility
Determine if a problem is practically solvable for large inputs

What is Asymptotic Growth?

Asymptotic growth describes how a function behaves as its input approaches infinity. We compare two functions \( f(n) \) and \( g(n) \) by asking: which one eventually dominates?

1
Ignore constants: \( 5n^2 \) and \( 100n^2 \) grow at the same rate
2
Ignore lower-order terms: \( n^2 + 3n + 7 \) grows like \( n^2 \)
3
Focus on dominance: which function "wins" for all sufficiently large \( n \)?

Visualizing Growth Rates

The Big-O Definition

In plain language: \( f \) grows no faster than \( g \), up to a constant multiplier, once \( n \) is large enough. Big-O gives an upper bound on growth.

\( O(g(n)) \)
Upper bound: \( f \) grows at most as fast as \( g \)
\( \Omega(g(n)) \)
Lower bound: \( f \) grows at least as fast as \( g \)
\( \Theta(g(n)) \)
Tight bound: \( f \) grows at the same rate as \( g \)

\( O \) vs \( \Omega \) vs \( \Theta \)

The Growth Hierarchy

The following ranking orders common function classes from slowest to fastest growing. Each class eventually dominates everything to its left:

Polynomial vs Exponential

The most important dividing line in computer science is between polynomial and exponential growth. This boundary separates tractable from intractable problems.

Polynomial Exponential
Form \( n^k \) for constant \( k \) \( a^n \) for constant \( a > 1 \)
Examples \( n, n^2, n^3 \) \( 2^n, 3^n, 10^n \)
\( n = 20 \) \( 400 \) (\( n^2 \)) \( 1{,}048{,}576 \) (\( 2^n \))
\( n = 100 \) \( 10{,}000 \) \( \approx 10^{30} \)
Tractable? Generally yes Generally no

How to Compare Growth Rates

1
Identify the dominant term in each function. Drop constants and lower-order terms.
2
Classify each dominant term into a function class: constant, logarithmic, polynomial, exponential, or factorial.
3
Apply the hierarchy: \( 1 \prec \log n \prec n^a \prec b^n \prec n! \). If both are polynomial, compare exponents. If both are exponential, compare bases.
4
Use the limit test if needed: compute \( \lim_{n \to \infty} \frac{f(n)}{g(n)} \). If it equals 0, then \( f = O(g) \); if \( \infty \), then \( g = O(f) \); if a positive constant, then \( f = \Theta(g) \).

Example 1: Simplify and Classify

1
Identify the dominant term: The highest power is \( 7n^3 \).
2
Drop the constant coefficient: \( 7n^3 \to n^3 \).
3
Drop lower-order terms: \( 12n^2, -5n, 100 \) are all dominated by \( n^3 \).

Example 2: Comparing Two Functions

1
Classify: \( n^{10} \) is polynomial; \( 2^n \) is exponential.
2
Apply hierarchy: Every polynomial grows slower than every exponential.
3
Verify with limit test: \( \lim_{n \to \infty} \frac{n^{10}}{2^n} = 0 \) (by L'Hopital's rule applied 10 times).

Example 3: The Limit Test

1
Compute the limit: \( \lim_{n \to \infty} \frac{n \log n}{n^{1.5}} = \lim_{n \to \infty} \frac{\log n}{n^{0.5}} \)
2
Apply L'Hopital: \( \lim_{n \to \infty} \frac{1/n}{0.5 \, n^{-0.5}} = \lim_{n \to \infty} \frac{2}{n^{0.5}} = 0 \)
3
Interpret: Since the limit is 0, we conclude \( n \log n = O(n^{1.5}) \).

The Power of Logarithms

Logarithmic functions are the slowest-growing unbounded class. They appear in algorithms that halve the problem at each step (like binary search).

\( \log_2 n \)
Binary search, balanced BST lookup
\( n \log n \)
Merge sort, heap sort, FFT

Common Mistakes

✕ Confusing \( O \) with \( \Theta \)
Saying "\( n \) is \( O(n^3) \)" is true but weak. It gives an upper bound but not a tight one. Use \( \Theta \) when you mean "exactly this rate."
✕ Keeping coefficients
Writing \( O(2n) \) or \( O(3n^2) \) is incorrect notation. Always drop constants: \( O(n) \), \( O(n^2) \).
✕ Log base matters
Thinking \( O(\log_2 n) \neq O(\log_{10} n) \). In Big-O, log base is irrelevant: they differ by a constant factor.

Function Class Summary

Class Big-O Example \( n = 1000 \)
Constant \( O(1) \) Array index 1
Logarithmic \( O(\log n) \) Binary search 10
Linear \( O(n) \) Single loop 1,000
Linearithmic \( O(n \log n) \) Merge sort 10,000
Quadratic \( O(n^2) \) Nested loops 1,000,000
Exponential \( O(2^n) \) Brute force \( \approx 10^{301} \)
Factorial \( O(n!) \) Permutations \( \approx 10^{2567} \)

Question 1 of 5

What is the Big-O classification of \( f(n) = 4n^2 + 9n + 15 \)?

Question 2 of 5

Which function grows faster as \( n \to \infty \)?

Question 3 of 5

If \( \lim_{n \to \infty} \frac{f(n)}{g(n)} = 5 \), what can we conclude?

Question 4 of 5

Place these in order from slowest to fastest growth:
\( n!, \; n \log n, \; \log n, \; n^2, \; 2^n \)

Question 5 of 5

Why is \( O(\log_2 n) \) the same class as \( O(\log_{10} n) \)?