Chapter 5. Induction and Recursion
Chapter 5. Induction and Recursion
Contents
1. Mathematical Induction
Contents
1. Mathematical Induction
2. Recursive Definitions
Contents
1. Mathematical Induction
2. Recursive Definitions
3. Recursive Algorithms
Introduction
Examples.
n(n + 1)
1. Prove that 1 + 2 + 3 + .... + n − 1 + n =
2
Examples.
n(n + 1)
1. Prove that 1 + 2 + 3 + .... + n − 1 + n =
2
2. Conjecture a formula for the sum of the first n positive
odd integers. Then prove your conjecture using
mathematical induction.
Examples.
n(n + 1)
1. Prove that 1 + 2 + 3 + .... + n − 1 + n =
2
2. Conjecture a formula for the sum of the first n positive
odd integers. Then prove your conjecture using
mathematical induction.
3. 20 + 21 + .... + 2n = 2n+1 − 1
Strong Induction
Strong Induction
Strong Induction
Strong Induction
Introduction
Fibonacci numbers:
Introduction
Fibonacci numbers:
n 1 2 3 4 5 6 7
Fn 1 1 2 3 5 8 13
Introduction
Fibonacci numbers:
n 1 2 3 4 5 6 7
Fn 1 1 2 3 5 8 13
1. Find F8 .
Introduction
Fibonacci numbers:
n 1 2 3 4 5 6 7
Fn 1 1 2 3 5 8 13
1. Find F8 .
2. Find F20
Introduction
Fibonacci numbers:
n 1 2 3 4 5 6 7
Fn 1 1 2 3 5 8 13
1. Find F8 .
2. Find F20
Introduction
Fibonacci numbers:
n 1 2 3 4 5 6 7
Fn 1 1 2 3 5 8 13
1. Find F8 .
2. Find F20 if F18 = 2584, F19 = 4181.
Introduction
Fibonacci numbers:
n 1 2 3 4 5 6 7
Fn 1 1 2 3 5 8 13
1. Find F8 .
2. Find F20 if F18 = 2584, F19 = 4181.
Ingeneral, F1 = F2 = 1, Fn = Fn−1 + Fn−2 , n ≥ 3
Introduction
Introduction
Example.
Example.
Example.
Example.
Example.
Example.
Exercises
1. an = 5n − 2, n = 1, 2, 3...?
Exercises
1. an = 5n − 2, n = 1, 2, 3...?
2. an = n, n = 1, 2, 3...
Exercises
1. an = 5n − 2, n = 1, 2, 3...?
2. an = n, n = 1, 2, 3...
3. f (n) = 1 + 2 + 3 + ... + n, n = 1, 2, 3, ...
Exercises
1. an = 5n − 2, n = 1, 2, 3...?
2. an = n, n = 1, 2, 3...
3. f (n) = 1 + 2 + 3 + ... + n, n = 1, 2, 3, ...
4. f (n) = 2022, ∀n
Exercises
1. an = 5n − 2, n = 1, 2, 3...?
2. an = n, n = 1, 2, 3...
3. f (n) = 1 + 2 + 3 + ... + n, n = 1, 2, 3, ...
4. f (n) = 2022, ∀n
5. .
Exercises
1. an = 5n − 2, n = 1, 2, 3...?
2. an = n, n = 1, 2, 3...
3. f (n) = 1 + 2 + 3 + ... + n, n = 1, 2, 3, ...
4. f (n) = 2022, ∀n
5. .
Exercises
1. an = 5n − 2, n = 1, 2, 3...?
2. an = n, n = 1, 2, 3...
3. f (n) = 1 + 2 + 3 + ... + n, n = 1, 2, 3, ...
4. f (n) = 2022, ∀n
5. .
Examples.
Examples.
Examples.
Examples.
Find S if
a. 1 is in S, if x is in S then x + 1 and x + 2 are in S,
Examples.
Find S if
a. 1 is in S, if x is in S then x + 1 and x + 2 are in S,
b. 1 is in S, if x is in S then x + 3 is in S,
Examples.
Find S if
a. 1 is in S, if x is in S then x + 1 and x + 2 are in S,
b. 1 is in S, if x is in S then x + 3 is in S,
c. 1, 2 are in S, if x is in S then x + 3 is in S.
Examples.
Examples.
Examples.
Definition
Definition
Definition
Definition
Definition
Definition
Definition
Mathematical Induction
Mathematical Induction
Mathematical Induction
Strong Induction
Strong Induction
Recursive Algorithms
Recursive Algorithms
Recursive Algorithms