:::caution Common Pitfall Generating functions are formal power series; they may not converge for any x=0. Convergence Is irrelevant for combinatorial applications — the series is manipulated algebraically.
6.5 The Master Theorem
The Master Theorem provides asymptotic solutions to recurrences of the form
T(n)=aT(n/b)+f(n)
Where a≥1, b>1 are constants and f(n) is asymptotically positive. Define c_{\mathrm{crit{}} = \log_b a (the critical exponent).
Theorem 6.1 (Master Theorem). Let T(n) be defined as above.
Case 1: If f(n)=O(nc) for some c \lt c_{\mathrm{crit{}}Then T(n) = \Theta(n^{c_{\mathrm{crit{}}}).
Case 2: If f(n) = \Theta(n^{c_{\mathrm{crit{}}} \log^k n) for some k≥0Then T(n) = \Theta(n^{c_{\mathrm{crit{}}} \log^{k+1} n).
Case 3: If f(n)=Ω(nc) for some c \gt c_{\mathrm{crit{}}And af(n/b)≤δf(n) For some δ<1 and sufficiently large n (the regularity condition), then T(n)=Θ(f(n)).
Since f(n)=n2=Ω(nc) for any c<2And 2 \gt 1.585 = c_{\mathrm{crit{}}We are in Case 3 (provided the regularity condition holds). Check: 3⋅(n/2)2=3n2/4=0.75n2≤δn2 For δ=0.75<1. ✓
f(n)=n=O(nc) for any c>0 with c<2So we are in Case 1.
Therefore T(n)=Θ(n2).
Proof sketch of the Master Theorem. Expand the recurrence tree. At level j (root is level 0), There are aj subproblems, each of size n/bjEach contributing f(n/bj) work. The tree has logbn levels, with a^{\log_b n} = n^{c_{\mathrm{crit{}}} leaves. The total work is
Case 1:f(n)=O(nc) with c \lt c_{\mathrm{crit{}}. The sum is dominated by the leaves, giving T(n) = \Theta(n^{c_{\mathrm{crit{}}}).
Case 2:f(n) = \Theta(n^{c_{\mathrm{crit{}}} \log^k n). Each level contributes the same order, with logbn levels, giving T(n) = \Theta(n^{c_{\mathrm{crit{}}} \log^{k+1} n).
Case 3:f(n)=Ω(nc) with c \gt c_{\mathrm{crit{}}. The root level dominates, giving T(n)=Θ(f(n)). The regularity condition af(n/b)≤δf(n) ensures the root dominates all levels below. The Master Theorem does not apply to recurrences like T(n)=T(n−1)+n (not of the form aT(n/b)+f(n)). Also, if f(n) falls between cases (e.g., f(n)=nlogn with c_{\mathrm{crit{}} = 1), the Master Theorem does not apply and the Akra—Bazzi method should be used Instead. :::