Math Induction & Recursive Definitions in Discrete Math (CS 2233 Lecture 16), Assignments of Discrete Mathematics

A lecture note from cs 2233 discrete mathematical structures course, focusing on mathematical induction and recursive definitions. It covers the concept of mathematical induction, its validity, and the difference between mathematical and strong induction. Additionally, it discusses examples of induction proofs and recursive definitions, including factorials, exponentiation, and fibonacci numbers.

Typology: Assignments

Pre 2010

Uploaded on 07/30/2009

koofers-user-wni-1
koofers-user-wni-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Discrete Mathematical Structures
CS 2233 Lecture Sixteen
Prof. William Winsborough
March 19, 2009
19 March 2009 Winsborough CS 2233 Lecture 16 2
Business
Homework 7
4.1: 4, 6
4.2: 4
Read sections 4.1, 4.2 and 4.3
Midterm II is in two weeks on 4/2
19 March 2009 Winsborough CS 2233 Lecture 16 3
Mathematical Induction
How can we show that a proposition P(n) holds
for all natural numbers n ∈N?
Proof technique called
mathematical induction:
Basis: show P(0)
Inductive Step: show that for all k ∈ N,
P(k) → P(k+1)
The proposition P(k) is called the
induction
hypothesis
(P(0) ∧ ∀k ∈ N.(P(k) → P(k+1))) → ∀n ∈ N.P(n)
19 March 2009 Winsborough CS 2233 Lecture 16 4
Example of Induction
Theorem: P(n) Σ2i= 2n+1 –1
Proof by induction
Basis: P( 0) Σ2i= 20+1 –1 ≡2
0= 2-1, which clearly
holds
Step: We assume P(k) ≡ Σ2i= 2k+1 –1
and show P(k+1) ≡ Σ2i= 2k+2 1 as follows:
Σ2i= Σ2i+ 2k+1
= (2k+1 –1) + 2
k+1 by the induction hypothesis
= 2·2k+1 –1
= 2k+2 –1
0 i n
0 i 0
0 i k
0 i k+1
0 i k+1 0 i k
19 March 2009 Winsborough CS 2233 Lecture 16 5
Validity of Induction
Induction is valid because the natural numbers
are well founded
Definit ion: A set is well ordered if each of its subsets
has a least element
Once basis and step are shown, the assumption
that the property fails for some values yields a
contradiction
Assume for contradiction that
P(0) ∧ ∀k(P(k) → P(k+1)) ∧ ¬∀nP(n)
Consider the least m ∈ N such that ¬P(m)
Case 1: if m = 0, the contradiction is immediate
Case 2: if m = k+1 for some k ∈ N, then by minimality of m
P(k) holds. But this, together with the step, implies that
P(k+1) ≡ P(m) holds, giving us the desired contradiction
19 March 2009 Winsborough CS 2233 Lecture 16 6
Strong Induction
To show ∀n∈N (P(n)), the following is
sufficient:
Basis: show P(0)
Inductive Step: show that for all k ∈ N,
[P(0) ∧…∧ P(k)] → P(k+1)
This gives us a stronger induction
hypothesis to use in the step
It is valid for similar reasons to those
shown on the previous slide
pf2

Partial preview of the text

Download Math Induction & Recursive Definitions in Discrete Math (CS 2233 Lecture 16) and more Assignments Discrete Mathematics in PDF only on Docsity!

Discrete Mathematical Structures

CS 2233 Lecture Sixteen

Prof. William Winsborough

March 19, 2009

19 March 2009 Winsborough CS 2233 Lecture 16 2

Business

• Homework 7

• Read sections 4.1, 4.2 and 4.

• Midterm II is in two weeks on 4/

19 March 2009 Winsborough CS 2233 Lecture 16 3

Mathematical Induction

• How can we show that a proposition P(n) holds

for all natural numbers n ∈ N?

• Proof technique calledmathematical induction:

– Basis: show P(0)

– Inductive Step: show that for all k ∈ N,

P(k) → P(k+1)

• The proposition P(k) is called theinduction

hypothesis

• (P(0) ∧ ∀k ∈ N.(P(k) → P(k+1))) → ∀n ∈ N.P(n)

19 March 2009 Winsborough CS 2233 Lecture 16 4

Example of Induction

• Theorem: P(n) ≡ Σ 2 i^ = 2n+1^ – 1

• Proof by induction

– Basis: P(0) ≡ Σ 2 i^ = 20+1^ – 1 ≡ 2^0 = 2-1, which clearly

holds

– Step: We assume P(k) ≡ Σ 2 i^ = 2k+1^ – 1

and show P(k+1) ≡ Σ 2 i^ = 2k+2^ – 1 as follows:

Σ 2 i^ = Σ 2 i^ + 2k+

= (2k+1^ – 1) + 2k+1^ by the induction hypothesis

= 2· 2 k+1^ – 1

= 2k+2^ – 1

0 ≤ i ≤ n

0 ≤ i ≤ 0

0 ≤ i ≤ k 0 ≤ i ≤ k+ 0 ≤ i ≤ k+1 0 ≤ i ≤ k

19 March 2009 Winsborough CS 2233 Lecture 16 5

Validity of Induction

• Induction is valid because the natural numbers

are well founded

– Definition: A set is well ordered if each of its subsets

has a least element

• Once basis and step are shown, the assumption

that the property fails for some values yields a

contradiction

– Assume for contradiction that

P(0) ∧ ∀k(P(k) → P(k+1)) ∧ ¬∀nP(n)

– Consider the least m ∈ N such that ¬P(m)

  • Case 1: if m = 0, the contradiction is immediate
  • Case 2: if m = k+1 for some k ∈ N, then by minimality of m

P(k) holds. But this, together with the step, implies that

P(k+1) ≡ P(m) holds, giving us the desired contradiction

19 March 2009 Winsborough CS 2233 Lecture 16 6

Strong Induction

• To show ∀n∈N (P(n)), the following is

sufficient:

– Basis: show P(0)

– Inductive Step: show that for all k ∈ N,

[P(0) ∧…∧ P(k)] → P(k+1)

• This gives us a stronger induction

hypothesis to use in the step

• It is valid for similar reasons to those

shown on the previous slide

19 March 2009 Winsborough CS 2233 Lecture 16 7

Example Proof by Strong Induction

• Match game:

– Two players take turns removing any positive

number of matches they wish from either of

two piles

– The player that removes the last match wins

• (Continued on next slide)

19 March 2009 Winsborough CS 2233 Lecture 16 8

Example Proof by Strong Induction

• Assuming the two piles are initially the same

size, the player that goes second can always win

– Let P(n) be the proposition that the second player can

win assuming n is the number of matches in both

piles at the start

– Basis: P(1). First player must remove one match from

one pile, enabling the second player to win by

removing the match from the other pile

– Inductive step: ∀k([P(0) ∧…∧ P(k)] → P(k+1)). The

second player removes the same number, r, of

matches as did the first, but from the other pile. This

leaves both piles having k+1-r matches. The

induction hypothesis now guarantees the second

player can win

19 March 2009 Winsborough CS 2233 Lecture 16 9

Recursive Definition (Sec. 4.3)

• A recursive definition (also called an

inductive definition ) of a function f over N

is given by specifying the value of the

function in each of two cases:

– The base case: f(0) is defined; more generally

f(i) may be defined for all i less or equal to

some k ∈ N

– The recursive case: f(n+1) is defined in terms

of f(n), f(n-1), …, f(0)

• Observe that f is a sequence

19 March 2009 Winsborough CS 2233 Lecture 16 10

Examples

• Factorial F(n) = n!

– F(0) = 1

– F(n+1) = (n+1) F(n)

– Defines the sequence {0!, 1!, 2!, …}

• Exponentiation

– a^0 = 1

– an+1^ = a·an

• Σ: Sum of first n elements of a sequence {ak}

– Σ ai = 0

– Σ ai = Σ ai + an+

0 ≤ i ≤ 0

0 ≤ i ≤n+1 0 ≤^ i^ ≤n

19 March 2009 Winsborough CS 2233 Lecture 16 11

Fibonacci Numbers

• The Fibonacci numbers , f 0 , f 1 , f 2 , …, are

defined by:

– f 0 = 0

– f 1 = 1

– fn = fn-1 + fn-2 for n > 1

19 March 2009 Winsborough CS 2233 Lecture 16 12

Inductive Proof about Recursively

Defined Fibonacci Sequence

• Theorem: Σ f 2i-1 = f 2n, for n>

• Basis (n=1): Σ f 2i-1 = f 1 = 0 + f 1 = f 0 + f 1 = f 2

• Inductive Step (n+1):

Σ f 2i-1 = Σ f 2i-1 + f 2(n+1)-

= f 2n + f 2n+1 by the induction hypothesis

= f 2n+2 = f 2(n+1)

1 ≤ i ≤ n 1 ≤ i ≤ 1

1 ≤ i ≤ n+1 1 ≤^ i^ ≤^ n