Mathematical Induction & Recursion
The principle of mathematical induction (basis step, inductive step, inductive hypothesis), four fully worked proofs, the well-ordering property, and recursively defined sequences and functions (factorial, powers, sums, Fibonacci).
▶Lecture videos
Click any timestamp — here or inside the notes — to jump the video to that moment. Your position is remembered.
Lesson 7 – Induction & Recursion
Proof by induction and recursive definitions.
00:00Lesson 7: induction and recursion00:50Mathematical induction: basis step and inductive step02:58Example: 1 + 2 + … + n = n(n + 1)/206:44Example: sum of the first n odd numbers = n²09:25Proving n < 2ⁿ13:00Proving n³ − n is divisible by 315:43The well-ordering property18:33Self-assessment: sum of squares22:22Exercise 3: sum of odd squares24:17Recursive definitions26:10aₙ = 3ⁿ defined recursively27:10Recursively defined functions: f(n + 1) = 2f(n) + 331:07Factorial defined recursively33:48aⁿ and Σ defined recursively36:31Fibonacci numbers1Why induction?
Many statements claim a property holds for all positive integers n. For example:
- 1 + 2 + … + n = n(n + 1)/2
- n³ − n is divisible by 3
- 4ⁿ⁺¹ > (n + 2)²
You can't check infinitely many cases one by one. Mathematical induction proves them all at once.
To prove P(n) for all positive integers n:
- Basis step: verify that P(1) is true.
- Inductive step: show that P(k) → P(k + 1) is true for all positive integers k.
In the inductive step you assume P(k) is true for an arbitrary k. This assumption is the inductive hypothesis. Then you show that P(k + 1) also holds.
Why it works:
- P(1) is true (basis step).
- P(1) ⇒ P(2), so P(2) is true.
- P(2) ⇒ P(3), so P(3) is true.
- … and so on, so P(n) is true for every n.
The domino picture
Line up infinitely many dominoes, numbered 1, 2, 3, …. Let P(n) = "domino n falls".
- Basis: you knock over domino 1, so P(1) is true.
- Inductive step: whenever domino k falls, it knocks over domino k + 1, so P(k) → P(k + 1).
Therefore every domino falls.
2Worked induction proofs
Let P(n): "the sum of the first n positive integers is n(n + 1)/2".
Basis step: 1 = 1·(1 + 1)/2, so P(1) is true.
Inductive step: - Assume P(k): 1 + 2 + ⋯ + k = k(k + 1)/2. (This is the inductive hypothesis.) - We must show P(k + 1): 1 + 2 + ⋯ + k + (k + 1) = (k + 1)(k + 2)/2. - Add (k + 1) to both sides of P(k):
1 + 2 + ⋯ + k + (k + 1) = k(k + 1)/2 + (k + 1) = [k(k + 1) + 2(k + 1)]/2 = (k + 1)(k + 2)/2 ✓
So P(k + 1) holds. By induction, P(n) is true for all positive integers n. ∎
Let P(n): "the sum of the first n odd integers is n²".
Basis step: 1 = 1², so P(1) is true.
Inductive step: - Assume 1 + 3 + ⋯ + (2k − 1) = k². - Show the sum up to (2k + 1) equals (k + 1)². - Add (2k + 1), the next odd number, to both sides:
1 + 3 + ⋯ + (2k − 1) + (2k + 1) = k² + 2k + 1 = (k + 1)² ✓ ∎
Basis step: 1 < 2¹ = 2, so P(1) is true.
Inductive step: - Assume k < 2ᵏ. - Show k + 1 < 2ᵏ⁺¹. - Add 1 to both sides of the hypothesis, and use 1 ≤ 2ᵏ:
k + 1 < 2ᵏ + 1 ≤ 2ᵏ + 2ᵏ = 2·2ᵏ = 2ᵏ⁺¹ ✓ ∎
Basis step: 1³ − 1 = 0, and 3 | 0, so P(1) is true.
Inductive step: - Assume 3 | (k³ − k). - Show 3 | ((k + 1)³ − (k + 1)). - Expand and regroup:
(k + 1)³ − (k + 1) = (k³ + 3k² + 3k + 1) − (k + 1) = (k³ − k) + 3(k² + k)
The first bracket is divisible by 3 (by the hypothesis). The second is 3 times an integer. So their sum is divisible by 3 ✓ ∎
- Define P(n) clearly.
- Basis: substitute n = 1 (or the given start value) and check both sides.
- Write the hypothesis P(k) and the target P(k + 1) explicitly.
- Start from P(k + 1), find P(k) inside it, and use the hypothesis. For sums, peel off the last term. For divisibility, regroup into "hypothesis part + multiple of m".
- Conclude: "by the principle of mathematical induction, P(n) holds for all n."
3The well-ordering property
Every non-empty set of non-negative integers has a least element. For each such set A there is some a ∈ A with a ≤ x for all x ∈ A.
The well-ordering principle is equivalent to the principle of mathematical induction.
- A = {3, 11, 5, 9, 2, 8, 16, 21} has least element 2.
- A = {n ∈ ℕ : n > 7} is infinite, but it still has a least element: 8.
4Recursion
Sometimes it's hard to define an object explicitly, but easy to define it in terms of itself. This is recursion. It can define sequences, functions and sets.
Recursively defined sequence
- Basis step: give the initial term a₀.
- Recursive step: give a rule for each term in terms of the preceding term(s).
Recursively defined function (domain = non-negative integers)
- Basis step: give the value at zero.
- Recursive step: give a rule for the value at an integer from its values at smaller integers.
The explicit formula is aₙ = 3ⁿ. Recursively: a₀ = 1, aₙ₊₁ = 3aₙ for n = 0, 1, 2, …
- f(1) = 2·3 + 3 = 9
- f(2) = 2·9 + 3 = 21
- f(3) = 2·21 + 3 = 45
- f(4) = 2·45 + 3 = 93
Since (n + 1)! = (n + 1)·n!:
- F(0) = 1
- F(n + 1) = (n + 1)·F(n)
- a⁰ = 1
- aⁿ⁺¹ = a·aⁿ
- Basis: Σk=00 aₖ = a₀
- Recursive: Σk=0n+1 aₖ = (Σk=0n aₖ) + aₙ₊₁
- f₀ = 0, f₁ = 1
- fₙ = fₙ₋₁ + fₙ₋₂ for n = 2, 3, 4, …
Working forward: - f₂ = 1 + 0 = 1 - f₃ = 1 + 1 = 2 - f₄ = 2 + 1 = 3 - f₅ = 3 + 2 = 5 - f₆ = 5 + 3 = 8
It needs two initial values because each term uses the two before it.
Recursively defined functions are well defined: the value at every positive integer is determined unambiguously. This follows from the principle of mathematical induction.
Expect:
- A full induction proof (sum formula, inequality or divisibility). Marks go to: clearly defining P(n), the basis step, stating the inductive hypothesis, the inductive step, and the conclusion.
- "State the well-ordering property and find the least element of a set."
- "Give a recursive definition of aₙ = 6n / 2n + 1 / 5 / 4n − 2", e.g. 6n: a₁ = 6, aₙ₊₁ = aₙ + 6.
- "Find f(1)…f(5) given a recursive rule."
5Quick revision sheet
| Concept | Remember it as |
|---|---|
| Induction | Basis P(1) + inductive step P(k) → P(k + 1) |
| Inductive hypothesis | Assume P(k) for arbitrary k |
| Domino | First falls + each knocks the next = all fall |
| Sum proofs | Add the next term to both sides of P(k) |
| Divisibility proofs | Regroup into (hypothesis part) + m·(integer) |
| Inequality proofs | Add to both sides, then bound (1 ≤ 2ᵏ) |
| Well-ordering | Every non-empty set of non-negative integers has a least element; equivalent to induction |
| Recursive definition | Basis (initial value) + recursive rule |
| Factorial | F(0) = 1, F(n+1) = (n+1)F(n) |
| Powers | a⁰ = 1, aⁿ⁺¹ = a·aⁿ |
| Fibonacci | f₀ = 0, f₁ = 1, fₙ = fₙ₋₁ + fₙ₋₂ → 0, 1, 1, 2, 3, 5, 8 |
| f(0)=3, f(n+1)=2f(n)+3 | 9, 21, 45, 93 |
?Self-check quiz
12 questions on this week. Answer them all, then press Check my answers. Your best and latest scores are saved and shown on the subject page.