Next: Master theorem, Previous: Logarithms, Up: Asymptotics
We discuss real valued functions defined on the positive integers.
Let f(n) and g(n) be two such functions.
Generally we compare a function of interest, such as the worst case run time T(n) of some algorithm on inputs of size n, to a leading term or leading monomial. This is a simple, easily remembered function that expresses most of what we need to know about T(n).
Function m(n) is a monomial if m(n) has the form lg(n)a*nb, for nonnegative constants a and b.
Function t(n) is a term if it is a constant times a monomial, t(n) = c*m(n). The constant c is called the coefficient of m(n) in t(n).
Given a function T(n) of interest (such as the worst case run time of an algorithm on inputs of size n), the leading term of T(n) is a term t(n) such that T(n)/t(n) → 1 as n → ∞
Given a function T(n) of interest, the leading monomial of T(n) is a monimial m(n) such that T(n)/m(n) → c as n → ∞, for some positive constant c. In other words, the leading monomial is the leading term with the constant coefficient removed.
A function has at most one leading monomial and at most one leading term.