Sub topic 3
Case 3, the Theorem's Limits, and Methods Beyond It
This chapter assumes you know Big-Theta notation, logarithm identities, geometric series, and the recursion tree method.
Case 3: When the Root Dominates
Suppose f(n) = Ω(n^(log_b a + ε)) for some ε > 0. Case 3 also requires the regularity condition: a·f(n/b) ≤ c·f(n) for some constant c < 1 and all large n. If both hold, T(n) = Θ(f(n)).
For T(n) = 2T(n/2) + n², we have log_2 2 = 1 and f(n) = n², which is polynomially larger than n. Regularity holds because 2(n/2)² = n²/2, so c = 1/2 works. The answer is T(n) = Θ(n²).
Extended Case 2: Log Factors
If f(n) = Θ(n^(logb a) · log^k n) with k ≥ 0, then T(n) = Θ(n^(logb a) · log^(k+1) n). For example, T(n) = 2T(n/2) + n log n solves to Θ(n log² n).
When the Theorem Does Not Apply
| Recurrence | Problem |
|---|---|
| T(n) = 2T(n/2) + n / log n | f(n) is smaller than n, but not polynomially smaller |
| T(n) = T(n−1) + n | The input shrinks by subtraction, not division |
| T(n) = T(n/3) + T(2n/3) + n | The subproblems have unequal sizes |
| T(n) = 0.5T(n/2) + n | a < 1 |
Why the Three Cases Arise
Level j of the recursion tree has a^j nodes, and each one costs f(n/b^j). The tree has n^(log_b a) leaves. The level sums form a series. If the series grows geometrically, the leaves dominate (case 1). If every level costs about the same, you get that cost times log n levels (case 2). If the series shrinks geometrically, the root dominates (case 3).
Floors, Ceilings, and Base Cases
Replacing n/b with ⌊n/b⌋ or ⌈n/b⌉ does not change the Θ bound. A constant base case only adds Θ(n^(log_b a)) of leaf work.
Linear Recurrences
For T(n) = T(n−1) + T(n−2), substitute T(n) = xⁿ. This gives the characteristic equation x² = x + 1, whose roots are φ = (1+√5)/2 and ψ = (1−√5)/2. Since |ψ| < 1, the φ term dominates, so T(n) = Θ(φⁿ) ≈ Θ(1.618ⁿ).
Uneven Splits: Akra-Bazzi
For T(n) = Σ ai·T(bi·n) + g(n), first find the p that satisfies Σ ai·bi^p = 1. Then:
T(n) = Θ(n^p · (1 + ∫₁ⁿ g(u)/u^(p+1) du))
For T(n) = T(n/3) + T(2n/3) + n, p = 1 because 1/3 + 2/3 = 1. The integral is ∫₁ⁿ 1/u du = ln n, so T(n) = Θ(n log n).
Exercise
Solve T(n) = 3T(n/4) + n log n.
Show answer
log_4 3 ≈ 0.79, and n log n = Ω(n^(0.79+ε)), so case 3 is a candidate. Regularity holds: 3(n/4)log(n/4) ≤ (3/4)·n log n, so c = 3/4. Therefore T(n) = Θ(n log n).
Exercise
Solve T(n) = 4T(n/2) + n² log n.
Show answer
log_2 4 = 2 and f(n) = n² log n, which is extended case 2 with k = 1. Therefore T(n) = Θ(n² log² n).