Mathematical Induction
Reading: EC 2.3 Peter J. Haas INFO 150 Fall Semester 2019
Lecture 8 1/ 16
Mathematical Induction Reading: EC 2.3 Peter J. Haas INFO 150 - - PowerPoint PPT Presentation
Mathematical Induction Reading: EC 2.3 Peter J. Haas INFO 150 Fall Semester 2019 Lecture 8 1/ 16 Mathematical Induction Overview First Examples Sentences About the Positive Integers Formal Mathematical Induction Examples Strong versus
Mathematical Induction
Reading: EC 2.3 Peter J. Haas INFO 150 Fall Semester 2019
Lecture 8 1/ 16Mathematical Induction Overview First Examples Sentences About the Positive Integers Formal Mathematical Induction Examples Strong versus Weak Induction
Lecture 8 2/ 16Overview
What is induction?
I Ordinary usage: infer the future based on the past(”the sun will rise tomorrow”)
I Mathematical induction: prove the truth of the next integer,from the past
I Exploit fact that recurrence relations are often relatively simple I The perfect tool for attacking complexity Lecture 8 3/ 16Overview
What is induction?
I Ordinary usage: infer the future based on the past(”the sun will rise tomorrow”)
I Mathematical induction: prove the truth of the next integer,from the past
I Exploit fact that recurrence relations are often relatively simple I The perfect tool for attacking complexityExample
I 1 + 2 + · · · + 100 = 5,050 I 1 + 2 + · · · + 100 + 101 =? I Since first answer is correct:1 + 2 + · · · + 100 + 101 = (1 + 2 + · · · + 100) + 101 = (5,050) + 101 = 5,151
Lecture 8 3/ 16Induction as a Game
Example I ak = ak−1 + (2k − 1) with a1 = 1 I Try some values: a1 = 1, a2 = 4, a3 = 9, a4 = 16, a5 = 25 I It looks like an = n2, but can you prove this? I Try a Big Honking Table: n Formula for an Value of an n2 Is an = n2? 1 a1 = 1 1 1 yes 2 a2 = a1 + (2 · 2 − 1) 1 + 3 = 4 4 yes . . . . . . . . . . . . . . . 49 a49 = a48 + (2 · 49 − 1) 2304 + 97 = 2401 2401 yes 50 a50 = a49 + (2 · 50 − 1) 2401 + 99 = 2500 2500 yes Look at the last row: a50 = a49 + (2 · 50 − 1) = 492 + (2 · 50 − 1) Generalize: am = (m − 1)2 + (2 · m − 1) Lecture 8 4/ 16A First Inductive Proof
Proposition The sequence defined recursively by a1 = 1 and ak = ak−1 + (2k − 1) has closed form an = n2. Proof:" "
Example, Continued
A tabular view of the general case n Formula for an Value of an n2 Is an = n2? 1 a1 = 1 1 1 yes 2 a2 = a1 + (2 · 2 − 1) 1 + 3 = 4 4 yes 3 a3 = a2 + (2 · 3 − 1) 4 + 5 = 9 9 yes . . . . . . . . . . . . . . . m − 1 am−1 = am−2 +Another Example
Recursive sequence: an = an−1 + 2 · n with a1 = 2 Proposed closed form: an = n(n + 1) Tabular setup n Formula for an Value of an n(n + 1) Is an = n(n + 1)? 1 a1 = 2 2 1 · 2 yes 2 a2 = a1 + 2 · 2 2 + 4 = 6 2 · 3 yes . . . . . . . . . . . . . . . m − 1 am−1 = am−2 + 2 · (m − 1) (m − 1)m (m − 1)m yes m am = am−1 + 2 · m ? m(m + 1) ??? Check row m: Lecture 8 7/ 16 Yes am= amdm
✓
Closed Formulas for Sums
Claim: Pn i=1 i = 1 + 2 + · · · + n = n(n+1) 2 n Pn i=1 i or 1 + 2 + · · · + n Simplified sum n(n+1) 2 sum = n(n+1) 2 ? 1 P1 i=1 i = 1 1 1·2 2 = 1 Yes 2 P2 i=1 i = 1 + 2 1 + 2 = 3 2·3 2 = 3 Yes 3 P3 i=1 i = (1 + 2) + 3 3 + 4 = 6 3·4 2 = 6 Yes 4 P4 i=1 i = (1 + 2 + 3) + 4 6 + 4 = 10 4·5 2 = 10 Yes . . . . . . . . . . . . . . . 34 P34 i=1 i = (1 + 2 + · · · + 33) + 34 561 + 34 = 595 34·35 2 = 595 Yes 35 . . . . . . . . . . . . . . . m − 1 Pm−1 i=1 i = 1 + 2 = · · · + (m − 1) (m−1)m 2 (m−1)m 2 Yes m Pm i=1 i = 1 + 2 = · · · + m ??? m(m+1) 2 ??? Check row m: Check row 146: Lecture 8 8/ 16 "Ei
I ( it Lt .,¥
!
I C Hht✓
Sentences About the Positive Integers
Definition A statement about the positive integers is a predicate P(n) with the set of positive integers as its domain. Example: Which are statements about the positive integers? I n2 + n is even I 100 − n I 100 − n > 83 I John has fewer than n apples in his refrigerator Example: For each predicate, write the sentence when n = 2 and n = 30 and determine whether it is true or false I E(n) is the statement “n2 + n is even” I G(n) is the statement “100 − n > 83” I S(n) is the statement “1 + 2 + · · · + n = n(n+1) 2 ” Lecture 8 9/ 16 x I✓
EHSentences, Continued
Example I P(n) is “If there are n students in the class, the room will be too small” I What is P(35)? I What is P(m − 1)? Example I S(n) is “1 + 4 + 9 + · · · + n2 = n(n+1)(2n+1) 6 ” I Rewrite using Σ notation I Write S(1), S(2), and S(3) and determine if true or false I Write S(m − 1) and simplify it Lecture 8 10/ 16 If there are 35 students in the class , the room will be too small Ifthere
are ma , students in the class , the room will be toosmall
sense E. . ie SC D= if,it T=
I ✓ Scs ) = It #2¥
✓3641
✓ sonSentences, Continued
Example I Define sequence by a1 = 11 and ak = ak−1 + 4 I R(n) is “an = 4n + 7” I Write R(1), R(2), and R(3) and determine if true or false I Write R(m − 1) and simplify it Lecture 8 11/ 16 9=11 , a15,93=19
Ru ) : 91=4✓
Rls ) :93=4.31-7--19
✓Acm
4.
cmThe Principle of Mathematical Induction
The Principle of Mathematical Induction Let P(n) be a statement about the positive integers. If one can prove that?
→ caseExamples
Example 1: Prove P(n) = “Pn i=1 2i−1 = 2n − 1” Example 2: Given a1 = 1 and ak = ak−1 + (2k − 1) for k ≥ 2, prove that an = n2 for all n ≥ 1 Lecture 8 13/ 16?,
=✓
z . Let m 32 and supposethat
Pll ) , . . . , Plmfollows by
induction
= amget
✓ a . Let missand suppose that put ,
. . . , Plm4M
Exercise
Given a1 = 2 and ak = ak−1 + 2k for k ≥ 2, prove that an = n(n + 1) for all n ≥ 1 Lecture 8 14/ 16 PCh ) i ane n Curti ) I . P LD : go I✓
2 . Let me 2 and assume PCI ) , . . . , Pcmwant to show
Ams
am , t Lm = ( mDti
) t
am since Plm÷÷÷÷
:
All Puppies are the Same Color
Puppy Theorem Let P(n) be the predicate that any set of n puppies are all the same color. Then P(n) holds for n ≥ 1. Inductive Proof:but
f-argument
fails
for man , i.e . , for Pls )Strong versus Weak Induction
Strong induction: Assume that P(1), P(2), . . . , P(m − 1) have been checked when proving P(m) Weak induction: Assume only that P(m − 1) has been checked when proving P(m) (as in examples so far) Both argument structures are equally valid We will use strong induction throughout I Consistent with intuition about checking rows of a table I Sometimes P(m − 1) isn’t enough Lecture 8 16/ 16