Basic Discrete Structure
Basic Discrete Structure
Lecture 2
1
Problem
2
Problem
4
Problem
5
Problem
6
Problem
7
Problem
a) A ∩ B ∩ C. ={4, 6}
8
Problem
a) A ∩ B ∩ C. ={4,6}
b) A ∪ B ∪ C={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
9
Problem
Let A = {0, 2, 4, 6, 8, 10}, B = {0, 1, 2, 3, 4, 5, 6}, and
C = {4, 5, 6, 7, 8, 9, 10}.
Find
a) A ∩ B ∩ C.
b) A ∪ B ∪ C.
c) (A ∪ B) ∩ C.
d) (A ∩ B) ∪ C.
a) A ∩ B ∩ C. ={4,6}
b) A ∪ B ∪ C={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
c) (A ∪ B) ∩ C = {4, 5, 6, 8, 10}
10
Problem
Let A = {0, 2, 4, 6, 8, 10}, B = {0, 1, 2, 3, 4, 5, 6}, and
C = {4, 5, 6, 7, 8, 9, 10}.
Find
a) A ∩ B ∩ C.
b) A ∪ B ∪ C.
c) (A ∪ B) ∩ C.
d) (A ∩ B) ∪ C.
a) A ∩ B ∩ C. ={4, 6}
b) A ∪ B ∪ C={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
c) (A ∪ B) ∩ C = {4, 5, 6, 8, 10}
d) (A ∩ B) ∪ C = {0, 2, 4, 5, 6, 7, 8, 9, 10} 11
Problem
What can you say about the sets A and B if we know that
a) A ∪ B = A?
b) A ∩ B = A?
c) A − B = A?
12
Problem
What can you say about the sets A and B if we know that
a) A ∪ B = A?
b) A ∩ B = A?
c) A − B = A?
a) B A
13
Problem
What can you say about the sets A and B if we know that
a) A ∪ B = A?
b) A ∩ B = A?
c) A − B = A?
a) B A
b) A B
14
Problem
What can you say about the sets A and B if we know that
a) A ∪ B = A?
b) A ∩ B = A?
c) A − B = A?
a) B A
b) A B
c) A B
15
Problem
Let A be the set of English words that contains x, and B be the set of
English words that contain the letter q. Express each of these sets as
a combination of A and B.
i. The set of English words that do not contain the letter x.
ii. The set of English words that contain an x but not a q.
iii. The set of English words that do not contain either an x or a q.
16
Problem
Let A be the set of English words that contains x, and B be the set of
English words that contain the letter q. Express each of these sets as
a combination of A and B.
i. The set of English words that do not contain the letter x.
ii. The set of English words that contain an x but not a q.
iii. The set of English words that do not contain either an x or a q.
i. U–A
17
Problem
Let A be the set of English words that contains x, and B be the set of
English words that contain the letter q. Express each of these sets as
a combination of A and B.
i. The set of English words that do not contain the letter x.
ii. The set of English words that contain an x but not a q.
iii. The set of English words that do not contain either an x or a q.
i. U–A
ii. A –B
18
Problem
Let A be the set of English words that contains x, and B be the set of
English words that contain the letter q. Express each of these sets as
a combination of A and B.
i. The set of English words that do not contain the letter x.
ii. The set of English words that contain an x but not a q.
iii. The set of English words that do not contain either an x or a q.
i. U–A
ii. A –B
iii. U – (A U B)
19
Definitions and notation
Check these:
Is {x} {x}? No
20
Operators
like
“exclusive
or”
The symmetric difference, A B, is:
A B = { x : (x A x B) v (x B x A)}
= (A - B) U (B - A)
U
A
B
21
Operators
Proof: { x : (x A x B) v (x B x A)}
= (A - B) U (B - A)
A B = { 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)
22
Famous Identities
AU=A
• Identity AU=A
AUU=U
• Domination A=
AUA=A
• Idempotent
AA=A
23
Famous Identities
• Uniqueness AA=
24
Famous Identities
AUB= BUA
• Commutativity
AB= BA
(A U B) U C = A U (B U C)
• Associativity
(A B) C = A (B C)
A U (B C) = (A U B) (A U C)
• Distributivity
A (B U C) = (A B) U (A C)
25
Famous Identities
• DeMorgan’s I (A U B) = A B
• DeMorgan’s II (A B) = A U B
26
Inclusion/Exclusion
Example:
How many people are wearing a watch?
How many people are wearing sneakers?
What’s wrong?
|A B| = |A| + |B| 7
B A
|A B| = |A| + |B| - |A B| 6
27
Inclusion/Exclusion
Example:
There are 217 cs majors. 217
28
Generalized Inclusion/Exclusion
Suppose we have:
A = {0, 2, 4, 6, 8},
A B B = {0, 1, 2, 3, 4},
C = {0, 3, 6, 9}.
30