Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Intro to Discrete StructuresLecture 13
Pawel M. Wocjan
School of Electrical Engineering and Computer Science
University of Central Florida
Intro to Discrete StructuresLecture 13 – p. 1/44
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
The Euclidean Algorithm
Intro to Discrete StructuresLecture 13 – p. 3/44
The Euclidean Algorithm
Example 12: Find gcd(414, 662) using the EuclideanAlgorithm.
Intro to Discrete StructuresLecture 13 – p. 4/44
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
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
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
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
Intro to Discrete StructuresLecture 13 – p. 9/44
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
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
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
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
Example
Example: Show that
n∑
i=1
i =n(n + 1)
2.
Intro to Discrete StructuresLecture 13 – p. 14/44
Example
Intro to Discrete StructuresLecture 13 – p. 15/44
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
Example
Intro to Discrete StructuresLecture 13 – p. 17/44
The Number of Subsets of a Finite Set
Intro to Discrete StructuresLecture 13 – p. 18/44
The Number of Subsets of a Finite Set
Intro to Discrete StructuresLecture 13 – p. 19/44
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
DeMorgan for Intersection
Intro to Discrete StructuresLecture 13 – p. 21/44
DeMorgan for Intersection
Intro to Discrete StructuresLecture 13 – p. 22/44
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
Creative Uses of Mathematical Induction
Intro to Discrete StructuresLecture 13 – p. 24/44
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
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
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
Existence of Prime Factorization
Intro to Discrete StructuresLecture 13 – p. 28/44
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
Winning Strategy
Example 3:
Intro to Discrete StructuresLecture 13 – p. 30/44
Winning Strategy
Intro to Discrete StructuresLecture 13 – p. 31/44
Winning Strategy
Intro to Discrete StructuresLecture 13 – p. 32/44
Intro to Discrete StructuresLecture 13 – p. 33/44
Intro to Discrete StructuresLecture 13 – p. 34/44
Intro to Discrete StructuresLecture 13 – p. 35/44
Intro to Discrete StructuresLecture 13 – p. 36/44
Intro to Discrete StructuresLecture 13 – p. 37/44
Intro to Discrete StructuresLecture 13 – p. 38/44
Intro to Discrete StructuresLecture 13 – p. 39/44
Intro to Discrete StructuresLecture 13 – p. 40/44
Intro to Discrete StructuresLecture 13 – p. 41/44
Intro to Discrete StructuresLecture 13 – p. 42/44
Intro to Discrete StructuresLecture 13 – p. 43/44
Intro to Discrete StructuresLecture 13 – p. 44/44