Induction

CSE 311: Foundations of Computing
announcements
Fall 2013
Lecture 14: Mathematical Induction
Reading assignment
Induction
5.1-5.2, 7th edition
4.1-4.2, 6th edition
mathematical induction
Method for proving statements about all integers
≥ 0.
– Part of sound logical inference that applies only in
the domain of integers
Not like scientific induction which is more like a guess
from examples
– Particularly useful for reasoning about programs
since the statement might be “after n times
through this loop, property P(n) holds”
finding a pattern
•
•
•
•
•
•
20 − 1 = 1 − 1 = 0 = 3 ⋅ 0
22 − 1 = 4 − 1 = 3 = 3 ⋅ 1
24 − 1 = 16 − 1 = 15 = 3 ⋅ 5
26 − 1 = 64 − 1 = 63 = 3 ⋅ 21
28 − 1 = 256 − 1 = 255 = 3 ⋅ 85
…
how do you prove it?
Want to prove 3 ∣ 2
induction as a rule of Inference
− 1 for all integers
≥0
Domain: integers ≥ 0
(0)
∀ ( ( ) → ( + 1))
– =0
– =1
– =2
– =3
– ⋯
∴∀ ( )
using the induction rule in a formal proof
(0)
∀ ( ( ) → ( + 1))
∴∀ ( )
1. Prove P(0)
2. Let k be an arbitrary integer ≥ 0
3. Assume that P(k) is true
4. ...
5. Prove P(k+1) is true
6. P(k) → P(k+1)
Direct Proof Rule
7. ∀ k (P(k) → P(k+1))
Intro ∀ from 2-6
8. ∀ n P(n)
Induction Rule 1&7
using the induction rule in a formal proof
(0)
∀ ( ( ) → ( + 1))
∴∀ ( )
Base Case
1. Prove P(0)
Inductive
2. Let k be an arbitrary integer ≥ 0
Hypothesis
3. Assume that P(k) is true
4. ...
Inductive
5. Prove P(k+1) is true
Step
6. P(k) → P(k+1)
Direct Proof Rule
7. ∀ k (P(k) → P(k+1))
Intro ∀ from 2-6
8. ∀ n P(n)
Induction Rule 1&7
Conclusion
5 steps to inductive proofs in english
Proof:
1. “By induction we will show that P(n) is true for every
n≥0.”
2. “Base Case:” Prove P(0)
3. “Inductive Hypothesis:”
Assume P(k) is true for some arbitrary integer k ≥ 0”
4. “Inductive Step:” Want to prove that P(k+1) is true:
Use the goal to figure out what you need.
Make sure you are using I.H. and point out where
you are using it. (Don’t assume P(k+1) !!)
5. “Conclusion: Result follows by induction”
3∣2
− 1 for all ≥ 0.
induction example
Want to prove 3 ∣ 2
− 1 for all ≥ 0.
geometric sum
1 + 2 + 4 + ⋯ + 2 = 2
– 1for all ≥ 0
1 + 2 + 4 + ⋯ + 2 = 2
– 1for all ≥ 0
sum of first
For all
For all n ≥ 1: 1 + 2 + ⋯ +
=∑
=
numbers
≥ 1: 1 + 2 + ⋯ +
=
+1
2
=
harmonic numbers
1 1 1
1
#$ = 1 + + + + ⋯ + =
2 3 4
%
Prove that #
&
≥ 1 + for all
$
≥ 1.
1
Prove that #
&
≥ 1 + for all
≥ 1.
checkerboard tiling
Prove that a 2n × 2n checkerboard with one
square removed can be tiled with:
strong induction
0
∀ 0 ∧
1 ∧
strong induction english proofs
2 ∧ ⋯∧
→
∴∀ ( )
Follows from ordinary induction applied to
(
= 0 ∧ 1 ∧ 2 ∧ ⋯ ∧ ( )
+1
1. By induction we will show that ( )is true for
every ≥ 0
2. Base Case: Prove (0)
3. Inductive Hypothesis:
Assume that for some arbitrary integer ≥ 0,
(,) is true for every , from 0 to
4. Inductive Step:
Prove that ( + 1)is true using the Inductive
Hypothesis (that (,) is true for all values ≤ )
5. Conclusion: Result follows by induction
every integer ≥ 2 is the product of primes
every integer ≥ 2 is the product of primes
recursive definitions of functions
fibonacci numbers
• -(0) = 0; -( + 1) = -( ) + 1for all ≥ 0
• /(0) = 1; /( + 1) = 2 ∙ /( )for all
• 0! = 1;( + 1)! = ( + 1) ∙ !for all
• #(0) = 1; #( + 1) = 22
≥0
≥0
for all ≥0
34 = 0
3 =1
3 =3
5
+3
5
for all
≥2
bounding the fibonacci numbers
&
Theorem: 2 6 5 ≤ 3 < 2 for all
≥ 2.
Theorem: 2
/ 5
≤ 3 < 2 for all
≥ 2.