Mathematical Induction - Gordon College · Mathematical induction is used to prove that each of...
Transcript of Mathematical Induction - Gordon College · Mathematical induction is used to prove that each of...
Mathematical Induction
MAT231
Transition to Higher Mathematics
Fall 2014
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 1 / 21
Outline
1 Mathematical Induction
2 Strong Mathematical Induction
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 2 / 21
Motivation
How many multiplications will carried out by the following code fragment?
c = 0
for i in range (10):
for j in range (5):
c = c + a[i] * b[j]
outer-loop body executed 10 times
inner-loop body executed 5 times for each outer-loop execution
one multiplication per each inner-loop body execution
The number of multiplications can be computed as
10 · 5 = 50 multiplications.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 3 / 21
Motivation
How many multiplications will carried out by the following code fragment?
c = 0
for i in range (10):
for j in range (5):
c = c + a[i] * b[j]
outer-loop body executed 10 times
inner-loop body executed 5 times for each outer-loop execution
one multiplication per each inner-loop body execution
The number of multiplications can be computed as
10 · 5 = 50 multiplications.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 3 / 21
Motivation
How many multiplications will carried out by the following code fragment?
c = 0
for i in range (10):
for j in range (5):
c = c + a[i] * b[j]
outer-loop body executed 10 times
inner-loop body executed 5 times for each outer-loop execution
one multiplication per each inner-loop body execution
The number of multiplications can be computed as
10 · 5 = 50 multiplications.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 3 / 21
Motivation
Now consider this slightly different code fragment. How manymultiplications are done?
c = 0
for i in range (10):
for j in range(i):
c = c + a[i] * b[j]
outer-loop body executed 10 times
inner-loop body executed a different number of times for eachouter-loop execution
one multiplication per each inner-loop body execution
This time the number of multiplications can be computed with a sum:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55 multiplications
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 4 / 21
Motivation
Now consider this slightly different code fragment. How manymultiplications are done?
c = 0
for i in range (10):
for j in range(i):
c = c + a[i] * b[j]
outer-loop body executed 10 times
inner-loop body executed a different number of times for eachouter-loop execution
one multiplication per each inner-loop body execution
This time the number of multiplications can be computed with a sum:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55 multiplications
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 4 / 21
Motivation
Now consider this slightly different code fragment. How manymultiplications are done?
c = 0
for i in range (10):
for j in range(i):
c = c + a[i] * b[j]
outer-loop body executed 10 times
inner-loop body executed a different number of times for eachouter-loop execution
one multiplication per each inner-loop body execution
This time the number of multiplications can be computed with a sum:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55 multiplications
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 4 / 21
Motivation
Finally, suppose we wanted to generalize this. Assuming n is providedthrough some user input, our code fragment might be
c = 0
for i in range(n):
for j in range(i):
c = c + a[i] * b[j]
Some experimentation might lead us to suspect that we can count themultiplications with
1 + 2 + 3 + · · ·+ n =n(n + 1)
2
This works for all the cases we try, but how can we know it works for alln > 0?
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 5 / 21
Mathematical Induction
This sort of problem is solved using mathematical induction. Some keypoints:
Mathematical induction is used to prove that each of list ofstatements is true.
Often this list is countably infinite (i.e. indexed by the naturalnumbers).
It consists of two parts: (1) a basis step and (2) an inductive step.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 6 / 21
Mathematical Induction
Here is a list of statements corresponding to the sum we are interested in.
S1: 1 = (1)(1 + 1)/2
S2: 1 + 2 = (2)(2 + 1)/2
S3: 1 + 2 + 3 = (3)(3 + 1)/2
.
.
Sn−1: 1 + 2 + 3 + · · ·+ (n − 1) = (n − 1)((n − 1) + 1)/2
Sn: 1 + 2 + 3 + · · ·+ (n − 1) + n = (n)(n + 1)/2
Notice that the list is finite as it contains n statements. However, provingall these are true for any positive integer n means that we have proved aninfinite number of statements.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 7 / 21
Mathematical Induction
As suggested in our text, using mathematical induction is a bit like settingup cascading dominos:
We begin by proving S1 is true. This is the basis step.
We next show that Sk ⇒ Sk+1 for k ≥ 1. This is the inductive step.
We now know that S1 ⇒ S2. But as soon as S2 is known to be truewe can say S2 ⇒ S3. But then
S3 ⇒ S4,
S4 ⇒ S5,
S5 ⇒ S6,
.
.
.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 8 / 21
Mathematical Induction Proof
Proposition
1 + 2 + · · ·+ n =n(n + 1)
2for any n ∈ N.
Proof.
We prove this by mathematical induction.
(Basis Step) When n = 1 we find
1 =1(1 + 1)
2=
2
2= 1
so the statement is true when n = 1.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 9 / 21
Mathematical Induction Proof
Proof.
(Continued)
(Inductive Step) We now want to show that if
1 + 2 + · · ·+ k =k(k + 1)
2
for some k ∈ N then
1 + 2 + · · ·+ k + (k + 1) =(k + 1)((k + 1) + 1)
2=
(k + 1)(k + 2)
2.
(Note: Stating this does not prove anything, but is very helpful. It forcesus to explicitly write what we are going to prove, so both we (as prover)and the reader know what to look for in the remainder of the inductivestep.)
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 10 / 21
Mathematical Induction Proof
Proof.
(Continued) Suppose 1 + 2 + · · ·+ k =k(k + 1)
2for some k ∈ N. Then
1 + 2 + · · ·+ k =k(k + 1)
2
1 + 2 + · · ·+ k + (k + 1) =k(k + 1)
2+ (k + 1)
1 + 2 + · · ·+ k + (k + 1) =k(k + 1)
2+
2(k + 1)
2
1 + 2 + · · ·+ k + (k + 1) =k(k + 1) + 2(k + 1)
2
1 + 2 + · · ·+ k + (k + 1) =(k + 1)(k + 2)
2
It follows by induction that 1 + 2 + · · ·+ n =n(n + 1)
2for all n ∈ N.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 11 / 21
Mathematical Induction Logic
Notice that mathematical induction is an application of Modus Ponens:
(S1) ∧ (∀k ∈ N, (Sk ⇒ Sk+1))⇒ (∀n ∈ N,Sn)
Some notes:
The actual indexing scheme used is unimportant. For example, wecould start with S0, S2, or even S−1 rather than S1. The key is thatwe start with a specific statement, and then prove that any onestatements implies the next.
To prove something about statements indexed by the integers, theinductive step would include two parts
Sk ⇒ Sk+1 and Sk ⇒ Sk−1.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 12 / 21
Example 2
Proposition
Show that 3|(n3 − n) whenever n is a positive integer.
Proof.
We use mathematical induction. When n = 1 we find n3 − n = 1− 1 = 0and 3|0 so the statement is proved for n = 1.
Now we need to show that if 3|(k3 − k) for some integer k > 0 then3|((k + 1)3 − (k + 1)).
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 13 / 21
Example 2
Proof.
(Continued) Suppose that 3|(k3 − k). Then (k3 − k) = 3a for someinteger a. Then, starting with (k + 1)3 − (k + 1), we find
(k + 1)3 − (k + 1) = k3 + 3k2 + 3k + 1− k − 1
= (k3 − k) + 3k2 + 3k
= 3a + 3k2 + 3k
= 3(a + k2 + k).
By the closure properties of integers we know that a + k2 + k is an integerso we see that (k + 1)3 − (k + 1) is a multiple of 3. Then, by definition,3|((k + 1)3 − (k + 1)).
It follows by induction that 3|(n3 − n) for all integers n > 0.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 14 / 21
Strong Mathematical Induction
Sometimes it is helpful to use a slightly different inductive step. Inparticular, it may be difficult or impossible to show Sk ⇒ Sk+1 but easier(or possible) to show that
(S1 ∧ S2 ∧ · · · ∧ Sk)⇒ Sk+1.
In other words, assume that all statements from S1 to Sk have beenproved and use some combination of them to prove Sk+1.
This is called strong mathematical induction.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 15 / 21
Strong Mathematical Induction Example
Proposition
Any integer n > 11 can be written in the form n = 4a + 5b for a, b ∈ Z.
Proof.
We use mathematical induction. We note that
S12 : 12 = 4(3) + 5(0)
S13 : 13 = 4(2) + 5(1)
S14 : 14 = 4(1) + 5(2)
S15 : 15 = 4(0) + 5(3)
which shows that 12, 13, 14, and 15 can all be written in the form4a + 5b.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 16 / 21
Strong Mathematical Induction Example
Proof.
(Continued) Now, suppose that Sk−3,Sk−2,Sk−1, and Sk have all beenproved. This means that Sk−3 is true, so we know that k − 3 = 4a + 5bfor some integers a and b. Adding 4 to both sides we have
k − 3 + 4 = 4a + 5b + 4
k + 1 = 4(a + 1) + 5b
so Sk+1 must be true. This means that
S12 ⇒ S16, S13 ⇒ S17, S14 ⇒ S18, S15 ⇒ S19, S16 ⇒ S20, . . . ,
completing the induction.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 17 / 21
Another Mathematical Induction Example
Proposition
9|(10n − 1) for all integers n ≥ 0.
Proof.
(By induction on n.) When n = 0 we find 10n − 1 = 100 − 1 = 0 and since9|0 we see the statement holds for n = 0. Now suppose the statementholds for all values of n up to some integer k ; we need to show it holds fork + 1. Since 9|(10k − 1) we know that 10k − 1 = 9x for some x ∈ Z.Multiplying both sides by 10 gives
10 · (10k − 1) = 10 · 9x
10k+1 − 10 = 9 · 10x
10k+1 − 1 = 9 · 10x + 9
= 9 · (10x + 1)
which clearly shows that 9|(10k+1 − 1). This completes the induction.MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 18 / 21
Proof by Smallest Counterexample
As already noted, mathematical induction is well suited for statements ofthe form ∀n ∈ N,P(n).
1 Our text introduces an approach called proof by smallestcounterexample and illustrates it with a problem similar to the one wejust completed.
2 Basic idea is to assume the inductive hypothesis holds for all values ofn up to some particular value k but that it fails for k + 1 and thenshow that this leads to a contradiction.
3 While that does work for the proof we just completed, a direct proofof the inductive hypothesis like the one shown is more straightforward.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 19 / 21
Fibonacci Numbers
The Fibonacci sequence is defined as the sequence starting with F1 = 1and F2 = 1, and then recursively as Fn = Fn−1 + Fn−2.
The Fibonacci sequence starts off with 1, 1, 2, 3, 5, 8, 13, 21, 34, . . . .
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 20 / 21
Fibonacci Numbers
Proposition
Prove that F1 + F2 + F3 + · · ·+ Fn = Fn+2 − 1 for n ≥ 2.
Proof.
We use induction. As our basis step, notice that F1 + F2 = F4 − 1 since
F1 + F2 = 1 + 1 = 2, and F4 − 1 = 3− 1 = 2.
Suppose that F1 + F2 + · · ·+ Fk = Fk+2 − 1. Adding Fk+1 on both sidesgives
F1 + F2 + · · ·+ Fk + Fk+1 = Fk+2 − 1 + Fk+1
= Fk+1 + Fk+2 − 1
= Fk+3 − 1.
which completes the induction.
MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 21 / 21