intro to discrete structures lecture 13 · principle mathematical induction to prove that p(n) is...

44
Intro to Discrete Structures Lecture 13 Pawel M. Wocjan School of Electrical Engineering and Computer Science University of Central Florida [email protected] Intro to Discrete StructuresLecture 13 – p. 1/44

Upload: others

Post on 14-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13

Pawel M. Wocjan

School of Electrical Engineering and Computer Science

University of Central Florida

[email protected]

Intro to Discrete StructuresLecture 13 – p. 1/44

Page 2: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

The Euclidean Algorithm

Lemma 1: Let a = bq + r, where a, b, q, and r are integers.Then

gcd(a, b) = gcd(b, r) .

Intro to Discrete StructuresLecture 13 – p. 2/44

Page 3: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

The Euclidean Algorithm

Intro to Discrete StructuresLecture 13 – p. 3/44

Page 4: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

The Euclidean Algorithm

Example 12: Find gcd(414, 662) using the EuclideanAlgorithm.

Intro to Discrete StructuresLecture 13 – p. 4/44

Page 5: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Some Useful Facts

Theorem 1:

∀a∀b ∃s ∃t gcd(a, b) = sa + tb .

The pair (s, t) can be efficiently computed with the extendedEuclidean algorithm.

Intro to Discrete StructuresLecture 13 – p. 5/44

Page 6: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

The Extended Euclidean Algorithm

Example 1: Express gcd(252, 198) = 18 as a linearcombination of 252 and 198.

252 = 1 · 198 + 54

198 = 3 · 54 + 36

54 = 1 · 36 + 18

36 = 2 · 18

Intro to Discrete StructuresLecture 13 – p. 6/44

Page 7: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Some Useful Facts

Lemma 2: If p is a prime and p | a1a2 · · · an, where each ai isan integer, then p | ai for some i.

Intro to Discrete StructuresLecture 13 – p. 7/44

Page 8: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Some Useful Facts

Lemma 1:gcd(a, b) = 1 ∧ a | bc ⇒ a | c

Proof of the uniqueness of the prime factorization of apositive integer:

Intro to Discrete StructuresLecture 13 – p. 8/44

Page 9: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 9/44

Page 10: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Mathematical Induction

Mathematical induction is based on the rule of inference

1. P (1)

2. ∀k (P (k) → P (k + 1))

3. ∴ ∀nP (n)

which is true for the domain of natural numbers N.

Intro to Discrete StructuresLecture 13 – p. 10/44

Page 11: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Climbing an Infinite Ladder

1. We can reach the first rung of the ladder.

2. If we can reach a particular rung of the ladder, then wecan reach the next rung of the ladder.

3. Therefore, we can reach any rung of the ladder.

Intro to Discrete StructuresLecture 13 – p. 11/44

Page 12: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Principle Mathematical Induction

To prove that P (n) is true for all natural numbers n, whereP (n) is a propositional function, we complete two steps:

Basis step: We verify that P (1) is true.

We show that the conditional statement

P (k) → P (k + 1)

is true for all natural numbers k.

Intro to Discrete StructuresLecture 13 – p. 12/44

Page 13: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Warning

In a proof of mathematical induction is is not assumedthat P (k) is true for all k.

It is only shown that if it is assumed that P (k) is true,then P (k + 1) is also true.

Thus, a proof of mathematical induction is not a case ofbegging the question, or circular reasoning.

Intro to Discrete StructuresLecture 13 – p. 13/44

Page 14: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Example

Example: Show that

n∑

i=1

i =n(n + 1)

2.

Intro to Discrete StructuresLecture 13 – p. 14/44

Page 15: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Example

Intro to Discrete StructuresLecture 13 – p. 15/44

Page 16: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Example

Example 2: Conjecture a formula for the sum of the first n

positive integers. Then prove your conjecture usingmathematical induction.

Intro to Discrete StructuresLecture 13 – p. 16/44

Page 17: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Example

Intro to Discrete StructuresLecture 13 – p. 17/44

Page 18: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

The Number of Subsets of a Finite Set

Intro to Discrete StructuresLecture 13 – p. 18/44

Page 19: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

The Number of Subsets of a Finite Set

Intro to Discrete StructuresLecture 13 – p. 19/44

Page 20: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

DeMorgan for Intersection

Example 10: Prove

n⋂

j=1

Aj =n⋃

j=1

Aj

whenever A1, A2, . . . , An are subset of a universal U andn ≥ 2.

Intro to Discrete StructuresLecture 13 – p. 20/44

Page 21: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

DeMorgan for Intersection

Intro to Discrete StructuresLecture 13 – p. 21/44

Page 22: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

DeMorgan for Intersection

Intro to Discrete StructuresLecture 13 – p. 22/44

Page 23: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Creative Uses of Mathematical Induction

Example: Show that every 2n × 2n checkerboard with onesquare removed can be tiled using L-shaped triominoes.

Intro to Discrete StructuresLecture 13 – p. 23/44

Page 24: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Creative Uses of Mathematical Induction

Intro to Discrete StructuresLecture 13 – p. 24/44

Page 25: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Strong Induction

Strong induction is based on the rule of inference

1. P (1)

2. ∀k (∧kj=1

P (j) → P (k + 1))

3. ∴ ∀nP (n)

which is true for the domain of natural numbers N.

Intro to Discrete StructuresLecture 13 – p. 25/44

Page 26: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Strong Induction

To prove that P (n) is true for all natural numbers n, whereP (n) is a propositional function, we complete two steps:

Basis step: We verify that P (1) is true.

We show that the conditional statement

k∧

j=1

P (j) → P (k + 1)

is true for all natural numbers k.

Intro to Discrete StructuresLecture 13 – p. 26/44

Page 27: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Existence of Prime Factorization

Example: Show that if n is an integer greater than 1, then n

can be written as the product of primes.

Intro to Discrete StructuresLecture 13 – p. 27/44

Page 28: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Existence of Prime Factorization

Intro to Discrete StructuresLecture 13 – p. 28/44

Page 29: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Existence of Prime Factorization

Example 2: Show that if n is an integer greater than 1, thenn can be written as the product of primes.

Intro to Discrete StructuresLecture 13 – p. 29/44

Page 30: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Winning Strategy

Example 3:

Intro to Discrete StructuresLecture 13 – p. 30/44

Page 31: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Winning Strategy

Intro to Discrete StructuresLecture 13 – p. 31/44

Page 32: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Winning Strategy

Intro to Discrete StructuresLecture 13 – p. 32/44

Page 33: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 33/44

Page 34: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 34/44

Page 35: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 35/44

Page 36: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 36/44

Page 37: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 37/44

Page 38: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 38/44

Page 39: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 39/44

Page 40: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 40/44

Page 41: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 41/44

Page 42: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 42/44

Page 43: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 43/44

Page 44: Intro to Discrete Structures Lecture 13 · Principle Mathematical Induction To prove that P(n) is true for all natural numbers n, where P(n) is a propositional function, we complete

Intro to Discrete StructuresLecture 13 – p. 44/44