Big-O Addition Rule: Prove
We will prove a standard closure property of Big-O: if Big-O and , then
This proof relies directly on the definition of Big-O and a simple inequality manipulation:
To make the inequality step valid, we assume the usual conditions used with Big-O: and are nonnegative asymptotic functions for all (or at least that eventually), so can serve as an upper-bound scale. (These conditions are standard in algorithm analysis.)
Key terms used in this section: Big-O, asymptotic bound, eventually, nonnegative functions.
Footnotes
-
Big O notation (Wikipedia) https://en.wikipedia.org/wiki/Big_O_notation - Defines Big-O via constants and “for sufficiently large ”. ↩
-
Big O notation (math/CS context) https://en.wikipedia.org/wiki/Asymptotic_notations - Discusses formal definition and properties of asymptotic notation. ↩
-
Big O notation properties and manipulation https://en.wikipedia.org/wiki/Big_O_notation - Notes about algebraic manipulation and closure-like behaviors (with conditions). ↩
Big-O definition and basic proof patterns
Formal Big-O proof for the sum
- 1Step 1
From , there exist constants and such that for all , . Similarly, from , there exist and such that for all , . Big-O
- 2Step 2
Let . Then for all , both inequalities hold simultaneously.
- 3Step 3
For all ,
- 4Step 4
Let . Then and , so
- 5Step 5
We have shown that for all , Therefore, by the definition of Big-O.
Pro Tip: Use $c=\max(c_1,c_2)$
When you have two Big-O bounds and , the cleanest way to combine them is to pick one constant that dominates both: .
Be careful about signs / eventual nonnegativity
The inequality is straightforward if eventually. If signs can change, you must adapt the argument (e.g., use absolute values or ensure is eventually positive).
Why this works (intuition)
Big-O gives an eventual upper envelope: beyond some , each is no more than a constant multiple of its corresponding . Adding them preserves “upper envelope” behavior: the sum cannot grow faster than the sum of the envelopes (up to a constant factor).
This is a concrete instance of a more general closure property: if each term is bounded by a scaled reference function, then their combined expression is bounded by the combined reference function.
Key terms: closure property, upper bound, eventual inequality, constant factor.2
Footnotes
-
Big O notation (math/CS context) https://en.wikipedia.org/wiki/Asymptotic_notations - Discusses formal definition and properties of asymptotic notation. ↩
-
Big O notation properties and manipulation https://en.wikipedia.org/wiki/Big_O_notation - Notes about algebraic manipulation and closure-like behaviors (with conditions). ↩
Proof Roadmap (as you would teach it)
Unpack Big-O
Step AConvert each statement into an explicit inequality with constants."
Choose a common $N$
Step BLet so both inequalities hold together."
Add and bound again
Step CAdd the inequalities and upper-bound coefficients using ."
Apply the definition
Step DConclude ."
Common pitfalls and extensions
How the bound behaves
Big-O of the sum is controlled by the combined envelopes .
Knowledge Check
Suppose and . Which statement follows (under the standard eventual nonnegativity conditions)?
Explore Related Topics
Primitive Recursiveness of the Sum Function $f(x,y)=x+y$
Complexity Analysis of a Divide-and-Conquer Recurrence
The course explains how to determine the asymptotic complexity of the divide‑and‑conquer recurrence .
- Identify parameters: , , .
- Critical exponent , so leaf cost grows as .
- Since for , Case 3 of the Master Theorem applies.
- Regularity condition holds with , confirming dominance of the root work.
- Consequently , which is also derived via recursion‑tree and Akra‑Bazzi methods.
Cartesian Products Intersection When Sets Share $n$ Elements