Asymptotic comparison of functions: Difference between revisions

From Algowiki
Jump to navigation Jump to search
Line 18: Line 18:
# It is <math>f\in\oplus\mathcal(g)</math> if, and only if, the [[http://en.wikipedia.org/wiki/Limit_superior_and_limit_inferior limit superior]] of the series <math>f(n)/g(n)</math> for <math>n\rightarrow+\infty</math> is finite.
# It is <math>f\in\oplus\mathcal(g)</math> if, and only if, the [[http://en.wikipedia.org/wiki/Limit_superior_and_limit_inferior limit superior]] of the series <math>f(n)/g(n)</math> for <math>n\rightarrow+\infty</math> is finite.
# It is <math>f\in o(g)</math> if, and only if, this limit superior is zero. Note that, due to nonnegativity, this is equivalent to the statement that <math>\lim_{n\rightarrow+\infty}f(n)/g(n)</math> exists and equals zero.
# It is <math>f\in o(g)</math> if, and only if, this limit superior is zero. Note that, due to nonnegativity, this is equivalent to the statement that <math>\lim_{n\rightarrow+\infty}f(n)/g(n)</math> exists and equals zero.
# For <math>a,b\mathbb{R}</math>, <math>a,b>1</math>, it is <math>\oplus(\log_a(n))=\oplus(\log_b(n))</math>, where "<math>\oplus</math>" is anyone of "<math>\mathcal{O}</math>", "<math>\Omega</math>", "<math>\Theta</math>", and "<math>o</math>" (follows immediately from the basic rule const). In particular, the base of a logarithm function may be omitted: <math>\oplus(\log(n))=\oplus(\log_a(n))</math>.
# For <math>a,b\in\mathbb{R}</math>, <math>a,b>1</math>, it is <math>\oplus(\log_a(n))=\oplus(\log_b(n))</math>, where "<math>\oplus</math>" is anyone of "<math>\mathcal{O}</math>", "<math>\Omega</math>", "<math>\Theta</math>", and "<math>o</math>" (follows immediately from the basic rule const). In particular, the base of a logarithm function may be omitted: <math>\oplus(\log(n))=\oplus(\log_a(n))</math>.
# For , , it is .
# For , , it is .
# For all , it is .
# For all , it is .

Revision as of 08:42, 26 May 2015

http://huffmann.algo.informatik.tu-darmstadt.de/wiki/wiki.algo.informatik.tu-darmstadt.de/index.php/Asymptotic_comparison_of_functions.html

One-dimensional case

Let [math]\displaystyle{ f:\mathbb{N}\rightarrow\mathbb{R}^+_0 }[/math] be a function. The following sets (a.k.a. classes) are defined for [math]\displaystyle{ f }[/math]:

  1. [math]\displaystyle{ \mathcal{O}(f) }[/math] consists of all functions [math]\displaystyle{ g:\mathbb{N}\rightarrow\mathbb{R}^+_0 }[/math] such that there are [math]\displaystyle{ N_g,\,c_g\in\mathbb{N} }[/math] that fulfill [math]\displaystyle{ g(n)\leq c_g\cdot f(n) }[/math] for all [math]\displaystyle{ n\geq N_g }[/math], [math]\displaystyle{ n\in\mathbb{N} }[/math];
  2. [math]\displaystyle{ \Omega(f) }[/math] consists of all functions [math]\displaystyle{ g:\mathbb{N}\rightarrow\mathbb{R}^+_0 }[/math] such that there are [math]\displaystyle{ N_g,\,c_g\in\mathbb{N} }[/math] that fulfill [math]\displaystyle{ g(n)\geq c_g\cdot f(n) }[/math] for all [math]\displaystyle{ n\geq N_g }[/math], [math]\displaystyle{ n\in\mathbb{N} }[/math];
  3. [math]\displaystyle{ \Theta(f):=\mathcal{O}(f)\cap\Omega(f) }[/math];
  4. [math]\displaystyle{ o(f):=\mathcal{O}(f)\setminus\Theta(f) }[/math].

Mathematical rules for asymptotic comparison

Let [math]\displaystyle{ f,g,h:\mathbb{N}\rightarrow\mathbb{R}^+_0 }[/math] be three functions.

  1. Anti-reflexivity: If [math]\displaystyle{ f\in\mathcal{O}(g) }[/math], it is [math]\displaystyle{ g\in\Omega(f) }[/math], and vice versa.
  2. Transitivity: If [math]\displaystyle{ f\in\oplus(g) }[/math] and [math]\displaystyle{ g\in\oplus(h) }[/math] then [math]\displaystyle{ f\in\oplus(h) }[/math], where "[math]\displaystyle{ \oplus }[/math]" is anyone of "[math]\displaystyle{ \mathcal{O} }[/math]", "[math]\displaystyle{ \Omega }[/math]", "[math]\displaystyle{ \Theta }[/math]", and "[math]\displaystyle{ o }[/math]".
  3. It is [math]\displaystyle{ \mathcal{O}(f)\cup\mathcal{O}(g)\subseteq\mathcal{O}(f+g) }[/math].
  4. If [math]\displaystyle{ f\in\mathcal{O}(g) }[/math], it is [math]\displaystyle{ \oplus(f+g)=\oplus(g) }[/math], where "[math]\displaystyle{ \oplus }[/math]" is anyone of "[math]\displaystyle{ \mathcal{O} }[/math]", "[math]\displaystyle{ \Omega }[/math]", "[math]\displaystyle{ \Theta }[/math]", and "[math]\displaystyle{ o }[/math]".
  5. It is [math]\displaystyle{ f\in\oplus\mathcal(g) }[/math] if, and only if, the [limit superior] of the series [math]\displaystyle{ f(n)/g(n) }[/math] for [math]\displaystyle{ n\rightarrow+\infty }[/math] is finite.
  6. It is [math]\displaystyle{ f\in o(g) }[/math] if, and only if, this limit superior is zero. Note that, due to nonnegativity, this is equivalent to the statement that [math]\displaystyle{ \lim_{n\rightarrow+\infty}f(n)/g(n) }[/math] exists and equals zero.
  7. For [math]\displaystyle{ a,b\in\mathbb{R} }[/math], [math]\displaystyle{ a,b\gt 1 }[/math], it is [math]\displaystyle{ \oplus(\log_a(n))=\oplus(\log_b(n)) }[/math], where "[math]\displaystyle{ \oplus }[/math]" is anyone of "[math]\displaystyle{ \mathcal{O} }[/math]", "[math]\displaystyle{ \Omega }[/math]", "[math]\displaystyle{ \Theta }[/math]", and "[math]\displaystyle{ o }[/math]" (follows immediately from the basic rule const). In particular, the base of a logarithm function may be omitted: [math]\displaystyle{ \oplus(\log(n))=\oplus(\log_a(n)) }[/math].
  8. For , , it is .
  9. For all , it is .
  10. For all and , , it is .
  11. For all , , it is .

Comparison with specific functions

A function is said to be linear if ; quadratic if ; cubic if ; logarithmic if ; "n-log-n" if ; polynomial if there is a polynomial such that ; subexponential if for every , ; exponential if there are , , such that and ; factorial if . Known Related Topics Remark Note that the notion of polynomial is based on an "", not on a "". In fact, in this context, "polynomial" is usually used short for "polynomially bounded from above". Reference

Multidimensional case

Let and let . The following sets (a.k.a. classes) are defined for :

consists of all functions  such that there are  and  that fulfill  for all  such that ;
consists of all functions  such that there are  and  that fulfill  for all  such that ;

.