Big-Oh Manipulation Rules and Typical Algorithm Growth Rates
Big-Oh notation (Big-O) is used to describe how an algorithm’s running time or space requirement scales with input size .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 , , and .
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
-
Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants and (eventually bounded). ↩ ↩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, means: there exist constants and such that for all ,
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 , then multiplying by another constant or multiplying by a constant keeps it in the same asymptotic relationship (after adjusting ).
keyword Dominance
If grows faster than (e.g., dominates ), then is still because eventually the larger term dominates.
Footnotes
-
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
- 1Step 1
Start from something like or .
- 2Step 2
Replace with because constant factors do not affect .
Footnotes
-
Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants and (eventually bounded). ↩
-
- 3Step 3
Remove terms that are asymptotically smaller than the largest term (e.g., is lower-order than ). This follows from dominance.
Footnotes
-
Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes. ↩
-
- 4Step 4
Use: for large (i.e., the bigger term controls the sum).
- 5Step 5
For products, combine growth rates (e.g., ) while keeping in mind that exponents can drastically increase growth.
- 6Step 6
"Use properties like and (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 and be any function with nonnegative growth for large .
- Adding a constant:
If , then (constants are lower-order than any unbounded ). - Multiplying by a constant:
If , then for constant . - Constant replacement:
for constant .
2) Sums: the maximum (dominant term) rule
- Sum of Big-Oh terms:
.
Intuition: for large , one term eventually dominates the other, so the sum is bounded by a constant multiple of the larger term.2
Example:
- If , then because dominates .
3) Products: multiply bounds
- Product rule:
.
Reason: if and (in bound form), then multiply inequalities and absorb constants into a new constant.
Example:
- If and , then .
4) Powers: exponentiation changes growth class
- If and is a positive integer, then
(constants can again be absorbed into multiplicative factors).
Example:
- If , then .
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:
[Callout]{type="tip" title="Pro Tip"} When multiple logs or polynomial terms exist, it’s often the largest-growth factor (like vs ) that determines Big-Oh after max/dominance simplification. [Callout]{type="warning" title="Common Pitfall"} Don’t assume —the term dominates for large .
Footnotes
-
Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants and (eventually bounded). ↩ ↩2 ↩3 ↩4
-
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 .
Constant and logarithmic
- : constant time—bounded work independent of .
- : work grows slowly; doubling adds only a constant number of iterations (common in binary search).
- : still polylogarithmic; treated as slower than any polynomial with in asymptotic comparisons.
Linear and near-linear
- : each element (or edge) is processed a constant number of times.
- : typical for efficient comparison-based algorithms (e.g., mergesort-like patterns); the factor comes from divide-and-conquer or balanced recursion depth.2
Polynomial
- : quadratic—often from nested loops over .
- : cubic—triple nesting or matrix-cubic transforms.
- General polynomial: for constant grows much slower than exponential and factorial.
Exponential and factorial (infeasible at moderate sizes)
- : doubles the work with each extra element in the worst case—quickly becomes impractical.
- : even faster than ; grows astronomically.
[Callout]{type="danger" title="Warning"} Exponential () and factorial () algorithms typically only work for very small . In contrast, polynomial-time algorithms scale much more gracefully as grows.
Footnotes
-
Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes. ↩ ↩2 ↩3 ↩4 ↩5
-
Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants and (eventually bounded). ↩
Growth-rate comparison: dominance ordering
A useful simplified ordering by “eventual speed” is:
This corresponds to the idea that for large , faster-growing terms dominate sums and products under Big-Oh simplification rules.2
Mermaid: dominance intuition graph
Footnotes
-
Asymptotic notation - Wikipedia https://en.wikipedia.org/wiki/Asymptotic_notation - Properties like dominance and behavior of common growth-rate classes. ↩
-
Big O notation - Wikipedia https://en.wikipedia.org/wiki/Big_O_notation - Formal definition using constants and (eventually bounded). ↩
Common Big-Oh questions (FAQs)
Using Big-Oh in an analysis workflow
Write $T(n)$
1. ExpressForm a cost function from the algorithm’s steps (loops/recursion)."
Reduce to a dominant term
2. SimplifyDrop constants and lower-order terms; use max for sums."
Apply rules
3. CombineUse product/power rules for combined components."
State Big-Oh class
4. ConcludeReport the resulting bound (worst-case typically)."
Big-Oh manipulation & growth-rate flashcards
Knowledge Check
Which simplification is correct for Big-Oh?
Explore Related Topics
Algorithms
Algorithms are finite, well-defined procedures that transform inputs into outputs, requiring correctness, efficiency, and formal properties such as definiteness and finiteness.
- Valid algorithms must be definite, finite, have clear input/output, and be effective; correctness and efficiency are essential.
- Analyzing an algorithm involves problem specification, pseudocode, correctness proof, and measuring time (, , ) and space complexity.
- Common growth rates range from to , with divide‑and‑conquer recurrences like .
- Key design paradigms include divide‑and‑conquer, dynamic programming, greedy, backtracking, and branch‑and‑bound.
- Choosing an algorithm depends on input characteristics, worst‑case vs. average performance, memory limits, stability, and preprocessing needs.
Merge Sort: Working, Example, and Complexity Analysis
Time Complexity of the Given C++ `gcd` Function