There are a lot of asymptotic notation, telling us how a function grows in the long run
-notation
For a given we denote by the set of functions: $$\Theta(g(n)) = {f(n) \mid \exists c_1, c_2 >0 \exists n_0 \in \Bbb N \forall n \ge n_0 [c_1 g(n) \le f(n) \le c_2 g(n)]}$$
A function belongs to the set if there exists positive constants and such that it can be "sandwiched" between and , for sufficiently large . Because is a set, it would be the correct thing to do is to write , to indicate that is a member of . We will write , since it will be more confortable.
We see that by the definition, for all the function is equal to to within a constant factor. We say that is an asymptotically tight bound for .
We actually see we can have an alternative definitions, we say that iff $$\limsup_{n \to \infty} \frac{f(n)}{g(n)} <\infty \qquad \text{and} \qquad \liminf_{n \to \infty} \frac{f(n)}{g(n)} > 0$$
The definition of requires that every be asymptotically nonnegative, meaning for sufficiently large is nonnegative. To solve we can just consider the absolute value of the function. Consequently, the function itself must be asymptotically nonnegative, or else is empty.
We use another slight abuse of notation considering as the th degree polynomial, since it doesn't show which variable goes to infinity.
Doing some algebra, we see that if , then . Similarly, . Lastly we got that if and , then . This behaves is an equivalence relation.
-notation
When we have only an asymptotic upper bound, we use -notation. For a given function , we denote by the set of functions $$ O(g(n)) = {f(n) \mid \exists c > 0 \exists n_0 \in \Bbb N \forall n \ge n_0[0 \le f(n) \le cg(n)]}$$
we use -notation to give an upper bound on a function, to within a constant factor. We write to indicate that a function is a member of . We see that , implies that . We can write this as .
Similarly as we had for , we can use limits to give an alternate definition, iff $$\limsup_{n \to \infty} \frac{f(n)}{g(n)} < \infty$$ -notation is not necessarily a tight bound.
We might be interested in what happens when and . When this happens we see that we are bounding by below and above by , getting that
Doing some algebra, we see that . We got that if and , then . Adding the last point, we see that is an order relation on the space of asymptotically nonnegative functions modulo
-notation
Just as -notation provides an asymptotic upper bound on a function -notation provides an asymptotic lower bound. For a given function , we denote by the set of functions $$\Omega(g(n)) = {f(n) \mid \exists c > 0 \exists n_0 \in \Bbb N \forall n \ge n_0[0 \le cg(n) \le f(n)]}$$
We see a nice equivalence that iff
We also see that , iff $$\liminf_{n \to \infty} \frac{f(n)}{g(n)} > 0$$ Th: For any two function and , we have that iff and .
Which can be thought of as the inverse ordering given by
-notation
The asymptotic upper bound provided by -notation may or may not be asymptotically tight. We use -notation to denote an upper bound that is not asymptotically tight. We formally define as the set $$o(g(n)) ={f(n) \mid \forall c > 0 \exists n_0 \in \Bbb N \forall n \ge n_0[0 \le f(n) < cg(n)]}$$
The definitions of -notation and -notation are similar. If we look at the the limit equivalence we see that iff $$\lim_{n \to\infty} \frac{f(n)}{g(n)} = 0$$
Our choice of notation is not arbitrary, we see that , and if and , then . Meaning that it behaves like a strict ordering, of . We also have that
-notation
We use -notation to denote a lower bound that is not asymptotically tight. One way to define it is by $$f(n) = \omega(g(n)) \iff g(n) = o(f(n))$$
Formally, we define as the set $$\omega(g(n)) = {f(n) \mid \forall c > 0 \exists n_0 \in \Bbb N \forall n \ge n_0[0 \le cg(n) < f(n)]}$$
we see that is equivalent that iff $$\lim_{n \to \infty} \frac{f(n)}{g(n)} = \infty$$if the limit exists. We see that , and of and , then . Then we see that -notation is the strict ordering associated with -notation. We also have that .
We have a similar relation as we have for and -notations, with iff
Common functions
Polynomials
Given a nonnegative integer , a polynomial in of degree is a function of the form $$p(n) = \sum_{k = 0}^d a_k n^k$$where the constants are the coefficients of the polynomial and . A polynomials is asymptotically positive iff . We have a nice relations:
if then
if then
if then
if then
if then
We say that is polynomially bounded if for some constant
Logarithms
We say that a function is polylogarithmically bounded if for some constant . We have the nice relation that $$(\log n)^b = o(n^a)$$ for any constant .
Factorials
A weak upper bound on the factorial function is , since each of the terms in the factorial product is at most . Stirling's approximation formula, $$n! = \sqrt{2\pi n} \left(\frac ne\right)^n \left(1+ \Theta\left(\frac1n\right)\right) $$
We have that:
Iterated logarithm function
We use the notation to denote the iterated logarithm. First we need a bit of notation, let , then we define , and with the base case that . The only thing we need to check before trying to compute is to see that .
We define the iterated logarithm function as $$\log^* n:= {i \in \Bbb N \mid \log^{(i)} n \le 1}$$