ArticleslgStudy

mathematics

Big O notation

Big O notation is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Big O notation rather than just read about it. In short: 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 the German mathematicians Paul Bachmann and Edmund Landau and expanded by others, collectively called Bachmann–Landau notation.

Key takeaways

  • Big O notation belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Big O notation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Big O notation from memory before moving on to harder problems.

Reference excerpt

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 the German mathematicians Paul Bachmann and Edmund Landau and expanded by others, collectively called Bachmann–Landau notation. The letter O stands for Ordnung, that is, the order of approximation. In computer science, big O notation is used to classify algorithms by how their run time or space requirements grow with the input. In analytic number theory, big O notation expresses bounds on the growth of an arithmetical function, as for the remainder term in the prime number theorem. In mathematical analysis, including calculus, big O notation bounds the error when truncating a power series and expresses 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. Bachmann proposed the notation in 1894 and Landau extended it in 1909. An earlier notation was proposed by Paul du Bois-Reymond in 1870.

Formal definition 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) 𝖿𝗈𝗋 𝖺𝗅𝗅 x∈D. 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 x∈D. 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, 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→∞ does not indicate a limit, but the notion that the inequality holds for large enough x. The expression x→∞ often is omitted. Similarly, for a real number a, the notation f(x)=O(g(x)) as x→a means that for some constant c>0, f(x)=O(g(x)) on the interval [a−c,a+c]; 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, the Russian number theorist I.M. Vinogradov introduced the notation ≪, which has been increasingly used in number theory and other branches of mathematics, as an alternative to the O notation. We have f≪g⟺f=O(g). Frequently both notations are used in the same work.

Set version of big O In computer science 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)." For more information, see the section on set element notation below.

Examples

Unbounded/infinite domain 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:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Big O notation

Start with the simplest possible case. Write down what Big O notation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Big O notation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Big O notation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Big O notation

In research
Big O notation appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Big O notation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Big O notation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Analysis of algorithms, Asymptotic analysis, Mathematical notation, so understanding it makes those chapters shorter.
In everyday life
Look for Big O notation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Big O notation” →

How to study Big O notation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Big O notation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Big O notation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Big O notation in simple terms?

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 the German mathematicians Paul Bachmann and Edmund Landau and expanded by others, collectively called Bachmann–Landau notation.

Why does Big O notation matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Big O notation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Big O notation.

Tags

  • Analysis of algorithms
  • Asymptotic analysis
  • Mathematical notation

Keep exploring