Purpose
Induction is the main proof technique behind recursive algorithms, so it pays to have the mechanics down cold. This note works two small proofs in full: the closed form for , and the pigeonhole principle. Both follow the same skeleton of base case, inductive hypothesis, and inductive step.
Proof skeleton
- Define the predicate so the claim is exactly .
- Base case: prove directly.
- Inductive hypothesis: assume for an arbitrary .
- Inductive step: derive from the hypothesis.
Sum of the First n Naturals
Claim:
Let denote the statement .
Base case :
Inductive hypothesis: assume for some .
Inductive step: applying to the first terms,
so holds.
Pigeonhole Principle
Claim: put balls into bins, and some bin holds at least 2 balls.
for any way to put balls into bins, there exists a bin with balls.
Base case : both balls land in the single bin, which then holds 2 balls.
Inductive hypothesis: assume holds for some .
Inductive step: suppose balls are placed arbitrarily into bins . Consider .
- If holds 2 or more balls, we are done.
- If holds exactly 1 ball, discard and its ball. That leaves balls in the bins , so gives a bin with balls.
- If is empty, discard and one arbitrary ball. Again balls sit in bins, and applies.
The build-up error
The inductive step must start from an arbitrary instance of size and shrink it. The pigeonhole proof takes any placement of balls and discards a bin. Arguing in the other direction, by extending a size instance, only covers the instances you can reach that way, and the proof silently skips the rest.
The General Pattern
Both proofs reduce to by peeling one element off the instance. When designing recursive algorithms the same move appears as solving a problem of size using a solution of size . Divide and conquer changes only the reduction: instead of shrinking by one, you shrink to a constant fraction of the input.