Chapter 7: Induction
Source files used: Intro_ocw (Lecture 1 notes, greedy proofs on pages 5A and 5B), Medians_induction (Lecture 2 notes, page 10), Matrix Multiplication (Recitation 1, Section 3.3), MIT6_046JS15_pset1 (Problem 1-1 as practice); textbook Chapter 4 (chap4, Section 4.3) as support. No worked examples are included.
1. Big Picture
Induction is the proof engine of the course. It shows up in two places:
- correctness: proving a greedy algorithm is optimal (interval scheduling),
- running time: proving a guessed bound for a recurrence (the substitution method, median finding).
The Recurrences guide asked: how do you guess a bound? This guide asks: how do you prove it, and how do you prove an algorithm correct?
Every exam proof is graded on the same three parts: base case, inductive hypothesis, inductive step.
2. Core Ideas
2.1 Anatomy of an Induction Proof
- Claim : a precise statement with named constants, not .
- Base case: prove for the smallest values (one value or a range).
- Inductive hypothesis: assume holds for smaller values.
- Inductive step: use the hypothesis to prove for the next value.
2.2 Strong Induction
For recurrences you usually assume the bound for all , not only , because the recursion calls sizes like and . The recitation states it this way: assume the bound holds for all positive .
2.3 What to Induct On
- Greedy correctness: induct on the size of the optimal solution ( in interval scheduling).
- Recurrence bounds: induct on the input size .
Pick the quantity that shrinks when you remove the first decision or make a recursive call.
2.4 Exchange Argument
The core move in greedy proofs: take an optimal solution and swap its first choice for the greedy choice. Show the result is still valid and still optimal. Then the rest of the problem is a smaller instance, where the inductive hypothesis applies.
2.5 Substitution Method = Induction on a Recurrence
Textbook definition:
- Guess the form of the solution using symbolic constants.
- Use induction to show the guess works, and find the constants.
Prove and separately; together they give .
3. Main Governing Equations and Formulas
3.1 Greedy Validity (Lecture 1, Claim 1)
Earliest-finish-time greedy outputs
Proof by contradiction: if , intervals and intersect, contradicting step 2 of the algorithm (reject incompatible requests).
Use to show the output is a legal schedule before arguing optimality.
3.2 Greedy Optimality: Statement (Lecture 1, Claim 2)
Given a list of intervals , the greedy algorithm with earliest finish time produces intervals, where is the optimal number.
Proof: induction on .
3.3 The Exchange Fact
Let the optimal schedule be and the greedy schedule . Greedy picks the earliest finish time, so
Therefore
is valid () and also optimal (same size).
3.4 Greedy Optimality: Full Proof
- Base case : any interval works.
- Hypothesis: the claim holds for every list whose optimal schedule has intervals.
- Step: let have an optimal schedule of intervals. Build as in Section 3.3.
- Define as the set of intervals with .
- Since is optimal for , is optimal for (otherwise adding in front would beat ). So the optimal schedule for has size .
- By the inductive hypothesis, greedy on produces a schedule of size .
- By construction, greedy on produces exactly .
- So , that is , and is optimal.
Use this structure for any “prove your greedy algorithm is optimal” question.
3.5 Substitution Example: (Textbook)
Recurrence . Hypothesis: for .
The last step needs large enough that dominates the term.
Base case: fails because . Use and pick , which covers .
3.6 Substitution Example: Median Finding (Lecture 2)
Prove for :
The bracket is when , which holds for and . Base case : choose large. Full detail in the Medians guide.
3.7 Trick: Subtract a Lower-Order Term (Textbook)
Recurrence . The guess gives
which is not . The guess is right, but the hypothesis is too weak. Strengthen it to :
which holds once exceeds the constant in .
With several recursive calls, subtracting a term subtracts it once per call, which is why this helps.
3.8 Pitfall: Asymptotic Notation in the Hypothesis (Textbook)
A false “proof” that :
The constant hidden in grows at every level. With explicit constants the step gives , which is not . Rule: name the constants and prove the exact form of the hypothesis.
4. Problem-Solving Workflow
4.1 Proving a Greedy Algorithm Correct
- Prove the output is valid (often by contradiction with the algorithm’s rejection step).
- State optimality as a claim about the optimal size .
- Base case: smallest .
- Exchange: replace the optimal solution’s first choice with the greedy choice; show it stays valid and optimal.
- Define the remaining subproblem () and show the rest of the exchanged solution is optimal for it.
- Apply the hypothesis to the subproblem and match it to the greedy output.
Practice: Problem Set 1, Problem 1-1 (c) asks for a simple greedy algorithm and a correctness proof.
4.2 Proving a Recurrence Bound by Substitution
- Guess the form (recursion tree, similar known recurrence, or loose bounds squeezed together).
- Write the hypothesis with named constants: , not .
- Assume it for all and substitute into the recurrence.
- Simplify until you get (hypothesis) minus (something) plus (driving term).
- Choose constants so the leftover is .
- Handle the base cases by choosing the leading constant large enough.
- If the step fails by only a lower-order term, subtract a lower-order term from the guess (Section 3.7).
5. Decision Rules / Decision Trees
5.1 The Inductive Step Does Not Close
Off by a lower-order term (for example vs )? → subtract a lower-order term:
Off by a growing factor (for example vs )? → guess is too small: try a larger form
Used inside the hypothesis? → rewrite with explicit constants
5.2 Base Case Trouble
Bound is at (like )? → start the induction at and cover a small range ()
Recurrence has or ceilings? → use a larger base range (the lecture uses )
5.3 Correctness or Running Time?
“Prove the algorithm returns an optimal answer”? → induction on the solution size + exchange argument
“Prove ”? → substitution method on
6. Important Tables / Correlations Needed
6.1 Course Induction Proofs
| Proof | Induct on | Key step | Source |
|---|---|---|---|
| Greedy interval scheduling optimal | exchange for | Lecture 1 | |
| Median Select is | Lecture 2 | ||
| Median Select is (variant) | , | Recitation 1 | |
| is | Textbook 4.3 | ||
| is | guess | Textbook 4.3 |
6.2 Common Mistakes
| Mistake | Fix |
|---|---|
| in the hypothesis | name the constant |
| Proving instead of | prove the exact hypothesis |
| Base case at for | start at |
| Adding a lower-order term to a failing guess | subtract it instead |
| Forgetting the validity part of a greedy proof | prove compatibility first |
7. Key Takeaways
- Every induction proof needs a claim, a base case, a hypothesis, and a step.
- Recurrence proofs use strong induction: assume the bound for all .
- Greedy proofs induct on the optimal size and use an exchange argument.
- Interval scheduling exchange fact: , so is valid and optimal.
- Substitution: guess with symbolic constants, then prove by induction.
- Never put in the inductive hypothesis; name the constants.
- Prove the exact form (), not just "".
- If the step fails by a lower-order term, subtract a lower-order term from the guess.
- For , the base case cannot be .
- Median proof closes for with .