Title: CS 173: Discrete Mathematical Structures
1CS 173Discrete Mathematical Structures
- Cinda Heeren
- heeren_at_cs.uiuc.edu
- Rm 2213 Siebel Center
- Office Hours W 930-1130a
2CS 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.
3CS 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.
4CS 173 Proof Techniques-Quantifiers Existence
Proofs
- Two ways of proving ?x P(x).
- Either build one, or show one can be built.
-
5CS 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.
6CS 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?
7CS 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!!!
8CS 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.
9CS 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)).
10CS 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
11CS 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))
12CS 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!
13CS 173 Set Theory - Definitions and notation
Is x ? x,x?
Is x ? x,x?
Is x ? x?
14CS 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) ?
15CS 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)
16CS 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)
17CS 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
18CS 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
19CS 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
20CS 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
21CS 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 ?
22CS 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
23CS 173 Set Theory - Operators
- The set difference, A - B, is
A - B x x ? A ? x ? B
A - B A ? B
24CS 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)
25CS 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)
26CS 173 Set Theory - Famous Identities
- Two pages of (almost) obvious.
- One page of HS algebra.
- One page of new.
-
27CS 173 Set Theory - Famous Identities
- Identity
- Domination
- Idempotent
-
28CS 173 Set Theory - Famous Identities
- Excluded Middle
- Uniqueness
- Double complement
29CS 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)
30CS 173 Set Theory - Famous Identities
p
q
31CS 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.
32CS 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)
33CS 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
34CS 173 Set Theory - 4 Ways to prove identities
- Prove that using
identities.
35CS 173 Set Theory - 4 Ways to prove identities
- Prove that using
logically equivalent set definitions.
x ?(x ? A) ? ?(x ? B)
36CS 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)
37CS 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 ?.