![]() |
![]() |
|
![]() |
![]() |
Encyclopedia :
B :
BI :
BIG :
Big O notation |
|
|
Big O notationIn complexity theory, computer science, and mathematics, the Big O notation is a mathematical notation used to describe the asymptotic behavior of functionss. More exactly, it is used to describe an asymptotic upper bound for the magnitude of a function in terms of another, usually simpler, function. It was first introduced by German number theorist Paul Bachmann in his 1892 book Analytische Zahlentheorie. The notation was popularized in the work of another German number theorist Edmund Landau, hence it is sometimes called a Landau symbol. The big-O, standing for "order of", was originally a capital omicron; today the capital letter O is used, but never the digit Omega and theta notation are also used for approximating formulae (see sum), analyzing algorithms (see heapsort), and for defining terms in complexity theory (see polynomial time). Uses There are two formally close, but noticeably different usages of this notation: infinite asymptotics and infinitesimal asymptotics. This distinction is only in application and not in principle, however—the formal definition for the "big O" is the same for both cases, only with different limits for the function argument. Infinite asymptotics Big O notation is useful when analyzing algorithms As n grows large, the n2 term will come to
Infinitesimal asymptotics Big O can also be used to describe the error term in an approximation Formal definition Suppose f(x) and g(x) are two functions defined on The notation can also be used to describe the behavior of f near If g(x) is non-zero for values of x sufficiently close to a, both of these definitions can be unified using the limit superior:
In mathematics, both asymptotic behaviors near ∞ and near a are considered. ExampleTake the polynomials:
Proof: Matters of notation The statement "f(x) is
Furthermore, an "equation" of the form Common orders of functionsHere is a list of classes of functions that are commonly encountered when analyzing algorithms. All of these are as n increases to infinity. The slower-growing functions are listed first. c is an arbitrary constant.
Properties If a function f(n) can be written as a finite sum of other In particular, if a function may be bounded by a polynomial in n, then as n tends to infinity, one may disregard lower-order terms of the polynomial. O(nc) and O(cn) are O(log n) is exactly the same as O(log(nc)). Related asymptotic notations: O, o, Ω, ω, Θ, Õ Big O is the most commonly used asymptotic notation for comparing
(A mnemonic for these Greek letters is that "omicron" can be read "o-micron", i.e., "o-small", whereas "omega" can be read "o-mega" or "o-big".) The relation f(n) = o(g(n)) is read as "f(n) is little-oh of g(n)". Intuitively, it means that g(n) grows much faster than f(n). Formally, it states that the limit of f(n)/g(n) is zero. Aside from big-O, the notations Θ and Ω are the two most often used in computer science; In casual use, O is commonly used where Θ is meant, i.e., when a tight estimate is implied. Another notation sometimes used in computer science is Õ (read Big O and little oThe following formal properties can be useful:
|
|
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License. |
|
| © 2008 Chamas Enterprises Inc. |