Mathematical Induction Reading: EC 2.3 Peter J. Haas INFO 150 - - PowerPoint PPT Presentation

mathematical induction
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Mathematical Induction

Reading: EC 2.3 Peter J. Haas INFO 150 Fall Semester 2019

Lecture 8 1/ 16
slide-2
SLIDE 2

Mathematical Induction Overview First Examples Sentences About the Positive Integers Formal Mathematical Induction Examples Strong versus Weak Induction

Lecture 8 2/ 16
slide-3
SLIDE 3

Overview

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/ 16
slide-4
SLIDE 4

Overview

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

Example

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/ 16
slide-5
SLIDE 5

Induction 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/ 16
slide-6
SLIDE 6

A First Inductive Proof

Proposition The sequence defined recursively by a1 = 1 and ak = ak−1 + (2k − 1) has closed form an = n2. Proof:
  • 1. Check every row in the table up through m − 1
  • 2. For the mth row, am = am−1 + (2m − 1)
  • 3. Since we have checked row m − 1, we know that am−1 = (m − 1)2
  • 4. Substitute and solve:
am = am−1 + (2m − 1) = (m − 1)2 + (2m − 1) = m2 − 2m + 1 + 2m − 1 = m2, and so row m of the table checks out.
  • 5. We therefore know that, repeating this procedure, every row will check out
Lecture 8 5/ 16

" "

slide-7
SLIDE 7

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 +
  • 2 · (m − 1) − 1
  • (m − 1)2
(m − 1)2 yes m am = am−1 +
  • 2 · m − 1
  • ???
Example: given row n = 29, check row n = 30 n Formula for an Value of an n2 Is an = n2? 29 a29 = a28 +
  • 2 · 29 − 1
  • 292
292 yes a30 = a29 + (2 · 30 − 1) = 292 + (2 · 30 − 1) = 841 + 59 = 900 = 302 X Lecture 8 6/ 16 mr mr yes r A from previous slide
slide-8
SLIDE 8

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= am
  • it
2M = Lm
  • 1)
m th m =

dm

  • it
th ) m = many ,)

slide-9
SLIDE 9

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 .
  • t
343+35595433=630 3521=630 Yes i
  • I

!

I C Hht
  • tm
  • 1)
t M
  • Lm
  • 21Mt
m = C m
  • DMTLM
  • 2
= m ( ( m
  • 1)
th ) = MLMTD

  • I
2 2 Do this as an exercise
slide-10
SLIDE 10

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

EH
  • T
, EGO )
  • T
GCL ) = T , 6130 ) I f 5121--11-2=2 ) ✓ 5130) = It
  • t 30=465
=3
slide-11
SLIDE 11

Sentences, 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 If

there

are ma , students in the class , the room will be too

small

sense E. . ie SC D= if,

it T=

I Scs ) = It #

  • SC
3) = I , i 2 = it 245=14 e

3641

son
  • D= Ii it
. Hit . . . tem
  • is
' ¥t¥ = ul ) 6 6
slide-12
SLIDE 12

Sentences, 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 , a

15,93=19

Ru ) : 91=4
  • It
7=11 V Rh ) : AE 4.247=15

Rls ) :

93=4.31-7--19

Acm

  • D
: am , =

4.

cm
  • Dtt
= 4Mt 3
slide-13
SLIDE 13

The Principle of Mathematical Induction

The Principle of Mathematical Induction Let P(n) be a statement about the positive integers. If one can prove that
  • i. P(1) is true; and
  • ii. for every integer m ≥ 2, whenever P(1), P(2), . . . , P(m − 1) are all true, it
follows that P(m) is true, then P(n) is true for every positive integer n. Example: Prove that Pn i=1 i = n(n+1) 2 for every positive integer n
  • 1. Let P(n) = “Pn
i=1 i = n(n+1) 2
  • 2. P(1) states that 1 = 1(1+1)
2 , which is clearly true
  • 3. Let m ≥ 2 and suppose that P(1), P(2), . . . , P(m − 1) are true
  • 4. Consider P(m):
m X i=1 i = 1 + 2 + · · · + m = (1 + 2 + · · · + (m − 1)) + m = (m − 1)m 2 + m since S(m − 1) is true = (m − 1)m + 2m 2 = m
  • (m − 1) + 2
  • 2
= m(m + 1) 2 .
  • 5. Thus P(m) is true, completing the induction
Lecture 8 12/ 16 " Bus

?

case
slide-14
SLIDE 14

Examples

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
  • i. PhD
: !

?,

=

j 's

20=1--2

'
  • I

z . Let m 32 and suppose

that

Pll ) , . . . , Plm
  • 1)
are all true 3. poms : Iii "
  • !
hi
  • '
t I
  • '
= in ' '
  • it
In
  • '
a 2. I
  • '
. I so

result

follows by

induction

= am
  • I
  • V
p C n ) : ' ' an ' n ' " i. Pll ) :

get

a . Let miss

and suppose that put ,

. . . , Plm
  • D
are all true 3. Plm ) : am
  • - d.my#2m-l=Lm-D2f2m
  • I
since PL 'm
  • 1)
is assumed true = mh
  • Hmt
) t

4M

  • I
so that am . ; K
  • T
s m2 ✓
slide-15
SLIDE 15

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
  • fit D=
2

2 . Let me 2 and assume PCI ) , . . . , Pcm
  • D
are true 3 . Plm) : am = mcm xD what we

want to show

Ams

am , t Lm = ( m
  • 1) km
.

Dti

) t

am since Plm
  • ' I

÷÷÷÷

:

slide-16
SLIDE 16

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:
  • 1. Base case: P(1) holds trivially (a puppy is the same color as itself)
  • 2. Assume that P(1), P(2), . . . , P(m − 1) all hold for some m > 1
  • 3. Inductive argument for P(m), i.e. for a set of m puppies:
3.1 Remove one puppy (say, Whiskers), leaving m − 1 puppies 3.2 By induction, the m − 1 puppies have the same color (say, white), since P(m − 1) holds 3.3 Pick one of those puppies (say, Bella), who must be white 3.4 Remove Bella and add back Whiskers, leaving m − 1 puppies 3.5 Since P(m − 1) is assumed to hold, all of the puppies are the same color, so Whiskers is white also 3.6 Hence all of the puppies are white, and hence are the same color Lecture 8 15/ 16 Line , for some M 32 ) argument must hold for all m 32 ,

but

f-

argument

fails

for man , i.e . , for Pls )
slide-17
SLIDE 17

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