Upload
marli
View
24
Download
0
Embed Size (px)
DESCRIPTION
Mathematical Induction. Section 4.1. Example. Consider the predicate P ( n ): ``1 + 3 + ··· + (2 n -1) is equal n 2 ’’ Let ’ s verify the truth value of P ( n ) for some n : P ( 1 ): 1 (1) is equal 1 2 P ( 2 ): 1 + 3 (4) is equal 2 2 - PowerPoint PPT Presentation
Citation preview
1
Mathematical Induction
Section 4.1
2
Example
Consider the predicate P(n): ``1 + 3 + ··· + (2n-1) is equal n2’’
Let’s verify the truth value of P(n) for some n:
P(1): 1 (1) is equal 12
P(2): 1 + 3 (4) is equal 22
P(3): 1 + 3 + 5 (9) is equal 32
.... P(9): 1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 is
equal 92 …Let us write “is equal” by the symbol =.
Thus, 1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 = 92
3
Example… (no calculators!)
Suppose, without verifying, that P(21): 1 + 3 + 5 + … + 39 + 41= 212
Given above, can we prove that P(22): 1 + 3 + 5 + … + 39 + 41 + 43 = 222 ?
P(22): 1 + 3 + 5 + … + 39 + 41 + 43 = 222 ? P(22) : 212 (by P(21)) +43= 222
P(22) : 212 + 43 = 222 ? P(22): (22 – 1)2 + (22×2 – 1) = 222 ? P(22): 222 – 22×2 + 1 + 22×2 – 1 = 222 ✔
4
Example (no calculators!)
How general is our methods? Let’s replace 21 with a place holder k. Suppose, without verifying, that
P(k) = 1 + 3 + 5 + … + (2k-1)= k2 Given this, can we prove that
P(k+1) = 1 + 3 + 5 + … + (2(k+1)-1)= (k+1)2 ?
P(k+1) = 1 + 3 + 5 + … + (2k-1) + (2(k+1)-1) = (k+1)2 ?
P(k+1) = k2 (by P(k)) + (2(k+1)-1) = (k+1)2 ?
P(k+1) = k2 + (2(k+1)-1) = (k+1)2 ? P(k+1) = ((k+1) – 1)2 + (2(k+1)-1) = (k+1)2 ? P(k+1) = (k+1)2 – 2(k+1) + 1 + 2(k+1) – 1 = (k+1)2 ✔
5
Example…
What have we accomplished so far? We have shown that P(k) ⇒ P(k+1), for any k. For instance:
P(1) ⇒ P(2), P(2) ⇒ P(3), … P(6) ⇒ P(7), … P(19) ⇒ P(20), … P(2000) ⇒ P(2001), ….
Note that, we do NOT know if, for example, P(6) or P(19) … is true. All we know is that IF, for example, P(6) is true, then P(7) is also true.
What do we need to show that P(n) is true for all n? All we need is to PROVE that P(1) is indeed true.
6
Mathematical Induction Let P(n) be some propositional function
involving integer n. P(n) = “n (n+3) is an even number ” P(n) = “1 + 3 + ··· + (2n-1) = n2 ” …..
To prove that P(n) is true for all positive integers n, we can do the following:
Give a proof (usually a straight verification) that P(1) is true.
Give a proof that for an arbitrary k, IF P(k) is true THEN P(k + 1) is true. That is, we validate the logical implication: P(k) ⇒ P(k+1)
Mathematical Induction Mathematical induction amounts to the
following rule of inference: [P(1) k ((k ≥ 1) P(k)) P(k +1))] ⇒ n P(n)where our universe is the set of positive integers
A proof using mathematical induction involves: The Basis: prove P(1) is true. The Hypothesis: Assume P(k) is true for an arbitrary k
≥ 1. The Induction Step: Establish that P(k +1)A (direct) proof that ((k ≥ 1) P(k)) ⇒ P(k
+1)
8
Mathematical Induction…. In proof by mathematical induction it is
not given that P(k) is true for all positive integers! It is only shown that IF P(k) is true, THEN P(k+1) is also true. Otherwise the proof by mathematical induction was a case of begging the question or circular reasoning.
9
Example Let P(n) = “1 + 3 + ··· + (2n-1) = n2 ”.
We want to prove by induction that P(n) is true for all n.
Basis: Prove that when n =1, the proposition is correct. P(1) is “1= 12”; thus, it is correct.
Hypothesis: We will assume that P(k) is true for some arbitrary k.
Step: Using the hypothesis, we want to prove that P(k +1) is true.
10
Example
2 2 2 2
1
Prove by induction that
( 1)(2 1)1 2
6
n
i
n n ni n
11
Example
2 2 2 2
1
12 2
1
2
1
2 2 2
Basis
Hypot
( 1)(2 1)Prove that 1 2
6
Proof by induction:
1(1 1)(2 1 1): 1 1
6
( 1)(2 1): Assumhesis
St
e true for 6
( 1)(2 1): By the Hypothesis weep have 1 2
n
i
i
k
i
n n ni n
i
k k ki
k k kk
22 2 2 2 2
2
. Now,6
( 1)(2 1) ( 1)(2 1) 6( 1)1 2 ( 1) ( 1)
6 6
( 1)[ (2 1) 6( 1)] ( 1)[2 7 6] ( 1)[( 2)(2 3)]
6 6 6( 1)(( 1) 1)(2( 1) 1)
6
k k k k k k kk k k
k k k k k k k k k k
k k k
Induction can start anywhere To show P(n) for any n ≥ b :
The Basis: prove P(b) is true. The Hypothesis: Assume P(k) is true and k ≥
b. The Induction Step: Establish that P(k +1)
A (direct) proof that ((k ≥ b) P(k)) ⇒ P(k +1)
13
Example Suppose we have coins of two different
denominations, namely, 3 cents and 5 cents. We want to show that it is possible to pay exactly for any purchase of 8 cents or higher. In other words, that we can make up 8, 9, 10, …. cents using just these coins.
Here is a proof by induction: Basis: 8 = 3+5 ✓ Hypothesis: Suppose we can pay exactly
with just 3-cent coins and 5-cent coins for a purchase amount of k cents.
14
Example Want to show that it is we can pay exact
for (k + 1) cents using just 3-cent coins and 5-cent coins.
Proof: If in making up k cents, we used at least one 5- cent coin, then replace that coin with two 3-cent coins to make up (k + 1) cents. Otherwise, we must have used at least three 3-cent coins to make up k since we are considering k > 8. In the case, we will replace three 3-cent coins with two 5-cent coins to make up (k + 1) cents.
15
Strong induction
To prove that P(k+1) holds, we may use any of the following assumptions:
P(k) is true P(k – 1) is true P(k – 2) is true …. P(1) is true
We must make sure that all the “assumptions” are in fact true for the induction “engine” to start.
16
Induction, recap
Let P(n) be some propositional function about an integer n. To prove that P(n) is true for all positive integers n, we do the following:
Give a proof that P(1) is true Give a proof that if all of P(1), P(2), …, P(k)
are true and k ≥ 1 then P(k+1) is also true. As before, the induction can start at any
integer b: Give a proof that P(b) is true Give a proof that if all of P(b), P(b+1), …, P(k)
are true and k ≥ b then P(k+1) is also true.
17
Example Show that any positive integer n > 1 is
either a prime or a product of primes. Proof:
Basis: n = 2. Since 2 is prime.✓ Hypothesis: Assume true for n ≤ k Step: Need to show that, given the hypothesis,
the proposition is true for k +1. Proof: If n = k +1 is a prime, then the proposition is
true. If k +1 is not prime, then k +1=pq, where p ≤ k and q ≤ k. By the hypothesis, p and q are either primes or product of primes, and thus so is pq.
18
Example Show that for every nonnegative integer
n20+ 21 + 22 + 23 + ∙∙∙ + 2n = 2n+1 –
1. Let P(n) be the corresponding predicate Basis: P(0) is true since 20 =1= 21-1. Hypothesis: Assume that P(k) is true and
that k ≥ 0.
Step: Need to show that P(k +1) is true given that the hypothesis is true.
19
Example
P(k+1) = 20+21+22+23+ ∙∙∙ +2k + 2k+1 = 2k+1 –1 + 2k+1 by the induction
hypothesis = 2k+2 –1 by arithmetic = 2(k+1)+1 –1 by arithmeticThus P(k) ⇒ P(k +1)
20
Example
3Show that 2 for all 10.n n n
21
Example
3
10 3
3
1 3
3 3 31 3
Show that 2 for all 10.
: For 10, we have 2 1024 10 1000.
: Assume 2 up to some
: Need to show th
Basis
H
at
y
2 ( 1)
1 1 12 2 2 1 2 1 2 1
1
pothe
tep
0
sis
S
n
k
k
k k k k
n n
n
k k
k
kk k
3( 1)k
Hypothesis is used here
22
Proof of Correctness of Mathematical Induction
We want to show that [P(1) k ((k ≥ 1) P(k)) P(k +1))] ⇒ n P(n) where the universe is the positive integers
Proof is done by contradiction1.¬ n P(n) Contrary assumption2. x ¬ P(x) 1, Demogan’s3.¬ P(r) 2, EI, select smallest r4.P(r -1) 3, choice of r5.P(1) Premise6.r > 1 r is positive (by choice in 4) & 57. k ((k ≥ 1) P(k)) P(k +1)) Premise8. ((r-1 ≥ 1) P(r-1)) P(r) UI, k = r-19.P(r) 4, 6 & 8, modus ponens10.Contradiction 3 & 9
23
Example
2
The Harmonic numbers for each are defined as follows:
1 1 1 1
1 2 3
Prove by induction that 12
n
j
j
H j
Hj
nH
24
Example
0
2
12
2
The Harmonic numbers for eahc are defines as follows:
1 1 1 1
1 2 3
Prove by induction that 12
1 0: 1Basis
Hypothesis
1 11 2
: Assume 1 for up to some .2
: Need to showSte thatp
n
k
j
j
H j
Hj
nH
H H
kH k
1
1
2
12
12
1
1
1 1
21 1 1 1 1 1 1
1 2 3 2 2 1 2 2 21 1 1
2 1 2 2 2
1 1 1 1 using hypothesis
2 2 1 2 2 2
2 1 1 1 1 1
2 2 2 2 2
k
k
k
k k k k
k k k
k k k
k
k
kH
H
H
k
k k k
25
Proof:
1
1
2 2
12
12
1
1
1Showing that 1 1
2 21 1 1 1 1 1 1
1 2 3 2 2 1 2 2 21 1 1
2 1 2 2 2
1 1 1 1
2 2 1 2 2 2
2 1 1 1 1 1
2 2 2 2 2
k k
k
k
k k k k
k k k
k k k
k
k
k kH H
H
H
k
k k k
26
Example Prove by induction that if S is a finite set with n
elements then S has 2n subsets. Basis: Assume n = 0. There is one set with cardinality zero:
the empty set. Thus, S = . The empty set has only one subset: itself. Moreover, 20 = 1. Thus the basis is verified.
Hypothesis. Assume true for any set S with cardinality 1,2,…, k
Step. Want to show that if S has cardinality k+1, the proposition still holds. Let S be such a set. Let r be an arbitrary element of S. Write S = X ⋃ {r }. Now, the subsets of S either contain r or they don’t. For the ones that do not contain r , those are also subsets of X, and there are 2k of them. To form the ones that do contain r, we take each subset of X and inset r in it. That would give us another 2k subsets. Thus, S has a total of 2k+1 subsets.
27
“Induction” and “Mathematical Inductions”
Let P(n) denote the number of different ways to write n as a sum of positive integers when order is not important. For instance, integer 5 can be written in the following 7 ways:1+1+1+1+1=2+1+1+1=2+2+1=3+1+1=3+2=4+1=5
Verify that: P(2) = 2 P(3) = 3 P(4) = 5 P(5) = 7 P(6) = ? P(7) …..
28
What’s wrong with the following proof?
0
" : Let be any positive number.
For all nonnegative integers we have 1."
: If 0, we have 1.
: Assume the theorem is true for 0,1, 2, ...,
: We need to sho
Basis
Hypothesis
Step w
Cla
th
i
m
at
n
n
n a
n a a
n
a
k
1
11
the theorem holds for +1.
That is, we want to show that 1 1
"Proof:"
1 1 1
1
k k
k kk
k
n k
a a
a aa
a