In functions, the "little o" notation, written as o(g(x))o open paren g of x close paren π(π(π₯))
, is a way to describe the asymptotic behavior of a function f(x)f of x
π(π₯)
. Specifically, f(x)=o(g(x))f of x equals o open paren g of x close paren
π(π₯)=π(π(π₯))
means that f(x)f of x
π(π₯)
grows strictly slower than g(x)g of x
π(π₯)
as xx
π₯
approaches a certain limit, often infinity. Intuitively, it signifies that f(x)f of x
π(π₯)
becomes insignificant or negligible in comparison to g(x)g of x
π(π₯)
as the input gets very large.
Formal definition
For two functions, f(x)f of x
π(π₯)
and g(x)g of x
π(π₯)
, we say that f(x)=o(g(x))f of x equals o open paren g of x close paren
π(π₯)=π(π(π₯))
as xββx right arrow infinity
π₯ββ
if for every positive constant c>0c is greater than 0
π>0
, there exists a constant x0x sub 0
π₯0
such that:|f(x)|<c|g(x)|the absolute value of f of x end-absolute-value is less than c the absolute value of g of x end-absolute-value
|π(π₯)|<π|π(π₯)|
for all xβ₯x0x is greater than or equal to x sub 0
π₯β₯π₯0
.
This definition is equivalent to the limit definition, which states that the ratio of the two functions approaches zero as xx
π₯
tends to infinity:limxββf(x)g(x)=0limit over x right arrow infinity of f of x over g of x end-fraction equals 0
limπ₯ββπ(π₯)π(π₯)=0
The notation can also be used for limits as xx
π₯
approaches a finite value, aa
π
. In this case, f(x)=o(g(x))f of x equals o open paren g of x close paren
π(π₯)=π(π(π₯))
as xβax right arrow a
π₯βπ
if:limxβaf(x)g(x)=0limit over x right arrow a of f of x over g of x end-fraction equals 0
limπ₯βππ(π₯)π(π₯)=0
Little-o versus big-O notation
To fully grasp the meaning of little-o, it's essential to understand its relationship with big-O notation, O(g(x))cap O open paren g of x close paren
π(π(π₯))
, and the key distinction between them.
| Feature | Little-o (o(g(x))o open paren g of x close paren π(π(π₯)) ) | Big-O (O(g(x))cap O open paren g of x close paren π(π(π₯)) ) |
|---|---|---|
| Growth rate | f(x)f of x π(π₯) grows strictly slower than g(x)g of x π(π₯) . | f(x)f of x π(π₯) grows at most as fast as g(x)g of x π(π₯) . |
| Analogy | Like a "strictly less than" relation (f<gf is less than g π<π ). | Like a "less than or equal to" relation (fβ€gf is less than or equal to g πβ€π ). |
| Bound tightness | Not an asymptotically tight upper bound. | Can be an asymptotically tight upper bound. |
| Example | n=o(n2)n equals o open paren n squared close paren π=π(π2) because nn π grows strictly slower than n2n squared π2 . | 3n2+4n=O(n2)3 n squared plus 4 n equals cap O open paren n squared close paren 3π2+4π=π(π2) because the dominant term, n2n squared π2 , is of the same order. |
| Example (strictness) | 3n2+4n3 n squared plus 4 n 3π2+4π is noto(n2)o open paren n squared close paren π(π2) because it grows at the same rate as n2n squared π2 . | 3n2+4n3 n squared plus 4 n 3π2+4π isO(n2)cap O open paren n squared close paren π(π2) . |
Examples of little-o notation
Example 1: Comparing polynomials
Question: Is f(n)=100n2+50nf of n equals 100 n squared plus 50 n
π(π)=100π2+50π
in o(n3)o open paren n cubed close paren
π(π3)
?Analysis: We use the limit definition:limnββ100n2+50nn3=limnββ100n+50n2=0limit over n right arrow infinity of the fraction with numerator 100 n squared plus 50 n and denominator n cubed end-fraction equals limit over n right arrow infinity of 100 over n end-fraction plus the fraction with numerator 50 and denominator n squared end-fraction equals 0
limπββ100π2+50ππ3=limπββ100π+50π2=0
Conclusion: Since the limit is 0, 100n2+50n=o(n3)100 n squared plus 50 n equals o open paren n cubed close paren
100π2+50π=π(π3)
. This confirms that a quadratic function grows strictly slower than a cubic function.
Example 2: Comparing a function with itself
Question: Is f(n)=3n2f of n equals 3 n squared
π(π)=3π2
in o(n2)o open paren n squared close paren
π(π2)
?Analysis: Using the limit definition:limnββ3n2n2=3limit over n right arrow infinity of the fraction with numerator 3 n squared and denominator n squared end-fraction equals 3
limπββ3π2π2=3
Conclusion: The limit is 3, not 0. Therefore, 3n23 n squared
3π2
is not o(n2)o open paren n squared close paren
π(π2)
. This reinforces that little-o denotes a strictly slower growth rate.
Example 3: Expressing function behavior near a point
Little-o is not only for limits at infinity. It's used in calculus to approximate functions, such as in the definition of a derivative.
The statement that a function ff
π
is differentiable at point aa
π
with derivative fβ²(a)f prime of a
πβ²(π)
can be expressed using little-o:f(a+h)=f(a)+fβ²(a)h+o(h)f of open paren a plus h close paren equals f of a plus f prime of a h plus o open paren h close paren
π(π+β)=π(π)+πβ²(π)β+π(β)
as hβ0h right arrow 0
ββ0
.
This means that the remainder term, f(a+h)βf(a)βfβ²(a)hf of open paren a plus h close paren minus f of a minus f prime of a h
π(π+β)βπ(π)βπβ²(π)β
, is an unspecified function that goes to zero faster than hh
β
. In other words:limhβ0f(a+h)βf(a)βfβ²(a)hh=0limit over h right arrow 0 of the fraction with numerator f of open paren a plus h close paren minus f of a minus f prime of a h and denominator h end-fraction equals 0
limββ0π(π+β)βπ(π)βπβ²(π)ββ=0
Rearranging this gives the standard definition of a derivative:limhβ0f(a+h)βf(a)h=fβ²(a)limit over h right arrow 0 of the fraction with numerator f of open paren a plus h close paren minus f of a and denominator h end-fraction equals f prime of a
limββ0π(π+β)βπ(π)β=πβ²(π)
Applications in computer science and mathematics
-
Algorithm analysis: In computer science, little-o can describe an algorithm's runtime, indicating a loose upper bound that isn't tight. This is useful when the exact complexity is very difficult to pin down but is known to be strictly less than a certain function. For example, a fast algorithm might have a runtime that is o(n2)o open paren n squared close paren
π(π2)
, even if its tight bound is more complex.
-
Approximations: In mathematics, little-o is a powerful tool for expressing approximations, particularly in Taylor series expansions. It provides a concise way to represent an error term that becomes negligible as a variable approaches a certain value.
-
Probability and statistics: Little-o notation is used in analyzing the asymptotic behavior of estimators and other statistical quantities, showing when one term becomes dominated by another as the sample size grows.