Source files used: Matrix Multiplication (Recitation 1, Sections 3.1, 3.2, 3.4), Convex_hull (Lecture 2 notes, D&C paradigm and convex hull recurrence), MIT6_046JS15_pset1 (Exercise 1-2 as practice); textbook Chapter 4 (chap4, Section 4.5) as support.
No worked examples are included.
1. Big Picture
The master theorem is a cookbook for divide-and-conquer recurrences with equal-size subproblems.
The Recurrences guide asks: how do you solve a recurrence in general? This guide asks: when the recurrence has the form aT(n/b)+f(n), how do you read off the answer without a proof?
Compare f(n) with nlogba, pick the case, write Θ(⋅).
What you need:
the general form and the watershed function nlogba,
the three cases, including the lgkn version of case 2,
the regularity condition for case 3,
the gaps where the theorem does not apply.
2. Core Ideas
2.1 The Form It Solves
T(n)=aT(n/b)+f(n)
a: number of subproblems (a≥1 in the lecture paradigm),
n/b: size of each subproblem (b>1),
f(n): work to divide and combine (the lecture writes “[work for merge]”); the textbook calls it the driving function.
Floors and ceilings in n/b do not change the answer, so ignore them.
2.2 The Watershed Function
nlogba
This is the total cost of the leaves of the recursion tree: there are alogbn=nlogba leaves. Every case compares f(n) against this function.
2.3 Recursion-Tree Intuition
Case 1: cost per level grows geometrically toward the leaves. Leaves dominate.
Case 2: every level costs about the same, and there are Θ(lgn) levels. Multiply by lgn.
Case 3: cost per level drops geometrically from the root. Root dominates.
The recitation suggests drawing the tree for T(n)=4T(n/2)+Θ(n2) to see why the extra log factor appears when the two functions match: each of the lgn levels does Θ(n2) work.
2.4 “Polynomially” Larger or Smaller
Cases 1 and 3 need a gap of at least nϵ for some constant ϵ>0. Being larger or smaller by only a log factor is not enough.
Example (textbook): 4T(n/2)+n1.99. Watershed is n2, and n1.99 is smaller by n0.01, so case 1 applies with ϵ=0.01.
2.5 Regularity Condition
Case 3 also needs
af(n/b)≤cf(n)for some constant c<1 and all large n
It says the root really dominates: the combined work one level down is a constant fraction smaller. Most polynomial driving functions satisfy it.
3. Main Governing Equations and Formulas
3.1 Case 1: Leaves Dominate
If f(n)=O(nlogba−ϵ) for some constant ϵ>0:
T(n)=Θ(nlogba)
Use when f(n) is polynomially smaller than the watershed.
3.2 Case 2: Balanced (with lgkn)
If f(n)=Θ(nlogbalgkn) for some constant k≥0:
T(n)=Θ(nlogbalgk+1n)
The most common form is k=0:
f(n)=Θ(nlogba)⇒T(n)=Θ(nlogbalgn)
Use when f(n) matches the watershed up to a polylog factor. Add exactly one extra lgn.
Recitation check: 4T(n/2)+Θ(n2lgn) is Θ(n2lg2n), not Θ(n2lgn).
3.3 Case 3: Root Dominates
If f(n)=Ω(nlogba+ϵ) for some constant ϵ>0, andaf(n/b)≤cf(n) for some c<1 and all large n:
T(n)=Θ(f(n))
Use when f(n) is polynomially larger than the watershed. Always state the regularity check.
3.4 Where the Theorem Fails
The theorem says nothing when:
f(n) is smaller than the watershed, but only by a log factor (gap between cases 1 and 2),
f(n) is larger than the watershed by more than a polylog but less than a polynomial (gap between cases 2 and 3),
case 3 holds except for regularity,
f(n) and nlogba cannot be compared,
the recurrence is not of the form aT(n/b)+f(n) (unequal splits, T(n−1)).
Recitation and textbook example of a gap:
T(n)=2T(n/2)+Θ(lgnn)
Watershed n; n/lgn is smaller, but not polynomially. Case 2 would need k=−1, and k must be ≥0. The textbook gives the answer Θ(nlglgn), found by other methods.
3.5 Course Recurrences Solved by the Master Theorem
Merge sort and D&C convex hull:
T(n)=2T(n/2)+Θ(n)=Θ(nlgn)(case 2)
Convex hull with the naive O(n2) tangent search:
T(n)=2T(n/2)+Θ(n2)=Θ(n2)(case 3)
Recursive block matrix multiplication:
T(n)=8T(n/2)+Θ(1)=Θ(n3)(case 1)
Strassen:
T(n)=7T(n/2)+Θ(n2)=Θ(nlg7)≈Θ(n2.807)(case 1)
Binary search (textbook):
T(n)=T(n/2)+Θ(1)=Θ(lgn)(case 2)
Use these as anchors: if an exam recurrence looks like one of them, the case is probably the same.