Comparing Growth Rates Using Limits

 

Comparing Growth Rates Using Limits

One standard method to compare function sizes is to evaluate:

limnf(n)g(n)​

The value of this limit determines the relative growth of the functions.


Case 1: Limit Equals Zero

If:

limnf(n)g(n)=0\lim_{n\to\infty}\frac{f(n)}{g(n)}=0

then:

  • f(n)f(n) grows slower than g(n)g(n)
  • f(n)=o(g(n))f(n)=o(g(n))

Example

Compare:

f(n)=nf(n)=n

and

g(n)=n2g(n)=n^2

Compute:

limnnn2=limn1n=0\lim_{n\to\infty}\frac{n}{n^2}=\lim_{n\to\infty}\frac{1}{n}=0

Hence:

n=o(n2)n=o(n^2)

So n2n^2 is asymptotically larger.


Case 2: Limit Equals a Positive Constant

If:

limnf(n)g(n)=c,0<c<\lim_{n\to\infty}\frac{f(n)}{g(n)}=c,\quad 0<c<\infty

then:

  • Both functions grow at the same rate
  • f(n)=Θ(g(n))f(n)=\Theta(g(n))

Example

Compare:

f(n)=3n2+2nf(n)=3n^2+2n

and

g(n)=n2g(n)=n^2

Compute:

limn3n2+2nn2=limn(3+2n)=3\lim_{n\to\infty}\frac{3n^2+2n}{n^2}=\lim_{n\to\infty}\left(3+\frac{2}{n}\right)=3

Since the limit is a positive constant:

f(n)=Θ(n2)f(n)=\Theta(n^2)

Case 3: Limit Equals Infinity

If:

limnf(n)g(n)=\lim_{n\to\infty}\frac{f(n)}{g(n)}=\infty

then:

  • f(n)f(n)grows faster than g(n)g(n)
  • f(n)=ω(g(n))f(n)=\omega(g(n))

Example

Compare:

f(n)=n3f(n)=n^3

and

g(n)=n2g(n)=n^2

Compute:

limnn3n2=∞

Therefore:

n3=ω(n2)n^3=\omega(n^2)

Common Growth Rates

The following ordering is fundamental in algorithm analysis:

1<logn<n<nlogn<n2<n3<2n<n!1 < \log n < n < n\log n < n^2 < n^3 < 2^n < n!

Interpretation of Growth Rates

Function    Growth TypeEfficiency
11
    Constant    Excellent
logn\log n
    Logarithmic    Very Efficient
nn
    Linear    Efficient
nlognn\log n
    Linearithmic    Good
n2n^2
    Quadratic    Moderate
n3n^3    
    Cubic    Slow
2n2^n
    Exponential    Very Slow
n!n!
    Factorial    Impractical

Dominant Term Principle

In asymptotic analysis, the highest-order term dominates.


Example 1

f(n)=5n3+4n2+7n+2f(n)=5n^3+4n^2+7n+2

Dominant term:

n3n^3

Thus:

f(n)=Θ(n3)f(n)=\Theta(n^3)

Example 2

f(n)=1000n+50f(n)=1000n+50

Dominant term:

nn

Thus:

f(n)=Θ(n)f(n)=\Theta(n)

Ignoring Constants

Constant multipliers do not affect asymptotic growth.


Example

100n100n

and

nn

have the same asymptotic size:

100n=Θ(n)100n=\Theta(n)

because constants are ignored.


Comparing Polynomial Functions

For polynomials:

  • Highest degree term determines growth.

Example

Compare:

n2n^2

and

n5n^5

Since degree 5 is larger:

n2=o(n5)n^2=o(n^5)

Comparing Logarithmic and Polynomial Functions

Any polynomial grows faster than logarithmic functions.


Example

logn=o(n)\log n=o(n)

because:

limnlognn=0\lim_{n\to\infty}\frac{\log n}{n}=0


Comparing Polynomial and Exponential Functions

Exponential functions grow faster than polynomial functions.


Example

n5=o(2n)n^5=o(2^n)

because:

limnn52n=0\lim_{n\to\infty}\frac{n^5}{2^n}=0


Comparing Exponential and Factorial Functions

Factorial functions grow faster than exponentials.


Example

2n=o(n!)2^n=o(n!)

Summary Table for Comparing Function Sizes

Limit Result            Relationship
00
f(n)=o(g(n))f(n)=o(g(n))
Positive constantf(n)=Θ(g(n))f(n)=\Theta(g(n))
\infty
f(n)=ω(g(n))

Practical Importance in Algorithms

Comparing function sizes helps in:

  • Choosing efficient algorithms
  • Predicting scalability
  • Understanding performance limits
  • Designing optimized systems

Example in Sorting

AlgorithmComplexity
Bubble Sort        O(n2)O(n^2)
Merge SortO(nlogn)O(n\log n)

Since:

nlogn=o(n2)n\log n=o(n^2)

Merge Sort is asymptotically better.


Conclusion

Comparing the “sizes” of functions is central to asymptotic analysis. The comparison is based on how rapidly functions grow as input size increases.

The key tool is:

limnf(n)g(n)\lim_{n\to\infty}\frac{f(n)}{g(n)}

Using limits and asymptotic notations, we can classify functions into:

  • Smaller growth
  • Equal growth
  • Faster growth

This enables rigorous comparison of algorithms independent of hardware and implementation details, forming the mathematical foundation of algorithm analysis.

Comments