Asymptotic Notation
Asymptotic Notation, or Landau Notation
Asymptotic Notation is used to describe the limiting behavior of a function as it approaches a particular value or infinity.
We have already seen a glimpse of this in the last post when we were discussing Order of Growth of functions. Ex: O(n)
When discussing asymptotic notation, there are three key terms:
Asymptotic Notation is used to describe the limiting behavior of a function as it approaches a particular value or infinity.
We have already seen a glimpse of this in the last post when we were discussing Order of Growth of functions. Ex: O(n)
When discussing asymptotic notation, there are three key terms:
- Theta Notation - A function that bounds a function within constant factor after a particular n.
- Big O Notation - represents the upper bound of Theta-Notation.
- Big Omega Notation - represents the lower bound of theta-notation.
Taken from: Florida State University
In the graph above, (c2 g(n)) represents Big O Notation, because for each n after n0, O(g(n)) >= f(n).
(c1 g(n)) represents Big Omega Notation because for each n after n0, Omega(g(n)) <= f(n).
There is an O-notation and Omega-notation, so therefore there exists a Theta-notation for the function f(n).
- For O-notation and Omega-notation are both the same function g(n), but differ by some constants c1 and c2.
- When discussing the run-time of algorithms in terms of asymptotic notation, we must make sure what exactly we are specifying. Take for example saying that insertion sort that O(n^2) means that insertion sort runs at n^2 for all input, but rather it will run no slower than O(n^2). We know that insertion sort does not always run at O(n^2) because we know that in the best-case where the input is already sorted, it will run in Theta(n).
Asymptotically tight - means that the asymptotic notation of a bound is the same factor of n as f(n).
For Example:
n^2 = O(n^2) Is tight
2n = O(n^2) Is not tight. 2n = o(n^2)
Little-oh Notation - when 0-notation is not asymptotically tight. o(n).
That means for some constant c, O(cg(n)) >= f(n). A not asymptotically tight function would be for all constant c, O(cg(n)) > f(n).
w-notation, or little omega notation, is the similar to little-oh notation, but for omega notation.
Comments
Post a Comment