CS 173: Discrete Mathematical Structures - PowerPoint PPT Presentation

1 / 37
About This Presentation
Title:

CS 173: Discrete Mathematical Structures

Description:

... his desire for chocolate mousse, then his waistline will ... Boris gives in to his desire for chocolate mousse. However, his dancing will not suffer. ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 38
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 W 930-1130a

2
CS 173 Proofs - something for everyone
  • If Boris becomes a pastry chef, then if he gives
    in to his desire for chocolate mousse, then his
    waistline will suffer. If his waistline suffers,
    then his dancing will suffer. Boris gives in to
    his desire for chocolate mousse. However, his
    dancing will not suffer. Prove that Boris does
    not become a pastry chef.

3
CS 173 Announcements
  • New section, Tue, 5-6.
  • WCS General meeting tonight, 7p, Siebel 2405.
  • Homework 1 returned in section this week.
  • Homework 2 available. Due 09/10, 8a.

4
CS 173 Proof Techniques-Quantifiers Existence
Proofs
  • Two ways of proving ?x P(x).
  • Either build one, or show one can be built.

5
CS 173 Proof Techniques-Quantifiers Existence
Proofs
  • Example Prove that for all integers n, there
    exist n consecutive composite integers.
  • ?n (integer), ?x so that x, x1, x2, , xn-1
    are all composite.
  • Proof Let n be an arbitrary integer.

(n 1)! 2 is divisible by 2, ? composite.
(n 1)! 3 is divisible by 3, ? composite.

(n 1)! (n 1) is divisible by n 1, ?
composite.
6
CS 173 Proof Techniques-Quantifiers Existence
Proofs
  • Example Prove that for all integers n, there
    exists a prime p so that p gt n.
  • ?n (integer), ?p so that p is prime, and p gt n.
  • Proof Let n be an arbitrary integer, and
    consider n! 1. If (n! 1) is prime, we are
    done since (n! 1) gt n. But what if (n! 1) is
    composite?

If (n! 1) is composite then it has a prime
factorization, p1p2pn (n! 1)
Consider the smallest pi, how small can it be?
7
CS 173 Proof Techniques-Quantifiers Existence
Proofs
  • ?n (integers), ?p so that p is prime, and p gt n.
  • Proof Let n be an arbitrary integer, and
    consider n! 1. If (n! 1) is prime, we are
    done since (n! 1) gt n. But what if (n! 1) is
    composite?

If (n! 1) is composite then it has a prime
factorization, p1p2pn (n! 1)
Consider the smallest pi, and call it p. How
small can it be?
So, p gt n, and we are done. BUT WE DONT KNOW
WHAT p IS!!!
8
CS 173 Set Theory - Definitions and notation
  • A set is an unordered collection of elements.
  • Some examples
  • 1, 2, 3 is the set containing 1 and 2 and
    3.
  • 1, 1, 2, 3, 3 1, 2, 3 since repetition is
    irrelevant.
  • 1, 2, 3 3, 2, 1 since sets are unordered.
  • 1, 2, 3, is a way we denote an infinite set
    (in this case, the natural numbers).
  • ? is the empty set, or the set containing no
    elements.

9
CS 173 Set Theory - Definitions and notation
  • x ? S means x is an element of set S.
  • x ? S means x is not an element of set S.
  • A ? B means A is a subset of B.

or, B contains A. or, every element of A is
also in B. or, ?x ((x ? A) ? (x ? B)).
10
CS 173 Set Theory - Definitions and notation
  • A ? B means A is a subset of B.
  • A ? B means A is a superset of B.
  • A B if and only if A and B have exactly the
    same elements.

iff, A ? B and B ? A iff, A ? B and A ? B iff,
?x ((x ? A) ? (x ? B)).
  • So to show equality of sets A and B, show
  • A ? B
  • B ? A

11
CS 173 Set Theory - Definitions and notation
  • A ? B means A is a proper subset of B.
  • A ? B, and A ? B.
  • ?x ((x ? A) ? (x ? B)) ? ??x ((x ? B) ? (x ? A))
  • ?x ((x ? A) ? (x ? B)) ? ?x ?(?(x ? B) v (x ? A))
  • ?x ((x ? A) ? (x ? B)) ? ?x ((x ? B) ? ?(x ? A))
  • ?x ((x ? A) ? (x ? B)) ? ?x ((x ? B) ? (x ? A))

12
CS 173 Set Theory - Definitions and notation
  • Quick examples
  • 1,2,3 ? 1,2,3,4,5
  • 1,2,3 ? 1,2,3,4,5
  • Is ? ? 1,2,3?

Yes! ?x (x ? ?) ? (x ? 1,2,3) holds, because (x
? ?) is false.
Is ? ? 1,2,3?
No!
Is ? ? ?,1,2,3?
Yes!
Is ? ? ?,1,2,3?
Yes!
13
CS 173 Set Theory - Definitions and notation
  • Quiz time
  • Is x ? x?

Is x ? x,x?
Is x ? x,x?
Is x ? x?
14
CS 173 Set Theory - Ways to define sets
  • Explicitly John, Paul, George, Ringo
  • Implicitly 1,2,3,, or 2,3,5,7,11,13,17,
  • Set builder x x is prime , x x is odd
    . In general x P(x) is true , where P(x) is
    some description of the set.

Ex. Let D(x,y) denote x is divisible by y. Give
another name for x ?y ((y gt 1) ? (y lt x)) ?
?D(x,y) .
Can we use any predicate P to define a set S
x P(x) ?
15
CS 173 Set Theory - Cardinality
  • If S is finite, then the cardinality of S, S,
    is the number of distinct elements in S.

If S 1,2,3,
If S 3,3,3,3,3,
If S ?,
If S ?, ?, ?,? ,
If S 0,1,2,3,, S is infinite. (more on
this later)
16
CS 173 Set Theory - Power sets
  • If S is a set, then the power set of S is
  • 2S x x ? S .

If S a,
If S a,b,
If S ?,
If S ?,?,
Fact if S is finite, 2S 2S. (if S n,
2S 2n)
17
CS 173 Set Theory - Cartesian Product
  • The Cartesian Product of two sets A and B is
  • A x B lta,bgt a ? A ? b ? B

If A Charlie, Lucy, Linus, and B Brown,
VanPelt, then
A x B ltCharlie, Browngt, ltLucy, Browngt, ltLinus,
Browngt, ltCharlie, VanPeltgt, ltLucy, VanPeltgt,
ltLinus, VanPeltgt
A1 x A2 x x An lta1, a2,, angt a1 ? A1, a2 ?
A2, , an ? An
18
CS 173 Set Theory - Operators
  • The union of two sets A and B is
  • A ? B x x ? A v x ? B

If A Charlie, Lucy, Linus, and B Lucy,
Desi, then
A ? B Charlie, Lucy, Linus, Desi
19
CS 173 Set Theory - Operators
  • The intersection of two sets A and B is
  • A ? B x x ? A ? x ? B

If A Charlie, Lucy, Linus, and B Lucy,
Desi, then
A ? B Lucy
20
CS 173 Set Theory - Operators
  • The intersection of two sets A and B is
  • A ? B x x ? A ? x ? B

If A x x is a US president, and B x x
is deceased, then
A ? B x x is a deceased US president
B
A
21
CS 173 Set Theory - Operators
  • The intersection of two sets A and B is
  • A ? B x x ? A ? x ? B

If A x x is a US president, and B x x
is in this room, then
A ? B x x is a US president in this room ?
22
CS 173 Set Theory - Operators
  • The complement of a set A is
  • A x x ? A

If A x x is bored, then
A x x is not bored
?
U
23
CS 173 Set Theory - Operators
  • The set difference, A - B, is

A - B x x ? A ? x ? B
A - B A ? B
24
CS 173 Set Theory - Operators
  • The symmetric difference, A ? B, is
  • A ? B x (x ? A ? x ? B) v (x ? B ? x ? A)

(A - B) U (B - A)
25
CS 173 Set Theory - Operators
  • A ? B x (x ? A ? x ? B) v (x ? B ? x ? A)

(A - B) U (B - A)
Proof
x (x ? A ? x ? B) v (x ? B ? x ? A)
x (x ? A - B) v (x ? B - A)
x x ? ((A - B) U (B - A))
(A - B) U (B - A)
26
CS 173 Set Theory - Famous Identities
  • Two pages of (almost) obvious.
  • One page of HS algebra.
  • One page of new.

27
CS 173 Set Theory - Famous Identities
  • Identity
  • Domination
  • Idempotent

28
CS 173 Set Theory - Famous Identities
  • Excluded Middle
  • Uniqueness
  • Double complement

29
CS 173 Set Theory - Famous Identities
  • Commutativity
  • Associativity
  • Distributivity

A U B
A ? B
(A U B) U C
(A ? B) ? C
(A U B) ? (A U C)
(A ? B) U (A ? C)
30
CS 173 Set Theory - Famous Identities
  • DeMorgans I
  • DeMorgans II

p
q
31
CS 173 Set Theory - 4 Ways to prove identities
  • Show that A ? B and that A ? B.
  • Use a membership table.
  • Use previously proven identities.
  • Use logical equivalences to prove equivalent set
    definitions.

32
CS 173 Set Theory - 4 Ways to prove identities
  • Prove that
  • (?) (x ? A U B) ? (x ? A U B) ? (x ?
    A and x ? B) ? (x ? A ? B)
  • 2. (?) (x ? A ? B) ? (x ? A and x ? B) ? (x
    ? A U B) ? (x ? A U B)

33
CS 173 Set Theory - 4 Ways to prove identities
  • Prove that using a
    membership table.
  • 0 x is not in the specified set
  • 1 otherwise

A B A B A ? B A U B A U B
1 1 0 0 0 1 0
1 0 0 1 0 1 0
0 1 1 0 0 1 0
0 0 1 1 1 0 1
34
CS 173 Set Theory - 4 Ways to prove identities
  • Prove that using
    identities.

35
CS 173 Set Theory - 4 Ways to prove identities
  • Prove that using
    logically equivalent set definitions.

x ?(x ? A) ? ?(x ? B)
36
CS 173 Set Theory - A proof for us to do
together.
  • X ? (Y - Z) (X ? Y) - (X ? Z). True or False?
  • Prove your response.

(X ? Y) - (X ? Z) (X ? Y) ? (X ? Z)
(X ? Y) ? (X U Z)
(X ? Y ? X) U (X ? Y ? Z)
? U (X ? Y ? Z)
(X ? Y ? Z)
37
CS 173 Set Theory - A proof for us to do
together.
  • Pv that if (A - B) U (B - A) (A U B) then
    ______

A ? B ?
Suppose to the contrary, that A ? B ? ?, and that
x ? A ? B.
Then x cannot be in A-B and x cannot be in B-A.
DeMorgans!!
Then x is not in (A - B) U (B - A).
Do you see the contradiction yet?
But x is in A U B since (A ? B) ? (A U B).
Thus, A ? B ?.
Write a Comment
User Comments (0)
About PowerShow.com