![Page 1: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/1.jpg)
Induction and Recursion
CMPS/MATH 2170: Discrete Mathematics
![Page 2: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/2.jpg)
Outline
• Mathematical induction (5.1)
• Sequences and Summations (2.4)
• Strong induction (5.2)
• Recursive definitions (5.3)
• Recurrence Relations (8.1)
![Page 3: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/3.jpg)
Principle of Mathematical Induction
• Want to know if we can reach every step on a infinite ladder
• Suppose we know two things
• We can reach the first rung of the ladder
• If we can reach a particular rung of the ladder, then we can reach the next rung
• Can we conclude that we can reach every rung?
![Page 4: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/4.jpg)
Mathematical Induction
• Want to show: ∀" ∈ ℤ%: ' "
Proof by induction on "• Base case: verify that '(1) is true
• Inductive step: show that ' + → ' + + 1 for any + ∈ ℤ%
Inductive hypothesis: Assume '(+) is true
Want to prove ' + + 1 is true
![Page 5: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/5.jpg)
Examples
Ex. 1: Prove that 3 divides !" − ! for any ! ∈ ℤ&' !
![Page 6: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/6.jpg)
Mathematical Induction
• Want to show: ∀" ∈ ℤ%: ' "
• Proof by induction on "• Base case: verify that '(1) is true
• Inductive step: show that ' + → ' + + 1 for any + ∈ ℤ%
Inductive hypothesis: Assume '(+) is true
Want to prove ' + + 1 is true
for " = /, / + 1, / + 2,… , where / ∈ ℤ
'(/)
+ ∈ ℤ 3"4 + ≥ /
![Page 7: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/7.jpg)
Examples
Ex. 1: Prove that 3 divides !" − ! for any ! ∈ ℤ&
Ex. 2: Prove !' < 2* for all integers ! > 4
Ex. 3: Prove that a finite set with ! elements has 2* subsets
Ex. 4: Prove that every amount of postage of 12 cents or more can be formed using just 4-cent and 5-cent stamps.
![Page 8: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/8.jpg)
More about Mathematical Induction
• Why Mathematical Induction is valid?
• Implied by the Weak Ordering Property:
“Every nonempty subset of ℤ" has a least element”
• Pros• Can be used to prove a wide variety of “forall” conjectures• Easy to follow
• Cons• Cannot be used to find new theorems• Lack of insight
#(1)∀( ∈ ℤ": # ( → # ( + 1∀- ∈ ℤ": # -∴
![Page 9: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/9.jpg)
Outline
• Mathematical induction (5.1)
• Sequences and Summations (2.4)
• Strong induction (5.2)
• Recursive definitions (5.3)
• Recurrence Relations (8.1)
![Page 10: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/10.jpg)
Sequences
• Informally, a sequence is an ordered list of objects
• List all positive even integers: 2, 4, 6, 8, 10, …
• We can describe the sequence as !" " ∈ℤ% where !" = 2(
• Formally, a sequence is a function with domain ℤ) or ℕ:
• the above sequene can be defined by
+: ℤ) → ℤ)( ⟼ 2(
![Page 11: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/11.jpg)
Arithmetic Progression
• Consider a sequence: 1, 4, 7, 10, 13, 16, 19…
• We can represent it as !" = 1 +3 ⋅ (, ( ≥ 0
• An arithmetic progression is a sequence !" "∈ℕ with !" = . +/ ⋅ (, for ., / ∈ ℝ!1 = .,!2 = . + /,!3 = . + 2/,…
5: ℕ → ℝ( ⟼ . + /(
![Page 12: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/12.jpg)
Geometric Progression
• Consider a sequence: 3, 6, 12, 24, 48, 96, …
• We can represent it as !" = 3 ⋅ 2", ( ≥ 0
• A geometric progression is a sequence !" "∈ℕ with !" = - ⋅ .", for -, . ∈ ℝ!0 = -,!1 = -.,!2 = -.2,…
3: ℕ → ℝ( ⟼ -."
![Page 13: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/13.jpg)
Summations
For a sequence !" , we write
#"$%
&!" = !% + !%)* +⋯+ !&
#"$*
&!" = !* + !, +⋯+ !&
![Page 14: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/14.jpg)
Summations
Ex.1: Sums of Arithmetic Progressions
Ex.2: Sums of Geometric Progressions
∀" ∈ ℕ: &'()
*+ = "(" + 1)
2
∀" ∈ ℕ: &'()
*2' = 2*34 − 1
2 − 1 where 2 ≠ 1
Proof by Mathematical Induction
![Page 15: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/15.jpg)
Summations
!"#$
%&2"
!"#$
%&2" = !
)#&
$2)*$
Index substitution: + = , − 5
!"#&
%&2" −!
"#&
/2"=
= 32 ×!)#&
$2)
![Page 16: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/16.jpg)
Outline
• Mathematical induction (5.1)
• Sequences and Summations (2.4)
• Strong induction (5.2)
• Recursive definitions (5.3)
• Recurrence Relations (8.1)
![Page 17: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/17.jpg)
Strong Induction
• Want to prove: ∀" ∈ ℤ%: ' "
Proof by (weak) induction on ":
• Base case: verify that '(1) is true
• Inductive step: show that ' + → ' + + 1 for any + ∈ ℤ%
Proof by strong induction on ":
• Base case: verify that '(1) is true
• Inductive step: show that [' 1 ∧ ' 2 ∧ …∧ ' + ] → ' + + 1 for any + ∈ ℤ%
![Page 18: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/18.jpg)
Strong Induction
• A more general form of strong induction
• Want to prove: ! " for " = $, $ + 1, $ + 2,… , where $ ∈ ℤ
• Base step: verify that ! $ , ! $ + 1 ,…!($ + -) are true
• Inductive step: Assume [! $ ∧ ! $ + 1 ∧ …∧ ! 1 ] is true, prove ! 1 + 1 is true for every integer 1 ≥ $ + -
![Page 19: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/19.jpg)
Examples of Strong Induction
Fibonacci Sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, …
!" = 0, !& = 1,!( = !()& + !()+, , ≥ 2
This is called a recursive definition
Ex.1: !( ≤ 2( for all , ≥ 0
Ex. 2: !( > 1()+ for any , ≥ 3 where 1 = (1 + 5)/2
Fibonacci Spiral
Initial conditions
Recurrence relation
Fibonacci Tiling
≈ 1.618(golden ratio)
![Page 20: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/20.jpg)
Outline
• Mathematical induction (5.1)
• Sequences and Summations (2.4)
• Strong induction (5.2)
• Recursive definitions (5.3)
• Recurrence Relations (8.1)
![Page 21: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/21.jpg)
Recursively Defined Sequences
• Fibonacci Sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, …
!" = 0, !& = 1,!( = !()& + !()+, , ≥ 2
• A sequence of powers of 2: 1, 2, 4, 8, 16, 32…An explicit formula: 4( = 2(, , ≥ 0A recursive definition:
4" = 2",4( = 24()&, , ≥ 1
Recurrence relation
Recurrence relation
Initial conditions
Initial condition
![Page 22: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/22.jpg)
Recursively Defined Functions
• A recursive definition of !:ℕ → ℝ, ℕ = {0,1,2, 3… }• Base step: specify ! 0• Recursive step: specify ! 5 in terms of ! 0 , ! 1 ,… , !(5 − 1), for any 5 ≥ 1
• Ex.1: Give a recursive definition of ! 5 = 5!
• Ex.2: Give a recursive definition of ! 5 = ∑<=>? @<, where @< <∈ℕ is a given sequence
![Page 23: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/23.jpg)
Recursively Defined Sets
• Consider a set ! ⊆ ℤ$ recursively defined by
• Base step: 3 ∈ !• Recursive step: if ' ∈ ! and ( ∈ !, then ' + ( ∈ !
• ! is the set of all positive integers divided by 3
![Page 24: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/24.jpg)
Outline
• Mathematical induction (5.1)
• Sequences and Summations (2.4)
• Strong induction (5.2)
• Recursive definitions (5.3)
• Recurrence Relations (8.1)
![Page 25: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/25.jpg)
The Tower of Hanoi
Task: Move the stack of disks from peg 1 to peg 3 subject to the following rules:
• Move one disk at a time• Only the uppermost disk on a stack can be moved• No disk can be placed on top of a smaller disk
Question: how many steps are needed?
![Page 26: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/26.jpg)
The Tower of Hanoi
By André Karwath aka Aka - Own work, CC BY-SA 2.5,https://commons.wikimedia.org/w/index.php?curid=85401
![Page 27: induction and resursion - School of Science & Engineeringzzheng3/teaching/cmps2170/fall18/slides/induction.pdfPrinciple of Mathematical Induction •Want to know if we can reach every](https://reader034.vdocument.in/reader034/viewer/2022042205/5ea7af7379555e0e58241ca2/html5/thumbnails/27.jpg)
The Tower of Hanoi
• !" - number of moves needed to solve the Tower of Hanoi with # disks
• Divide & Conquer!$ = 1!" =
• How to find an explicit formula for !"?• Expand the recurrence iteratively and then make
a conjecture: !" = 2" − 1• 264 − 1 seconds ≈ 585 billion years
• Proof by mathematical induction
# − 1 disks
!"/$
!"/$
1 move
Recurrence relationInitial condition
2!"/$ + 1, # ≥ 2