Big O Notation: Computer Science Study Notes
October 10, 2026
π Big O Notation: A Comprehensive Guide
- Main Topics Covered:
- Foundational concepts and historical context of Big O notation
- Formal definitions for general, infinite, and finite domains, including set-based interpretations
- Practical examples across infinite, finite, and multivariate domains
- Core mathematical properties and algebraic manipulation rules
- Comparative growth rates of functions (polynomials, logarithms, and exponentials)
- Advanced usage and specialized notations
π‘ Core Concepts and Background
Big O notation is a mathematical notation that describes the approximate size of a function on a domain. It is part of the BachmannβLandau notation family, originally invented by German mathematicians Paul Bachmann (1894) and Edmund Landau (1909), with earlier contributions by Paul du Bois-Reymond (1870).
- The letter O stands for Ordnung, meaning the order of approximation.
- Upper bound: A description of a function using Big O notation only provides an upper bound on its growth rate.
Applications Across Fields
- Computer Science: Classifies algorithms by how their run time or space requirements grow relative to the input size.
- Analytic Number Theory: Expresses bounds on the growth of arithmetical functions (e.g., remainder terms in the prime number theorem).
- Mathematical Analysis (Calculus): Bounds errors when truncating power series and expresses the quality of approximation of functions by simpler functions.
Related Notations
Several related symbols describe different kinds of bounds on growth rates:
- (little-o)
- (asymptotic equivalence)
- (Big Omega - lower bound)
- (Vinogradov notation)
- (asymptotic tightness)
- (little omega)
- (Theta - tight bound)
π Formal Definitions
1. General Definition
Let be a real or complex-valued function defined on a domain , and let be a non-negative real-valued comparison function on the same domain .
We write:
Read as: " is big of " if there exists a positive real number (called the implied constant) such that:
If throughout , an equivalent definition states that the ratio is bounded; that is, there is a positive real number such that:
Note: The equality sign () does not represent strict mathematical equality, but rather an inequality relating and . Vinogradov introduced the alternative notation .
2. Asymptotic Definitions ( or )
- As : For functions eventually positive on : means that for some real number , holds on the domain .
- In a neighborhood of : means that for some constant , holds on the interval .
- Error terms:
3. Set Version of Big O
In computer science, often represents the set of all functions that satisfy . This is written as: Read as: "The function is among the set of all functions of order at most ."
π Practical Examples
Infinite Domain Examples (Large )
When analyzing behavior for very large , terms that grow most quickly dominate.
- Sum Rule: Keep the term with the highest growth rate; omit all others.
- Product Rule: Omit any constant factors that do not depend on .
Detailed Example: Let and . To prove for : Choosing satisfies for all . (Note: is a valid upper bound but less precise; is false).
Finite Domain Examples
On finite intervals, error terms in function approximations are summarized using Big O. For example, using Taylor's theorem for small :
Domain behavior can drastically change outcomes. For instance:
Multivariate Examples
| Expression | Domain Constraints | Interpretation |
|---|---|---|
| Bound is uniform across variables. | ||
| Real (not both ) | Any bounded function is . | |
| Mix of finite and infinite domains. | ||
| Implied constant depends on parameter . |
βοΈ Algebraic Properties
| Operation | Rule |
|---|---|
| Product | |
| Sum | If and , then . |
| Constant Multiplication | For nonzero constant : |
| Transitive Property | If and , then . |
π Growth Rate Hierarchies Toward Infinity
When analyzing polynomial, logarithmic, and exponential expressions as , specific domination rules apply:
- Large powers dominate small powers: For , as .
- Powers dominate logarithms: For any positive , , regardless of how large is or how small is.
- Exponentials dominate powers: For any positive , .
Terminology Classifications
- Superpolynomial: Grows faster than for any .
- Subexponential: Grows more slowly than any exponential function ().
- Note on Logarithms & Bases: Powers of inside logarithms can be ignored (e.g., ). Logs with different constant bases are equivalent, whereas exponentials with different bases ( vs ) are not of the same order.