Big O notation

From Wikipedia, the free encyclopedia
(Redirected from Little o notation)
Jump to navigation Jump to search

Big O notation is a mathematical notation that describes the approximate size of a function on a domain. Big O is a member of a family of notations invented by German mathematicians Paul Bachmann and [1] Edmund Landau [2] and expanded by others, collectively called Bachmann–Landau notation. The letter O was chosen by Bachmann to stand for Ordnung, meaning the order of approximation.

In computer science, big O notation is used to classify algorithms according to how their run time or space requirements [a] grow as the input size grows.[3] In analytic number theory, big O notation is often used to express bounds on the growth of an arithmetical function; one well-known example is the remainder term in the prime number theorem.[4] In mathematical analysis, including calculus, Big O notation is used to bound the error when truncating a power series and to express the quality of approximation of a real or complex valued function by a simpler function.

Often, big O notation characterizes functions according to their growth rates as the variable becomes large: different functions with the same asymptotic growth rate may be represented using the same O notation. The letter O is used because the growth rate of a function is also referred to as the order of the function. A description of a function in terms of big O notation only provides an upper bound on the growth rate of the function.

Associated with big O notation are several related notations, using the symbols o, , Ω, , , , ω, and Θ to describe other kinds of bounds on growth rates.[5][6][7]

Formal definition

[edit | edit source]

Let f, the function to be estimated, be either a real or complex valued function defined on a domain D, and let g, the comparison function, be a non-negative real valued function defined on the same set D. Common choices for the domain are intervals of real numbers, bounded or unbounded, the set of positive integers, the set of complex numbers and tuples of real/complex numbers. With the domain written explicitly or understood implicitly, one writes

f(x)=O(g(x)) 

which is read as  "f(x) is big O of g(x)"  if there exists a positive real number M such that

|f(x)|M g(x) 𝖿𝗈𝗋 𝖺𝗅𝗅 xD.

If g(x)>0 (i.e. g is also never zero) throughout the domain D, an equivalent definition is that the ratio f(x)g(x) is bounded, i.e. there is a positive real number M so that |f(x)g(x)|M for all xD. These encompass all the uses of big O in computer science and mathematics, including its use where the domain is finite, infinite, real, complex, single variate, or multivariate. In most applications, one chooses the function g(x) appearing within the argument of O() to be as simple a form as possible, omitting constant factors and lower order terms. The number M is called the implied constant because it is normally not specified. When using big O notation, what matters is that some finite M exists, not its specific value. This simplifies the presentation of many analytic inequalities.

For functions defined on positive real numbers or positive integers, a more restrictive and somewhat conflicting definition is still in common use,[3][8] especially in computer science. When restricted to functions which are eventually positive, the notation

f(x)=O(g(x))𝖺𝗌x

means that for some real number a, f(x)=O(g(x)) in the domain [a,). Here, the expression x doesn't indicate a limit, but the notion that the inequality holds for large enough x. The expression x often is omitted.[3]

Similarly, for a finite real number a, the notation

f(x)=O(g(x)) as  xa

means that for some constant c>0, f(x)=O(g(x)) on the interval [ca,c+a]; that is, in a small neighborhood of a. In addition, the notation  f(x)=h(x)+O(g(x))  means f(x)h(x)=O(g(x)). More complicated expressions are also possible.

Despite the presence of the equal sign (=) as written, the expression f(x)=O(g(x)) does not refer to an equality, but rather to an inequality relating f and g.

In the 1930s,[6] the Russian number theorist I.M. Vinogradov introduced the notation , which has been increasingly used in number theory[4][9][10] and other branches of mathematics, as an alternative to the O notation. We have

 fgf=O(g).

Frequently both notations are used in the same work.

Set version of big O

[edit | edit source]

In computer science[3] it is common to define big O as also defining a set of functions. With the positive (or non-negative) function g(x) specified, one interprets O(g(x)) as representing the set of all functions f~ that satisfy f~(x)=O(g(x)). One can then equivalently write f(x)O(g(x)), read as "the function  f(x)  is among the set of all functions of order at most g(x)."

Examples with an infinite domain

[edit | edit source]

In typical usage the O notation is applied to an infinite interval of real numbers [a,) and captures the behavior of the function for very large x. In this setting, the contribution of the terms that grow "most quickly" will eventually make the other ones irrelevant. As a result, the following simplification rules can be applied:

  • If f(x) is a sum of several terms, if there is one with largest growth rate, it can be kept, and all others omitted.
  • If f(x) is a product of several factors, any constants (factors in the product that do not depend on x) can be omitted.

For example, let f(x)=6x42x3+5, and suppose we wish to simplify this function, using O notation, to describe its growth rate for large x. This function is the sum of three terms: 6x4, 2x3, and 5. Of these three terms, the one with the highest growth rate is the one with the largest exponent as a function of x, namely 6x4. Now one may apply the second rule: 6x4is a product of 6 and x4 in which the first factor does not depend on x. Omitting this factor results in the simplified form x4. Thus, we say that f(x) is a "big O" of x4. Mathematically, we can write f(x)=O(x4) for all x1. One may confirm this calculation using the formal definition: let f(x)=6x42x3+5 and g(x)=x4. Applying the formal definition from above, the statement that f(x)=O(x4) is equivalent to its expansion, |f(x)|Mx4 for some suitable choice of a positive real number M and for all x1. To prove this, let M=13. Then, for all x1: |6x42x3+5|6x4+|2x3|+56x4+2x4+5x4=13x4 so |6x42x3+5|13x4. While it is also true, by the same argument, that f(x)=O(x10), this is a less precise approximation of the function f. On the other hand, the statement f(x)=O(x3) is false, because the term 6x4 causes f(x)/x3 to be unbounded.

When a function T(n) describes the number of steps required in an algorithm with input n, an expression such as T(n)=O(n2) with the implied domain being the set of positive integers, may be interpreted as saying that the algorithm has at most the order of n2 time complexity.

Example with a finite domain

[edit | edit source]

Big O can also be used to describe the error term in an approximation to a mathematical function on a finite interval. The most significant terms are written explicitly, and then the least-significant terms are summarized in a single big O term. Consider, for example, the exponential series and two expressions of it that are valid when x is small: ex=1+x+x2 2!+x3 3!+x4 4!+ for all finite x=1+x+x2 2+O(|x|3) for all |x|1=1+x+O(x2) for all |x|1. The middle expression (the line with "O(|x3|)") means the absolute-value of the error  ex(1+x+x2 2)  is at most some constant times |x3|  when  x is small. This is an example of the use of Taylor's theorem.

The behavior of a given function may be very different on finite domains than on infinite domains, for example, (x+1)8=x8+O(x7) for x1 while (x+1)8=1+8x+O(x2) for |x|1.

Multivariate examples

[edit | edit source]

xsiny=O(x) for x1,y any real number

3a2+7ab+2b2+a+3b+14a2+b2a2 for all ab1

xyx2+y2=O(1) for all real x,y that are not both 0

xit=O(1) for x0,t.

Here we have a complex variable function of two variables. In general, any bounded function is O(1).

(x+y)10=O(x10) for x1,2y2.

The last example illustrates a mixing of finite and infinite domains on the different variables.

In all of these examples, the bound is uniform in both variables. Sometimes in a multivariate expression, one variable is more important than others, and one may express that the implied constant M depends on one or more of the variables using subscripts to the big O symbol or the symbol. For example, consider the expression

(1+x)b=1+Ob(x) for 0x1,b any real number.

This means that for each real number b, there is a constant Mb, which depends on b, so that for all 0x1, |(1+x)b1|Mbx. This particular statement follows from the general binomial theorem.

Another example, common in the theory of Taylor series, is ex=1+x+Or(x2) for all |x|r,r being any real number. Here the implied constant depends on the size of the domain.

The subscript convention applies to all of the other notations in this page.

Properties

[edit | edit source]

Product

[edit | edit source]
f1=O(g1) and f2=O(g2)f1f2=O(g1g2)
fO(g)=O(|f|g)

If f1=O(g1) and f2=O(g2) then f1+f2=O(max(g1,g2)). It follows that if f1=O(g) and f2=O(g) then f1+f2=O(g).

Multiplication by a constant

[edit | edit source]

Let k be a nonzero constant. Then O(|k|g)=O(g). In other words, if f=O(g), then kf=O(g).

Transitive property

[edit | edit source]

If f=O(g) and g=O(h) then f=O(h).

If the function f of a positive integer n can be written as a finite sum of other functions, then the fastest growing one determines the order of f(n). For example,

f(n)=9logn+5(logn)4+3n2+2n3=O(n3)for n1.

Some general rules about growth toward infinity; the 2nd and 3rd property below can be proved rigorously using L'Hôpital's rule:

Large powers dominate small powers

[edit | edit source]

For b>a0, then na=O(nb).

Powers dominate logarithms

[edit | edit source]

For any positive a,b, (logn)a=Oa,b(nb), no matter how large a is and how small b is. Here, the implied constant depends on both a and b.

Exponentials dominate powers

[edit | edit source]

For any positive a,b, na=Oa,b(ebn), no matter how large a is and how small b is.

A function that grows faster than nc for any c is called superpolynomial. One that grows more slowly than any exponential function of the form cn with c>1 is called subexponential. An algorithm can require time that is both superpolynomial and subexponential; examples of this include the fastest known algorithms for integer factorization and the function nlogn.

We may ignore any powers of n inside of the logarithms. For any positive c, the notation O(logn) means exactly the same thing as O(log(nc)), since log(nc)=clogn. Similarly, logs with different constant bases are equivalent with respect to Big O notation. On the other hand, exponentials with different bases are not of the same order. For example, 2n and 3n are not of the same order.

More complicated expressions

[edit | edit source]

In more complicated usage, O() can appear in different places in an equation, even several times on each side. For example, the following are true for n a positive integer: (n+1)2=n2+O(n),(n+O(n1/2))(n+O(logn))2=n3+O(n5/2),nO(1)=O(en). The meaning of such statements is as follows: for any functions which satisfy each O() on the left side, there are some functions satisfying each O() on the right side, such that substituting all these functions into the equation makes the two sides equal. For example, the third equation above means: "For any function satisfying f(n)=O(1), there is some function g(n)=O(en) such that nf(n)=g(n)". The implied constant in the statement "g(n)=O(en)" may depend on the implied constant in the expression "f(n)=O(1)".

Some further examples: f=O(g)abf=O(abg)f(x)=g(x)+O(1)ef(x)=O(eg(x))(1+O(1/x))O(x)=O(1) for x>0sinx=O(|x|) for all real x.

Vinogradov's ≫ and Knuth's big Ω

[edit | edit source]

When f,g are both positive functions, Vinogradov[6] introduced the notation f(x)g(x), which means the same as g(x)=O(f(x)). Vinogradov's two notations enjoy visual symmetry, as for positive functions f,g, we have f(x)g(x)g(x)f(x).

In 1976, Donald Knuth[7] defined

f(x)=Ω(g(x))g(x)=O(f(x))

which has the same meaning as Vinogradov's f(x)g(x).

Much earlier, Hardy and Littlewood defined Ω differently, but this it seldom used anymore (Ivič's book[9] being one exception). Justifying his use of the Ω-symbol to describe a stronger property,[7] Knuth wrote: "For all the applications I have seen so far in computer science, a stronger requirement ... is much more appropriate". Knuth further wrote, "Although I have changed Hardy and Littlewood's definition of Ω, I feel justified in doing so because their definition is by no means in wide use, and because there are other ways to say what they want to say in the comparatively rare cases when their definition applies."[7]

Indeed, Knuth's big Ω enjoys much more widespread use today than the Hardy–Littlewood big Ω, being a common feature in computer science and combinatorics.

Hardy's ≍ and Knuth's big Θ

[edit | edit source]

In analytic number theory,[10] the notation f(x)g(x) means both f(x)=O(g(x)) and g(x)=O(f(x)). This notation is originally due to Hardy.[5] Knuth's notation for the same notion is f(x)=Θ(g(x)).[7] Roughly speaking, these statements assert that f(x) and g(x) have the same order. These notations mean that there are positive constants M,N so that Ng(x)f(x)Mg(x) for all x in the common domain of f,g. When the functions are defined on the positive integers or positive real numbers, as with big O, writers oftentimes interpret statements f(x)=Ω(g(x)) and f(x)=Θ(g(x)) as holding for all sufficiently large x, that is, for all x beyond some point x0. Sometimes this is indicated by appending x to the statement. For example, 2n210n=Θ(n2) is true for the domain n6 but false if the domain is all positive integers, since the function is zero at n=5.

Further examples

[edit | edit source]

n3+20n2+n+12n3 for all n1.

(1+x)8=x8+Θ(x7) for all x1.

The notation

f(n)=eΩ(n) for all n1, means that there is a positive constant M so that f(n)eMn for all n1. By contrast, f(n)=eO(n) for all n1, means that there is a positive constant M so that f(n)eMn for all n1 and f(n)=eΘ(n) for all n1, means that there are positive constants M,N so that eMnf(n)eNn for all n1.

For any domain D, f(x)=g(x)+O(1)ef(x)eg(x), each statement being for all x in D.

Orders of common functions

[edit | edit source]

Here is a list of classes of functions that are commonly encountered when analyzing the running time of an algorithm. In each case, c is a positive constant and n increases without bound. The slower-growing functions are generally listed first.

Notation Name Example
O(1) constant Finding the median value for a sorted array of numbers; Calculating (1)n; Using a constant-size lookup table
O(α(n)) inverse Ackermann function Amortized complexity per operation for the Disjoint-set data structure
O(loglogn) double logarithmic Average number of comparisons spent finding an item using interpolation search in a sorted array of uniformly distributed values
O(logn) logarithmic Finding an item in a sorted array with a binary search or a balanced search tree as well as all operations in a binomial heap
O((logn)c)
c>1
polylogarithmic Matrix chain ordering can be solved in polylogarithmic time on a parallel random-access machine.
O(nc)
0<c<1
fractional power Searching in a k-d tree
O(n) linear Finding an item in an unsorted list or in an unsorted array; adding two n-bit integers by ripple carry
O(nlog*n) n log-star n Performing triangulation of a simple polygon using Seidel's algorithm,[11] where log*(n)={0,if n11+log*(logn),if n>1
O(nlogn)=O(logn!) linearithmic, loglinear, quasilinear, or "nlogn" Performing a fast Fourier transform; fastest possible comparison sort; heapsort and merge sort
O(n2) quadratic Multiplying two n-digit numbers by schoolbook multiplication; simple sorting algorithms, such as bubble sort, selection sort and insertion sort; (worst-case) bound on some usually faster sorting algorithms such as quicksort, Shellsort, and tree sort
O(nc) polynomial or algebraic Tree-adjoining grammar parsing; maximum matching for bipartite graphs; finding the determinant with LU decomposition
Ln[α,c]=e(c+o(1))(lnn)α(lnlnn)1α
0<α<1
L-notation or sub-exponential Factoring a number using the quadratic sieve or number field sieve
O(cn)
c>1
exponential Finding the (exact) solution to the travelling salesman problem using dynamic programming; determining if two logical statements are equivalent using brute-force search
O(n!) factorial Solving the travelling salesman problem via brute-force search; generating all unrestricted permutations of a poset; finding the determinant with Laplace expansion; enumerating all partitions of a set

The statement f(n)=O(n!) is sometimes weakened to f(n)=O(nn) to derive simpler formulas for asymptotic complexity. In many of these examples, the running time is actually Θ(g(n)), which conveys more precision.

Little-o notation

[edit | edit source]

For real or complex-valued functions of a real variable x with g(x)>0 for sufficiently large x, one writes [2]

f(x)=o(g(x)) as x

if limxf(x)g(x)=0. That is, for every positive constant ε there exists a constant x0 such that

|f(x)|εg(x) for all xx0.

Intuitively, this means that g(x) grows much faster than f(x), or equivalently f(x) grows much slower than g(x). For example, one has

200x=o(x2) and 1/x=o(1),     both as x.

When one is interested in the behavior of a function for large values of x, little-o notation makes a stronger statement than the corresponding big-O notation: every function that is little-o of g is also big-O of g on some interval [a,), but not every function that is big-O of g is little-o of g. For example, 2x2=O(x2) but 2x2o(x2) for x1.

Little-o respects a number of arithmetic operations. For example,

if c is a nonzero constant and f=o(g) then cf=o(g), and
if f=o(F) and g=o(G) then fg=o(FG).
if f=o(F) and g=o(G) then f+g=o(F+G)

It also satisfies a transitivity relation:

if f=o(g) and g=o(h) then f=o(h).

Little-o can also be generalized to the finite case:[2] f(x)=o(g(x)) as xx0 if limxx0f(x)g(x)=0. In other words, f(x)=α(x)g(x) for some α(x) with limxx0α(x)=0.

This definition is especially useful in the computation of limits using Taylor series. For example:

sinx=xx33!+=x+o(x2) as x0, so limx0sinxx=limx0x+o(x2)x=limx01+o(x)=1

Asymptotic notation

[edit | edit source]

A relation related to litte-o is the asymptotic notation . For real valued functions f,g, the expression f(x)g(x) as x means limxf(x)g(x)=1. One can connect this to little-o by observing that f(x)g(x) is also equivalent to f(x)=(1+o(1))g(x). Here o(1) refers to a function tending to zero as x. One reads this as "f(x) is asymptotic to g(x)". For nonzero functions on the same (finite or infinite) domain, forms an equivalence relation.

One of the most famous theorems using the notation is Stirling's formula n!(ne)n2πn as n. In number theory, the famous prime number theorem states that π(x)xlogx as x, where π(x) is the number of primes which are at most x and log is the natural logarithm of x.

As with little-o, there is a version with finite limits (two-sided or one-sided) as well, for example sinxx as x0.

Further examples: xa=oa,b(ebx) as x, for any positive constants a,b, f(x)=g(x)+o(1)ef(x)eg(x)(x). n=11ns1s1(x). The last asymptotic is a basic property of the Riemann zeta function.

Knuth's little 𝜔

[edit | edit source]

For eventually positive, real valued functions f,g, the notation f(x)=ω(g(x)) as x means limxf(x)g(x)=. In other words, g(x)=o(f(x)). Roughly speaking, this means that f(x) grows much faster than does g(x).

The Hardy–Littlewood Ω notation

[edit | edit source]

In 1914 G.H. Hardy and J.E. Littlewood introduced the new symbol  Ω,[12] which is defined as follows:

f(x)=Ω( g(x) ) as x if lim supx | f(x) g(x)|>0.

Thus f(x)=Ω( g(x) ) is the negation of f(x)=o( g(x) ).

In 1916 the same authors introduced the two new symbols  ΩR  and  ΩL , defined as:[13]

f(x)=ΩR( g(x) ) as x if lim supx  f(x) g(x)>0 ;
f(x)=ΩL( g(x) ) as x if lim infx  f(x) g(x)<0.

These symbols were used by E. Landau, with the same meanings, in 1924.[14] Authors that followed Landau, however, use a different notation for the same definitions:[9] The symbol  ΩR  has been replaced by the current notation  Ω+  with the same definition, and  ΩL  became  Ω.

These three symbols  Ω ,Ω+ ,Ω , as well as  f(x)=Ω±( g(x) )  (meaning that  f(x)=Ω+( g(x) )  and  f(x)=Ω( g(x) )  are both satisfied), are now currently used in analytic number theory.[9] [10]

Simple examples

[edit | edit source]

We have

sinx=Ω(1) as x ,

and more precisely

sinx=Ω±(1) as x,

where Ω± means that the left side is both Ω+(1) and Ω(1),

We have

1+sinx=Ω(1) as x ,

and more precisely

1+sinx=Ω+(1) as x ;

however

1+sinxΩ(1) as x.

Family of Bachmann–Landau notations

[edit | edit source]

For understanding the fomal definitions, consult the list of logic symbols used in mathematics.

Notation Name[7] Description Formal definition Compact definition

[4] [5] [7] [12] [15][16]

f(n)=o(g(n)) Small O; Small Oh; Little O; Little Oh f is dominated by g asymptotically (for any constant factor k) k>0n0n>n0:|f(n)|kg(n) limnf(n)g(n)=0
f(n)=O(g(n)) or

f(n)g(n) (Vinogradov's notation)

Big O; Big Oh; Big Omicron |f| is bounded above by g (up to constant factor k) k>0nD:|f(n)|kg(n) supnD|f(n)|g(n)<
f(n)g(n) (Hardy's notation) or f(n)=Θ(g(n)) (Knuth notation) Of the same order as (Hardy); Big Theta (Knuth) f is bounded by g both above (with constant factor k2) and below (with constant factor k1) k1>0k2>0nD: k1g(n)f(n)k2g(n) f(n)=O(g(n)) and g(n)=O(f(n))
f(n)g(n) as na, where a is finite,

or

Asymptotic equivalence f is equal to g asymptotically ε>0n0n>n0:|f(n)g(n)1|<ε (in the case a=) limnaf(n)g(n)=1
f(n)=Ω(g(n)) (Knuth's notation), or

f(n)g(n) (Vinogradov's notation)

Big Omega in complexity theory (Knuth) f is bounded below by g, up to a constant factor k>0nD:f(n)kg(n) infnDf(n)g(n)>0
f(n)=ω(g(n)) as na,

where a can be finite, or

Small Omega; Little Omega f dominates g asymptotically k>0n0n>n0:f(n)>kg(n) (for a=) limnaf(n)g(n)=
f(n)=Ω(g(n)) Big Omega in number theory (Hardy–Littlewood) |f| is not dominated by g asymptotically k>0n0n>n0:|f(n)|kg(n) lim supn|f(n)|g(n)>0

The limit definitions assume g(n)>0 for n in a neighborhood of the limit; when the limit is , this means that g(n)>0 for sufficiently large n.

Computer science and combinatorics use the big O, big Theta Θ, little o, little omega ω and Knuth's big Omega Ω notations. [3] Analytic number theory often uses the big O, small o, Hardy's , Hardy–Littlewood's big Omega Ω (with or without the +, − or ± subscripts), Vinogradov's and notations and notations. [9] [4] [10] The small omega ω notation is not used as often in analysis or in number theory. [17]

Quality of approximations using different notation

[edit | edit source]

Informally, especially in computer science, the big O notation often can be used somewhat differently to describe an asymptotic tight bound where using big Theta Θ notation might be more factually appropriate in a given context .[18] For example, when considering a function T(n)=73n3+22n2+58, all of the following are generally acceptable, but tighter bounds (such as numbers 2,3 and 4 below) are usually strongly preferred over looser bounds (such as number 1 below).

  1. T(n)=O(n100)
  2. T(n)=O(n3)
  3. T(n)=Θ(n3)
  4. T(n)73n3 as n.

While all three statements are true, progressively more information is contained in each. In some fields, however, the big O notation (number 2 in the lists above) would be used more commonly than the big Theta notation (items numbered 3 in the lists above). For example, if T(n) represents the running time of a newly developed algorithm for input size n, the inventors and users of the algorithm might be more inclined to put an upper bound on how long it will take to run without making an explicit statement about the lower bound or asymptotic behavior.

Extensions to the Bachmann–Landau notations

[edit | edit source]

Another notation sometimes used in computer science is O~ (read soft-O), which hides polylogarithmic factors. There are two definitions in use: some authors use f(n)=O~(g(n)) as shorthand for f(n)=O(g(n)logkn) for some k[citation needed], while others use it as shorthand for f(n)=O(g(n)logkg(n)) .[19] When g(n) is polynomial in n, there is no difference; however, the latter definition allows one to say, e.g. that n2n=O~(2n) while the former definition allows for logkn=O~(1) for any constant k. Some authors write O* for the same purpose as the latter definition.[20] Essentially, it is big O notation, ignoring logarithmic factors because the growth-rate effects of some other super-logarithmic function indicate a growth-rate explosion for large-sized input parameters that is more important to predicting bad run-time performance than the finer-point effects contributed by the logarithmic-growth factor(s). This notation is often used to obviate the "nitpicking" within growth-rates that are stated as too tightly bounded for the matters at hand (since logkn=o(nε) for any constant k and any ε>0.

Also, the L notation, defined as

Ln[α,c]=e(c+o(1))(lnn)α(lnlnn)1α,

is convenient for functions that are between polynomial and exponential in terms of logn.

[edit | edit source]

The generalization to functions taking values in any normed vector space is straightforward (replacing absolute values by norms), where f and g need not take their values in the same space. A generalization to functions g taking values in any topological group is also possible[citation needed]. The "limiting process" xx0 can also be generalized by introducing an arbitrary filter base, i.e. to directed nets f and g. The o notation can be used to define derivatives and differentiability in quite general spaces, and also (asymptotical) equivalence of functions,

fg(fg)o(g)

which is an equivalence relation and a more restrictive notion than the relationship "f is Θ(g)" from above. (It reduces to limf/g=1 if f and g are positive real valued functions.) For example, 2x=Θ(x) is, but 2xxo(x).

History

[edit | edit source]

We sketch the history of the Bois-Reymond, Bachmann–Landau, Hardy, Vinogradov and Knuth notations.

In 1870, Paul du Bois-Reymond [21] defined f(x)ϕ(x), f(x)ϕ(x) and f(x)ϕ(x) to mean, respectively, limxf(x)ϕ(x)=,limxf(x)ϕ(x)>0,limxf(x)ϕ(x)=0. These were note widely adopted and are not used today. The first and third enjoy a symmetry: f(x)ϕ(x) means the same as ϕ(x)f(x). Later, Landau adopted in the narrower sense that the limit of f(x)/ϕ(x) equals 1. None of these notations is in use today.

The symbol O was first introduced by number theorist Paul Bachmann in 1894, in the second volume of his book Analytische Zahlentheorie ("analytic number theory").[1] The number theorist Edmund Landau adopted it, and was thus inspired to introduce in 1909 the notation o;[2] hence both are now called Landau symbols. These notations were used in applied mathematics during the 1950s for asymptotic analysis.[22] The symbol Ω (in the sense "is not an o of") was introduced in 1914 by Hardy and Littlewood.[12] Hardy and Littlewood also introduced in 1916 the symbols ΩR ("right") and ΩL ("left"),.[13] This notation Ω became somewhat commonly used in number theory at least since the 1950s.[23]

The symbol , although it had been used before with different meanings,[21] was given its modern definition by Landau in 1909[2] and by Hardy in 1910.[5] Just above on the same page of his tract Hardy defined the symbol , where f(x)g(x) means that both f(x)=O(g(x)) and g(x)=O(f(x)) are satisfied. The notation is still currently used in analytic number theory.[24] [10] In his tract Hardy also proposed the symbol , where fg means that fKg for some constant K=0 (this corresponds to Bois-Reymond's notation fg).

In the 1930s, Vinogradov[6] popularized the notation f(x)g(x) and g(x)f(x), both of which mean f(x)=O(g(x)). This notation became standard in analytic number theory.[4]

In the 1970s the big O was popularized in computer science by Donald Knuth, who proposed the different notation f(x)=Θ(g(x)) for Hardy's f(x)g(x), and proposed a different definition for the Hardy and Littlewood Omega notation.[7]

Hardy introduced the symbols and advocated for Boid-Reymond's (as well as the already mentioned other symbols) in his 1910 tract "Orders of Infinity",[5] but made use of them only in three papers (1910–1913). In his nearly 400 remaining papers and books he consistently used the Landau symbols O and o.[25] Hardy's symbols and are not used anymore.

Matters of notation

[edit | edit source]

Arrows

[edit | edit source]

In mathematics, an expression such as x indicates the presence of a limit. In big-O notation and related notations Ω,Θ,,,, there is no implied limit, in contrast with little-o, and ω notations. Notation such as f(x)=O(g(x))(x) can be considered an abuse of notation.

Equals sign

[edit | edit source]

Some consider f(x)=O(g(x)) to also be an abuse of notation, since the use of the equals sign could be misleading as it suggests a symmetry that this statement does not have. As de Bruijn says, O(x)=O(x2) is true but O(x2)=O(x) is not.[26] Knuth describes such statements as "one-way equalities", since if the sides could be reversed, "we could deduce ridiculous things like n=n2 from the identities n=O(n2) and n2=O(n2).[27] In another letter, Knuth also pointed out that[28]

the equality sign is not symmetric with respect to such notations [as, in this notation,] mathematicians customarily use the '=' sign as they use the word 'is' in English: Aristotle is a man, but a man isn't necessarily Aristotle.

For these reasons, some advocate for using set notation and write f(x)O(g(x)), read as "f(x) is an element of O(g(x))", or "f(x) is in the set O(g(x))" – thinking of O(g(x)) as the class of all functions h(x) such that h(x)=O(g(x)).[27] However, the use of the equals sign is customary.[26][27] and is more convenient in more complex expressions of the form f(x)=g(x)+O(h(x))=O(k(x)).

The Vinogradov notations and , which are widely used in number theory [9] [4] [10] do not suffer from this defect, as they more clearly indicate that big-O indicates an inequality rather than an equality. They also enjoy a symmetry that big-O notation lacks: f(x)g(x) means the same as g(x)f(x). In combinatorics and computer science, these notations are rarely seen.[3]

Typesetting

[edit | edit source]

Big O is typeset as an italicized uppercase "O", as in the following example: O(n2).[29][30] In TeX, it is produced by simply typing 'O' inside math mode. Unlike Greek-named Bachmann–Landau notations, it needs no special symbol. However, some authors use the calligraphic variant 𝒪 instead.[31][32]

The big-O originally stands for "order of" ("Ordnung", Bachmann 1894), and is thus a Latin letter. Neither Bachmann nor Landau ever call it "Omicron". The symbol was much later on (1976) viewed by Knuth as a capital omicron,[7] probably in reference to his definition of the symbol Omega. The digit zero should not be used.

See also

[edit | edit source]

References and notes

[edit | edit source]
  1. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ a b c d e Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ a b c d e f Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  4. ^ a b c d e f Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  5. ^ a b c d e Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  6. ^ a b c d Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    Translated in English in:
    Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  7. ^ a b c d e f g h i Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  9. ^ a b c d e f Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  10. ^ a b c d e f Gérald Tenenbaum, Introduction to analytic and probabilistic number theory, « Notation », page xxiii. American Mathematical Society, Providence RI, 2015.
  11. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  12. ^ a b c Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  13. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  14. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  15. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  16. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  17. ^ for example it is omitted in: Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  18. ^ Cormen et al. 2022, p. 57.
  19. ^ Cormen et al. 2022, p. 74–75.
  20. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value). See sect.2.3, p.551.
  21. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  22. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value)..
  23. ^ E. C. Titchmarsh, The Theory of the Riemann Zeta-Function (Oxford; Clarendon Press, 1951)
  24. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  25. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  26. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  27. ^ a b c Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  28. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value). (Unabridged version Archived 2008-05-13 at the Wayback Machine)
  29. ^ Donald E. Knuth, The art of computer programming. Vol. 1. Fundamental algorithms, third edition, Addison Wesley Longman, 1997. Section 1.2.11.1.
  30. ^ Ronald L. Graham, Donald E. Knuth, and Oren Patashnik, Concrete Mathematics: A Foundation for Computer Science (2nd ed.), Addison-Wesley, 1994. Section 9.2, p. 443.
  31. ^ Sivaram Ambikasaran and Eric Darve, An 𝒪(NlogN) Fast Direct Solver for Partial Hierarchically Semi-Separable Matrices, J. Scientific Computing 57 (2013), no. 3, 477–501.
  32. ^ Saket Saurabh and Meirav Zehavi, (k,nk)-Max-Cut: An 𝒪*(2p)-Time Algorithm and a Polynomial Kernel, Algorithmica 80 (2018), no. 12, 3844–3860.

Notes

[edit | edit source]
  1. ^ Note that the "size" of the input is typically used as an indication of how challenging a given instance is, of the problem to be solved. The amount of [execution] time, and the amount of [memory] space required to compute the answer, (or to "solve' the problem), are seen as indicating the difficulty of that instance of the problem. For purposes of Computational complexity theory, Big O notation is used for an upper bound on [the "order of magnitude" of] all 3 of those: the size of the input [data stream], the amount of [execution] time required, and the amount of [memory] space required.

Further reading

[edit | edit source]
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
[edit | edit source]