All of the definitions of Big-O, Big-Ω, and Big-Θ below have something to do with existentially (∃) bound constants (generally and ) that make definition true. These constants are referred to in the discrete mathematics textbook as witnesses.
Definition of Dominance
Also referred to as asymptotic comparison
In general, we say is asymptotically less than or equal to () if and only if there exists a natural number such that for all
Conversely, we say is asymptotically greater than or equal to () .
Example
Let and :
- When ,
- Asymptotically, "grows faster" than , so ≥ when
- Given the definition above, we can say that
Big O
An upper bound on a function :
Precise Definition: is big oh of
if and only if there exists a constant
and a natural number
such that
≤
for all
Common Order of Dominance
- exponential
- factorial
- polynomial
- linear
- logarithmic
- constant
Big Ω
A lower bound on a function [1]:
Precise Definition: is big omega of
if and only if there exists a constant
and a natural number
such that
≥
for all
Note:
Big Θ
Means that function has same asymptotic growth as another function up to multiplication by constants. Similar to squeeze theorem in Calculus for proof of convergence.
Precise Definiton: is big theta (same order) of
if and only if there exists constants
and
and a natural number
such that
is between
and
for all
.
In other words,
In this case, for Big-Θ takes the larger value of the 's used in Big-O and Big-Ω.
Examples
Example 1
- Claim
- Choose witnesses and (can be derived mathematically to fit the form of the definition of Big-O: for all )
Example 2
When Joe implements algorithm A in Java and runs it on his home PC. Running time is
When Sue implements algorithm A in Fortran and runs it on dilbert.cs.tamu.edu, the running time is
Resulting speed of both algorithms is
Example 3
Example 4
(See Wikipedia:Binomial coefficient→)
- ↑ comparison-based sorting algorithms need at least comparisons.