Big-Oh Manipulation Rules and Typical Algorithm Growth Rates

Big-Oh Manipulation Rules and Typical Algorithm Growth Rates

Verified Sources
Sep 12, 2026

Big-Oh notation (Big-O) is used to describe how an algorithm’s running time or space requirement scales with input size nn.2 This section focuses on (1) algebraic “manipulation rules” you can apply safely to Big-O expressions and (2) the practical meaning of growth rates such as O(logn)O(\log n), O(nlogn)O(n\log n), and O(2n)O(2^n).

Key asymptotic concepts

  • asymptotic upper bound
  • dominant term
  • lower-order terms

A useful mental model: when you simplify Big-Oh, you usually drop constants, drop smaller-order terms, and keep the highest-growth term—but you do so using rules that remain valid by definition.2


Footnotes

  1. Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants cc and n0n_0 (eventually bounded). 2

  2. Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes. 2

Big-O Notation Rules and Growth Rates (Log, Linear, Quadratic, Exponential)

Big-Oh definition (why the rules work)

By definition, f(n)=O(g(n))f(n)=O(g(n)) means: there exist constants c>0c>0 and n0n_0 such that for all nn0n\ge n_0,
f(n)cg(n).f(n)\le c\cdot g(n).
This “eventually bounded by a constant multiple” viewpoint is what makes algebraic simplifications safe (e.g., removing constants, ignoring lower-order terms, using max/dominance).

keyword Constant factors

If f(n)cg(n)f(n)\le c g(n), then multiplying ff by another constant or multiplying gg by a constant keeps it in the same asymptotic relationship (after adjusting cc).

keyword Dominance

If g1(n)g_1(n) grows faster than g2(n)g_2(n) (e.g., n2n^2 dominates nn), then g1(n)+g2(n)g_1(n)+g_2(n) is still O(g1(n))O(g_1(n)) because eventually the larger term dominates.


Footnotes

  1. Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes.

How to simplify a running-time expression into Big-Oh

  1. 1
    Step 1

    Start from something like T(n)=3n2+5n+100T(n)=3n^2+5n+100 or T(n)=7logn+4T(n)=7\log n+4.

  2. 2
    Step 2

    Replace 3n23n^2 with n2n^2 because constant factors do not affect O()O(\cdot).

    Footnotes

    1. Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants cc and n0n_0 (eventually bounded).

  3. 3
    Step 3

    Remove terms that are asymptotically smaller than the largest term (e.g., 5n5n is lower-order than n2n^2). This follows from dominance.

    Footnotes

    1. Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes.

  4. 4
    Step 4

    Use: O(f(n)+g(n))=O(max(f(n),g(n)))O(f(n)+g(n)) = O(\max(f(n),g(n))) for large nn (i.e., the bigger term controls the sum).

  5. 5
    Step 5

    For products, combine growth rates (e.g., O(f)O(g)=O(fg)O(f)\cdot O(g)=O(fg)) while keeping in mind that exponents can drastically increase growth.

  6. 6
    Step 6

    "Use properties like log(nk)=klogn\log(n^k)=k\log n and loga+logb=log(ab)\log a + \log b = \log(ab) (then apply constant-factor dropping)."


Rules for manipulating Big-Oh expressions

These rules are widely used, and each aligns with the formal definition of Big-Oh as an eventually-bounded inequality.2

1) Basic scaling and constants

Let f(n)=O(g(n))f(n)=O(g(n)) and h(n)h(n) be any function with nonnegative growth for large nn.

  • Adding a constant:
    If f(n)=O(g(n))f(n)=O(g(n)), then f(n)+O(1)=O(g(n))f(n)+O(1)=O(g(n)) (constants are lower-order than any unbounded gg).
  • Multiplying by a constant:
    If f(n)=O(g(n))f(n)=O(g(n)), then cf(n)=O(g(n))c\cdot f(n)=O(g(n)) for constant c>0c>0.
  • Constant replacement:
    O(c)=O(1)O(c)=O(1) for constant c>0c>0.

2) Sums: the maximum (dominant term) rule

  • Sum of Big-Oh terms:
    O(f(n))+O(g(n))=O(max(f(n),g(n)))O(f(n)) + O(g(n)) = O(\max(f(n),g(n))).
    Intuition: for large nn, one term eventually dominates the other, so the sum is bounded by a constant multiple of the larger term.2

Example:

  • If T(n)=O(n2)+O(n)T(n)=O(n^2)+O(n), then T(n)=O(n2)T(n)=O(n^2) because n2n^2 dominates nn.

3) Products: multiply bounds

  • Product rule:
    O(f(n))O(g(n))=O(f(n)g(n))O(f(n))\cdot O(g(n)) = O(f(n)g(n)).
    Reason: if f(n)c1g(n)f(n)\le c_1 g(n) and g(n)c2h(n)g(n)\le c_2 h(n) (in bound form), then multiply inequalities and absorb constants into a new constant.

Example:

  • If T(n)=O(n)T(n)=O(n) and S(n)=O(logn)S(n)=O(\log n), then T(n)S(n)=O(nlogn)T(n)\cdot S(n)=O(n\log n).

4) Powers: exponentiation changes growth class

  • If f(n)=O(g(n))f(n)=O(g(n)) and kk is a positive integer, then
    (f(n))k=O((g(n))k)(f(n))^k = O((g(n))^k)
    (constants can again be absorbed into multiplicative factors).

Example:

  • If f(n)=O(n)f(n)=O(n), then (f(n))2=O(n2)(f(n))^2 = O(n^2).

5) Substitution / monotonic “reasonable” simplifications

Big-Oh manipulation typically assumes you are not doing invalid transformations like replacing a non-asymptotic step with a different function without justification. A safe pattern is:

  • simplify within algebraic expressions using known identities, then apply the rules above (dominance, constants, max, products).

6) Common logarithm facts used in Big-Oh

These follow from logarithm identities:

  • log(nk)=klogn\log(n^k)=k\log n (so O(log(nk))=O(logn)O(\log(n^k))=O(\log n) because kk is constant)
  • loga+logb=log(ab)\log a + \log b = \log(ab) (then reclassify growth order)

[Callout]{type="tip" title="Pro Tip"} When multiple logs or polynomial terms exist, it’s often the largest-growth factor (like n2n^2 vs logn\log n) that determines Big-Oh after max/dominance simplification. [Callout]{type="warning" title="Common Pitfall"} Don’t assume O(n)+O(nlogn)=O(n)O(n)+O(n\log n)=O(n)—the nlognn\log n term dominates nn for large nn.


Footnotes

  1. Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants cc and n0n_0 (eventually bounded). 2 3 4

  2. Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes. 2 3 4 5 6 7 8

Typical growth rates: relative speed (qualitative)

Higher rows increase faster as n grows; Big-Oh classification ignores constants and focuses on eventual dominance. (Qualitative ordering)

Typical growth rates (what they mean in practice)

Below are common growth-rate classes you’ll see when analyzing algorithms, along with intuition and how to compare them as nn\to\infty.

Constant and logarithmic

  • O(1)O(1): constant time—bounded work independent of nn.
  • O(logn)O(\log n): work grows slowly; doubling nn adds only a constant number of iterations (common in binary search).
  • O(logkn)O(\log^k n): still polylogarithmic; treated as slower than any polynomial nan^a with a>0a>0 in asymptotic comparisons.

Linear and near-linear

  • O(n)O(n): each element (or edge) is processed a constant number of times.
  • O(nlogn)O(n\log n): typical for efficient comparison-based algorithms (e.g., mergesort-like patterns); the logn\log n factor comes from divide-and-conquer or balanced recursion depth.2

Polynomial

  • O(n2)O(n^2): quadratic—often from nested loops over nn.
  • O(n3)O(n^3): cubic—triple nesting or matrix-cubic transforms.
  • General polynomial: O(nk)O(n^k) for constant kk grows much slower than exponential and factorial.

Exponential and factorial (infeasible at moderate sizes)

  • O(2n)O(2^n): doubles the work with each extra element in the worst case—quickly becomes impractical.
  • O(n!)O(n!): even faster than 2n2^n; grows astronomically.

[Callout]{type="danger" title="Warning"} Exponential (O(2n)O(2^n)) and factorial (O(n!)O(n!)) algorithms typically only work for very small nn. In contrast, polynomial-time algorithms scale much more gracefully as nn grows.


Footnotes

  1. Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes. 2 3 4 5

  2. Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants cc and n0n_0 (eventually bounded).

Growth-rate comparison: dominance ordering

A useful simplified ordering by “eventual speed” is:

O(1)O(logn)O(n)O(nlogn)O(n2)O(n3)O(2n)O(n!).O(1) \prec O(\log n) \prec O(n) \prec O(n\log n) \prec O(n^2) \prec O(n^3) \prec O(2^n) \prec O(n!).

This corresponds to the idea that for large nn, faster-growing terms dominate sums and products under Big-Oh simplification rules.2

Mermaid: dominance intuition graph


Footnotes

  1. Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes.

  2. Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants cc and n0n_0 (eventually bounded).

Common Big-Oh questions (FAQs)

Using Big-Oh in an analysis workflow

Write $T(n)$

1. Express

Form a cost function from the algorithm’s steps (loops/recursion)."

Reduce to a dominant term

2. Simplify

Drop constants and lower-order terms; use max for sums."

Apply rules

3. Combine

Use product/power rules for combined components."

State Big-Oh class

4. Conclude

Report the resulting O()O(\cdot) bound (worst-case typically)."


Big-Oh manipulation & growth-rate flashcards

1 / 5
Question · Term

What does $f(n)=O(g(n))$ mean formally?

Click to reveal
Answer · Definition

There exist constants c>0c>0 and n0n_0 such that for all nn0n\ge n_0, f(n)cg(n)f(n)\le c\cdot g(n).

Knowledge Check

Question 1 of 4
Q1Single choice

Which simplification is correct for Big-Oh?