0% found this document useful (0 votes)
35 views25 pages

20 Induction

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views25 pages

20 Induction

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

University of Hawaii

ICS141:
Discrete Mathematics for
Computer Science I
Dept. Information & Computer Sci., University of Hawaii

Jan Stelovsky
based on slides by Dr. Baek and Dr. Still
Originals by Dr. M. P. Frank and Dr. J.L. Gross
Provided by McGraw-Hill

ICS 141: Discrete Mathematics I – Fall 2011 13-1


University of Hawaii

Lecture 20
Chapter 4. Induction and Recursion
4.1 Mathematical Induction
4.2 Strong Induction

ICS 141: Discrete Mathematics I – Fall 2011 13-2


Mathematical Induction
University of Hawaii

n A powerful, rigorous technique for proving


that a statement P(n) is true for every positive
integers n, no matter how large.
n Essentially a “domino effect” principle.
n Based on a predicate-logic inference rule:

P(1)
“The First Principle
∀k≥1 [P(k)→P(k+1)] of Mathematical
Induction”
∴∀n≥1 P(n)

ICS 141: Discrete Mathematics I – Fall 2011 13-3


The “Domino Effect”
University of Hawaii

n Premise #1: Domino #1 falls.


n Premise #2: For every k∈Z+, if domino #k falls, then
so does domino #k+1.
n Conclusion: All of the dominoes fall down!

1 k k+1

1 2 3 4 5
Note: this works even if there are infinitely many dominoes!
ICS 141: Discrete Mathematics I – Fall 2011 13-4
Mathematical Induction Recap.
University of Hawaii

n PRINCIPLE OF MATHEMATICAL INDUCTION:


To prove that a statement P(n) is true for all
positive integers n, we complete two steps:

n BASIS STEP: Verify that P(1) is true

n INDUCTIVE STEP: Show that the conditional


statement P(k) → P(k+1) is true for all positive
integers k
Inductive Hypothesis

ICS 141: Discrete Mathematics I – Fall 2011 13-5


Validity of Induction
University of Hawaii

Proof: that ∀n≥1 P(n) is a valid consequent:


Given any k≥1, the 2nd premise
∀k≥1 (P(k) → P(k+1)) trivially implies that
(P(1)→P(2)) ∧ (P(2)→P(3)) ∧ … ∧ (P(n-1)→P(n)).
Repeatedly applying the hypothetical syllogism rule
to adjacent implications in this list n − 1 times then
gives us P(1) → P(n); which together with P(1)
(premise #1) and modus ponens gives us P(n).
Thus ∀n≥1 P(n). ■
ICS 141: Discrete Mathematics I – Fall 2011 13-6
Outline of an Inductive Proof
University of Hawaii

n Let us say we want to prove ∀n∈Z+ P(n).


n Do the base case (or basis step):

Prove P(1).
n Do the inductive step:

Prove ∀k∈Z+ P(k)→P(k+1).


n E.g. you could use a direct proof, as follows:

n Let k∈Z , assume P(k). (inductive hypothesis)


+

n Now, under this assumption, prove P(k+1).

n The inductive inference rule then gives us

∀n∈Z+ P(n).
ICS 141: Discrete Mathematics I – Fall 2011 13-7
Induction Example
University of Hawaii

n Show that, for n ≥ 1


n(n + 1)
1+ 2 ++ n =
2
n Proof by induction
n P(n): the sum of the first n positive integers is

n(n+1)/2, i.e. P(n) is


n Basis step: Let n = 1. The sum of the first

positive integer is 1, i.e. P(1) is true.


1(1 + 1)
1=
2
ICS 141: Discrete Mathematics I – Fall 2011 13-8
Example (cont.)
University of Hawaii

n Inductive step: Prove ∀k≥1: P(k)→P(k+1).


n Inductive Hypothesis, P(k):

k (k + 1)
1+ 2 ++ k =
2
n Let k≥1, assume P(k), and prove P(k+1), i.e.
(k + 1)[(k + 1) + 1]
1 + 2 +  + k + (k + 1) =
This is what 2
you have to
(k + 1)(k + 2)
prove =
2
ICS 141: Discrete Mathematics I – Fall 2011
P(k+1) 13-9
Example (cont.)
University of Hawaii

By inductive
n Inductive step continues… hypothesis P(k)

k (k + 1)
1 + 2 +  + k + (k + 1) = + (k + 1)
2
k (k + 1) 2(k + 1)
= +
2 2
k 2 + 3k + 2
=
P(k+1) 2
(k + 1)(k + 2)
=
2
n Therefore, by the principle of mathematical
induction P(n) is true for all integers n with n≥1
ICS 141: Discrete Mathematics I – Fall 2011 13-10
Induction Example 2
University of Hawaii

n Example 2: Conjecture a formula for the sum of


the first n positive odd integers. Then prove your
conjecture using mathematical induction.

n Practical Method for General Problem Solving.


Special Case: Deriving a Formula

Step 1. Calculate the result for some small cases


Step 2. Guess a formula to match all those cases
Step 3. Verify your guess in the general case

ICS 141: Discrete Mathematics I – Fall 2011 13-11


Example 2 (cont.)
University of Hawaii

n Step 1: Examine small cases


1 = 1 = 12
1 + 3 = 4 = 22
1 + 3 + 5 = 9 = 32
1 + 3 + 5 + 7 = 16 = 42
n Step 2: It sure looks like 1 + 3 + ··· + (2n–1) = n2
n Step 3: Try to prove this assertion by induction
n
2
∀n ≥ 1, ∑ (2i − 1) = n
i =1
ICS 141: Discrete Mathematics I – Fall 2011 13-12
Example Continues…
University of Hawaii

n Prove that the sum of the first n odd positive


integers is n2. That is, prove:
n
2
∀n ≥ 1, ∑ (2i − 1) = n
i =1

P(n)
n Proof by induction.
n Basis step: Let n = 1. The sum of the first

1 odd positive integer is 1 which equals 12.


i.e. P(1) is true.

ICS 141: Discrete Mathematics I – Fall 2011 13-13


Example Continues…
University of Hawaii

n Inductive step: Prove ∀k≥1: P(k)→P(k+1).


⎡ k 2 ⎤
n Inductive Hypothesis, P(k): ⎢∑ (2i − 1) = k ⎥
⎣ i =1 ⎦
n Let k≥1, assume P(k), and prove P(k+1).

k +1
⎛ k ⎞
∑ (2i − 1) = ⎜ ∑ (2i − 1) ⎟ + (2(k + 1) − 1)
i =1 ⎝ i =1 ⎠
2 By inductive
= k + (2k + 1) hypothesis P(k)
2
= (k + 1)
ICS 141: Discrete Mathematics I – Fall 2011 13-14
Induction Example 3
University of Hawaii

n Prove that ∀n ≥ 1, n < 2n. Let P(n) = (n < 2n)


n Basis step: P(1): (1 < 2 ) ≡ (1 < 2): True.
1

n Inductive step: For k ≥1, prove P(k)→P(k+1).

n Assuming k < 2 , prove k + 1 < 2


k k+1.

n Note k + 1 < 2 + 1 (by inductive hypothesis)


k

< 2k + 2k (because 1 < 2k for k ≥1)


= 2⋅2k = 2k+1
n So k + 1 < 2
k+1, i.e. P(k+1) is true

n Therefore, by the principle of mathematical


induction P(n) is true for all integers n with n ≥ 1.
ICS 141: Discrete Mathematics I – Fall 2011 13-15
Generalizing Induction
University of Hawaii

n Rule can also be used to prove ∀n≥c P(n)


for a given constant c∈Z, where maybe c ≠ 1.

n In this circumstance,
the basis step is to prove P(c) rather than P(1),
and the inductive step is to prove
∀k≥c (P(k)→P(k+1)).

ICS 141: Discrete Mathematics I – Fall 2011 13-16


Induction Example 4
University of Hawaii

n Example 6: Prove that 2n < n! for n ≥ 4 using


mathematical induction.
n P(n): 2n < n!
n Basis step: Show that P(4) is true
n Since 24 = 16 < 4! = 24, P(4) is true
n Inductive step: Show that P(k)→P(k+1) for k ≥ 4
n 2k+1 = 2·2k (by definition of exponent)
P(k+1) < 2·k! (by the inductive hypothesis P(k))
is true < (k + 1)·k! (because 2 < k+1 for k ≥ 4 )
= (k + 1)! (by definition of factorial function)
n Therefore, by the principle of mathematical
induction P(n) is true for all integers n with n ≥ 4.
ICS 141: Discrete Mathematics I – Fall 2011 13-17
Second Principle of Induction
University of Hawaii

a.k.a. “Strong Induction”


n Characterized by another inference rule:
P is true in all previous cases
P(1)
∀k≥1: (P(1) ∧ P(2) ∧ ··· ∧ P(k)) → P(k+1)
∴∀n≥1: P(n)
n The only difference between this and the 1st
principle is that:
n the inductive step here makes use of the

stronger hypothesis that all of P(1), P(2),…,


P(k) are true, not just P(k).
ICS 141: Discrete Mathematics I – Fall 2011 13-18
Example of Second Principle
University of Hawaii

n Show that every integer n >1 can be written as a


product n = p1p2…ps = ∏ pi of some series of s
prime numbers.
n Let P(n) = “n has that property ”
n Basis step: n = 2, let s = 1, p1 = 2. Then n = p1
n Inductive step: Let k≥2. Assume ∀2 ≤ i ≤ k: P(i).
n Consider k + 1. If it’s prime, let s = 1, p1 = k + 1.
n Else k + 1 = ab, where 1 < a ≤ k and 1 < b ≤ k.
Then a = p1p2…pt and b = q1q2…qu.
(by Inductive Hypothesis)
Then we have that k + 1 = p1p2…pt q1q2…qu,
a product of s = t + u primes.
ICS 141: Discrete Mathematics I – Fall 2011 13-19
Generalizing Strong Induction
University of Hawaii

n Handle cases where the inductive step is valid


only for integers greater than a particular integer
n P(n) is true for ∀n ≥ b (b: fixed integer)

n BASIS STEP: Verify that P(b), P(b+1),…, P(b+j)


are true (j: a fixed positive integer)

n INDUCTIVE STEP: Show that the conditional


statement [P(b) ∧ P(b+1 ) ∧ ··· ∧ P(k)] → P(k+1)
is true for all positive integers k ≥ b + j

ICS 141: Discrete Mathematics I – Fall 2011 13-20


Another 2nd Principle Example
University of Hawaii

n Prove that every amount of postage of 12 cents or


more can be formed using just 4-cent and 5-cent
stamps.
n P(n) = “postage of n cents can be formed using

4-cent and 5-cent stamps” for n ≥ 12.


n Basis step:

n 12 = 3⋅4

n 13 = 2⋅4 + 1⋅5

n 14 = 1⋅4 + 2⋅5

n 15 = 3⋅5

n So ∀12 ≤ i ≤ 15, P(i).

ICS 141: Discrete Mathematics I – Fall 2011 13-21


Example (cont.)
University of Hawaii

n Inductive step:
n Let k ≥15, assume ∀12 ≤ i ≤ k, P(i).

n Note 12 ≤ k - 3 ≤ k, so P(k - 3).

(by inductive hypothesis)


This means we can form postage of k – 3 cents
using just 4-cent and 5-cent stamps.
n Add a 4-cent stamp to get postage for k + 1,

i.e. P(k + 1) is true (postage of k + 1 cents


can be formed using 4-cent and 5-cent stamps).
n Therefore, by the 2nd principle of mathematical
induction P(n) is true for all integers n with n ≥ 12.
ICS 141: Discrete Mathematics I – Fall 2011 13-22
Another 2nd Principle Example
University of Hawaii

n Prove by the 1st Principle.


n P(n) = “postage of n cents can be formed using
4-cent and 5-cent stamps”, n ≥ 12.
n Basis step: P(12): 12 = 3⋅4.
n Inductive step: P(k) → P(k+1)
n Case 1: At least one 4-cent stamp was used

for P(k)
n k + 1 = k – 4 + 5 (i.e. replace the 4-cent

stamp with a 5-cent stamp to form a


postage of k + 1 cents)

ICS 141: Discrete Mathematics I – Fall 2011 13-23


Example Continues…
University of Hawaii

n Inductive step: P(k) → P(k+1)


n Case 2: No 4-cent stamps were used for P(k)

n Since k ≥12, at least three 5-cent stamps are

needed to form postage of k cents


n k + 1 = k – 3⋅5 + 4⋅4 (i.e. replace three 5-cent

stamps with four 4-cent stamps to form a


postage of k + 1 cents)

n Therefore, by the principle of mathematical


induction P(n) is true for all integers n with n ≥ 12.

ICS 141: Discrete Mathematics I – Fall 2011 13-24


The Well-Ordering Property
University of Hawaii

n Another way to prove the validity of the


inductive inference rule is by using the well-
ordering property, which says that:
n Every non-empty set of non-negative
integers has a minimum (smallest) element.
n ∀∅⊂S⊆N: ∃m∈S such that ∀n∈S, m ≤ n
n This implies that {n|¬P(n)} (if non-empty) has a
minimum element m, but then the assumption
that P(m−1)→P((m−1)+1) would be
contradicted.
ICS 141: Discrete Mathematics I – Fall 2011 13-25

You might also like