CS2050 L12 Growth of Functions
Overview
Abrahim Ladha develops the mathematical tools for comparing function growth, from total and partial orders to monotonicity and asymptotic notation. He defines Big O, Omega, and Theta through eventual constant-factor bounds, then proves examples including log₂ n = O(n), a quasi-polynomial that exceeds every polynomial, and the fixed-power sum ∑ᵢ₌₁ⁿ iᵗ = Θ(nᵗ⁺¹).
Key takeaways
- A Big O proof requires explicit witnesses C and n₀: for example, (n + 1)² ≤ 3n² for all n ≥ 2, so (n + 1)² = O(n²).
- Monotonicity proofs rely on order-preserving operations under the right domain restrictions; x² is strictly increasing on positive reals but not across all real numbers.
- The logarithm grows more slowly than a linear function: induction proves log₂ n < n for every natural n ≥ 1.
- For every fixed ε > 0, 2^((log₂ n)^(1 + ε)) is not O(nᵏ) for any fixed k, because taking logarithms would incorrectly bound an unbounded function by a constant.
- The sum of the first n fixed powers has tight growth Θ(nᵗ⁺¹): bounding every term above and the final half of terms below gives matching polynomial rates.
- Big O suppresses fixed multiplicative differences, making asymptotic algorithm comparisons less sensitive to hardware speed and other constant-factor effects.
Chapters
- Real numbers and natural numbers are totally ordered: any two values can be compared.
- Sets use a partial order under containment, because some pairs of sets are incomparable.
- A monotonically increasing function preserves order, while a strictly increasing function requires x < y to imply f(x) < f(y).
- The function f(x) = x is increasing, and x² is strictly increasing when its domain is restricted to positive reals.
- Over all real numbers, x² decreases before zero and increases after zero, so the domain restriction matters.
- A graph can suggest monotonicity, but a proof must establish the property for every eligible input.
- Assume positive reals x < y, then multiply the inequality by positive x to obtain x² < xy.
- Multiplying x < y by positive y gives xy < y².
- Transitivity yields x² < y², proving strict monotonicity without relying on a graph.
- Define log₂ x = y by the equivalence 2ʸ = x, rather than assuming an inverse-function result.
- For x < y, choose c > 1 such that y = cx; then log₂ y = log₂ c + log₂ x.
- Since c > 1 implies log₂ c > 0, log₂ y > log₂ x; logarithms grow slowly but remain increasing.
- For functions from natural numbers to positive reals, f(n) is O(g(n)) when constants C and n₀ exist such that f(n) ≤ Cg(n) for every n ≥ n₀.
- The constants C and n₀ are witnesses: C allows a multiplicative scale, while n₀ sets the point after which the bound must hold.
- Asymptotics capture long-run behavior in algorithm runtime and combinatorial counting, even when exact formulas are difficult or irrelevant.
- For n ≥ 2, n² ≥ 2n; for n ≥ 1, n² ≥ 1.
- Adding these bounds to n² ≤ n² gives n² + 2n + 1 ≤ 3n² for n ≥ 2.
- Choosing C = 3 and n₀ = 2 proves (n + 1)² = O(n²); simple valid witnesses matter more than optimal ones.
- If f₁(n) = O(g₁(n)) and f₂(n) = O(g₂(n)), use their witnesses C₁, n₁ and C₂, n₂.
- For n ≥ max(n₁, n₂), multiply the inequalities to obtain f₁(n)f₂(n) ≤ C₁C₂g₁(n)g₂(n).
- Thus the product is O(g₁g₂), with combined witnesses C = C₁C₂ and n₀ = max(n₁, n₂).
- Big O treats 2n and 3n as equivalent in growth rate because a fixed multiplier does not change the underlying rate.
- For algorithm analysis, allowing constant factors helps separate algorithmic growth from hardware differences such as one machine being 17% faster.
- Immediate examples include n = O(n²), √n = O(n), and nᵏ = O(nᵏ⁺¹) for fixed k.
- For natural n ≥ 1, prove log₂ n < n by induction, starting from log₂ 1 = 0 < 1.
- For the inductive step, use k > 1 to bound log₂(k + 1) ≤ log₂(2k) = 1 + log₂ k < k + 1.
- The resulting bound gives log₂ n = O(n) with C = 1 and n₀ = 1.
- Consider 2^((log₂ n)^(1 + ε)) for fixed ε > 0, a quasi-polynomial growth form.
- Assuming it is O(nᵏ) would give 2^((log₂ n)^(1 + ε)) ≤ Cnᵏ eventually; for sufficiently large n, absorb C into an extra power to bound the right side by nᵏ⁺¹.
- Taking log₂ of both sides leads to (log₂ n)^ε ≤ k + 1, contradicting that log₂ n is unbounded.
- f(n) = Ω(g(n)) means f(n) ≥ Cg(n) eventually for some positive constant C and threshold n₀.
- f(n) = Θ(g(n)) combines an O upper bound and an Ω lower bound, so the functions match up to constant factors eventually.
- Lower bounds for algorithms are harder to establish because they must account for every possible way to solve the problem.
- Since each factor i in n! is at most n, the product 1 · 2 · … · n is at most nⁿ, proving n! = O(nⁿ).
- The familiar sums ∑ᵢ₌₁ⁿ i and ∑ᵢ₌₁ⁿ i² illustrate how exact formulas can reveal polynomial growth.
- For fixed t, the sum ∑ᵢ₌₁ⁿ iᵗ can be bounded asymptotically without deriving its more complicated exact formula.
- Upper-bound ∑ᵢ₌₁ⁿ iᵗ by replacing each of its n terms with nᵗ, giving nᵗ⁺¹.
- For a lower bound, keep only the final roughly n/2 terms; each is at least (n/2)ᵗ, producing a constant multiple of nᵗ⁺¹.
- The matching upper and lower bounds establish ∑ᵢ₌₁ⁿ iᵗ = Θ(nᵗ⁺¹) for fixed t.
Transcript excerpt
0:01 This is uh CS 2050. The topic of today is something called asmtoic symptomic hope there's not a P there analysis. I hope that's spelled correctly. Of the lectures in this class, discrete math distinguishes itself from all the other uh kinds of math you usually take in the sense that it's very structural. Um but of course this is still a math class. So of the lectures that we'll cover, this is I think pro probably the most analytical of them in the sense that you're really working with uh like quantity as like a mathematical object. So recall what we've done so far is we've talked about functions and we've talked about bjections, but we want to talk about basically growth of functions and and and these kinds of things. And so we can define for objects uh this uh
0:50 ordering relation. And we kind of all intuitively know what this means. This is a total ordering that we could say of reals. We could say of natural numbers, right? And you could give a very formal definition in the context of natural numbers. What this is to mean? You could say something like there exists some c such that uh uh a plus c is b and you know c is not zero something like this for naturals. But we all know what it means like intuitively. We could give a similar def definition for the real numbers. Um you can also say like a is less than equal to b if and only if a is less than b or uh a equals b right things and then from there you can basically the same way we proved that multiplication sorry addition was
1:37 associative and and these kinds of things you could work with this definition and build up all the basic
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Abrahim Ladha.