CS 173: Discrete Mathematical Structures - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

CS 173: Discrete Mathematical Structures

Description:

... gets the early lead, and then comes from behind to tie at the end. There must be a tie along the way. Cs173 - Spring 2004. CS173. Strong Induction, another example ... – PowerPoint PPT presentation

Number of Views:86
Avg rating:3.0/5.0
Slides: 25
Provided by: mikeha5
Category:

less

Transcript and Presenter's Notes

Title: CS 173: Discrete Mathematical Structures


1
CS 173Discrete Mathematical Structures
  • Cinda Heeren
  • heeren_at_cs.uiuc.edu
  • Rm 2213 Siebel Center
  • Office Hours M 930-11a

2
CS 173 Announcements
  • Homework 6 available. Due 2/25, 8a.
  • Exam 3/1, 7-9p, location MSEB 100. email Cinda
    with conflict.
  • No class 3/1, but there will be a review, here,
    during class time.

3
CS 173 Strong Mathematical Induction
  • If
  • P(0) and
  • ?k?0 (P(0) ? P(1) ? ? P(k-1)) ? P(k)
  • Then
  • ?n?0 P(n)

4
CS 173 Strong Mathematical Induction
  • An example.
  • Given n blue points and n orange points in a
    plane with no 3 collinear, prove there is a way
    to match them, blue to orange, so that none of
    the segments between the pairs intersect.

5
CS 173 Strong Mathematical Induction
  • Base case (n1)
  • Assume any matching problem of size less than k
    can be solved.
  • Show that we can match k pairs.

6
CS 173 Strong Mathematical Induction
  • Show that we can match k pairs.
  • Suppose there is a line partitioning the group
    into a smaller one of j blues and j oranges, and
    another smaller one of k-j blues and k-j oranges.

OK!! (by IH)
OK!! (by IH)
7
CS 173 Strong Mathematical Induction
  • How do we know such a line always exists?
  • Consider the convex hull of the points

OK!! (by IH)
If there is an alternating pair of colors on the
hull, were done!
OK!! (by IH)
8
CS 173 Strong Mathematical Induction
  • If there is no alternating pair, all points on
    hull are the same color.

Notice that any sweep of the hull hits an orange
point first and also last. We sweep on some
slope not given by a pair of points.
Keep score of of each color seen. Orange gets
the early lead, and then comes from behind to tie
at the end.
OK!! (by IH)
OK!! (by IH)
9
CS173Strong Induction, another example
  • Prove that every positive integer gt 1 can be
    written as a product of primes.

10
CS173Inductive Definitions
  • We completely understand the function f(n) n!,
    right?
  • As a reminder, heres the definition
  • n! 1 2 3 (n-1) n, n ? 1

11
CS173Inductive Definitions
  • Another VERY common example
  • Fibonacci Numbers

12
CS173Inductive Definitions
  • Our examples so far have been inductively defined
    functions.
  • Sets can be defined inductively, too.

Give an inductive definition of S x x is a
multiple of 3
  • 3 ? S
  • x,y ? S ? x y ? S
  • x,y ? S ? x - y ? S
  • No other numbers are in S.

13
CS173Inductive Definitions
  • We want to show that my definition of S
  • 3 ? S
  • x,y ? S ? x y ? S
  • x,y ? S ? x - y ? S
  • No other numbers are in S.
  • Contains the same elements as the set T x
    x is a multiple of 3
  • To prove S T, show
  • T ? S
  • S ? T

14
CS173Inductive Definitions
  • We start with T ? S.
  • If x ? T, then x 3k for some integer k. We
    show by induction on k that 3k ? S.
  • Base Case (k 0) 0 ? S since 3 ? S by rule 1,
    and 3 - 3 ? S by rule 3.

Assume 3k, -3k ? S, show that 3(k1), -3(k1) ?
S.
15
CS173Inductive Definitions
  • We start with T ? S.
  • If x ? T, then x 3k for some integer k. We
    show by induction on k that 3k ? S.

Assume 3k, -3k ? S, show that 3(k1), -3(k1) ?
S.
  • 3k ? S by inductive hypothesis.
  • 3 ? S by rule 1.
  • 3k 3 3(k1) ? S by rule 2.
  • 0 ? S by base case.
  • 0 - 3(k1) -3(k1) ? S by rule 3.

16
CS173Inductive Definitions
  • Next we show that S ? T.
  • That is, if an number x is described by S, then
    it is a multiple of 3.

Observe that by rule 4, all numbers in S are
created by a finite number of applications of
rules 1,2, and 3. We use the number of rule
applications as our induction counter.
  • For example
  • 3 ? S by 1 application of rule 1.
  • 0 ? S by 2 rule applications (rules 1 and 3).
  • 9 ? S by 3 applications (rule 1 once and rule 2
    twice).

17
CS173Inductive Definitions
  • Next we show that S ? T.
  • That is, if an number x is described by S, then
    it is a multiple of 3.

Base Case (k1) If x ? S by 1 rule application,
then it must be rule 1 and x 3, which is
clearly a multiple of 3.
18
CS173Inductive Definitions
  • Next we show that S ? T.
  • That is, if an number x is described by S, then
    it is a multiple of 3.

Assume any number described by k or fewer
applications of the rules in S is a multiple of 3
and prove that any number described by (k1)
applications of the rules is also a multiple of
3.
Suppose the (k1)st rule applied is rule 3, and
it results in value x a b. Then a and b are
multiples of 3 by inductive hypothesis, and thus
x is a multiple of 3.
19
CS173Inductive Definitions
  • Yet another example Well-Formed Formulas (wffs)
  • T is a wff
  • F is a wff
  • p is a wff for any propositional variable p
  • If p is a wff, then (?p) is a wff
  • If p and q are wffs, then (p ? q) is a wff
  • If p and q are wffs, then (p ? q) is a wff

For example, a statement like ((?r) ? (p ? r))
can be proven to be a wff by arguing that (?r)
and (p ? r) are wffs by induction and then
applying rule 5.
20
CS173Strings and Inductive Definitions
  • Let ? be a finite set called an alphabet.
  • The set of strings on ?, denoted ? is defined
    as
  • ? ? ?, where ? denotes the null or empty string.
  • If x ? ?, and w ? ?, then wx ? ?, where wx is
    the concatenation of string w with symbol x.

Example Let ? a, b, c. Then ? ?, a, b,
c, aa, ab, ac, ba, bb, bc, ca, cb, cc, aaa, aab,
How big is ??
Are there any infinite strings in ??
Is there a largest string in ??
21
CS173Strings and Inductive Definitions
  • Inductive definition of the length of strings
    (the length of string w is w.)
  • ? 0
  • If x ? ?, and w ? ?, then wx w 1

22
CS173Strings and Inductive Definitions
  • Inductive definition of the reversal of a string
    (the reversal of string w is written wR.)
  • ?R ?
  • If x ? ?, and w ? ?, then (wx)R ?

For example (abc)R c(ab)R
cb(a)R
cba(?)R
cba?
cba
23
CS173Strings and Inductive Definitions
  • A Theorem ?x,y ? ?
  • (xy)R yRxR

Proof (by induction on y)
Base Case (y 0) If y 0, y ?, then
(xy)R (x?)R xR ?xR yRxR.
IH If y ? n, then ?x ? ?, (xy)R
yRxR. Prove If y n1, then ?x ? ?, (xy)R
yRxR.
24
CS173Strings and Inductive Definitions
  • IH If y ? n, then ?x ? ?, (xy)R yRxR.
  • Prove If y n1, then ?x ? ?, (xy)R yRxR.

If y n1, then ?a ? ?, u ? ?, so that y
ua, and u n.
Then, (xy)R (x(ua))R by substitution
((xu)a)R by assoc. of concatenation
a(xu)R by inductive defn of reversal
auRxR by IH
(ua)RxR by inductive defn of reversal
yRxR by substitution
Write a Comment
User Comments (0)
About PowerShow.com