Week#3.1-Set Theory
Week#3.1-Set Theory
Rimsha Javed
1
Outline on sets
Basics
Specify a set by enumerating all elements
Notations
Cardinality
Venn Diagram
Relations on sets: subset, proper subset
Set builder notation
Set operations
Principle of Inclusion/Exclusion
Applications of Venn diagram
2
Venn Diagrams
Disjoint sets: There is no common elements in sets
3
Venn Diagrams
Subsets (A ∩ B)
(AUB) (A-B)
4
Venn Diagrams
Ac (A∩B∩C )
(AUB) c (A∩B) c
5
Venn Diagrams
A⊝B
Let’s Try this:
a. A∩(BUC)
b. (B∩C)UA
c. (A-B)U(A-C)U(B-C)
6
Venn Diagrams
7
Applications of Venn diagram
A number of computer users are surveyed to find out if
they have a printer, modem or scanner. Draw separate
Venn diagrams and shade the areas, which represent the
following configurations.
a. modem and printer but no scanner
b. scanner but no printer and no modem
c. scanner or printer but no modem
d. no modem and no printer
8
SOLUTION
Let
P represent the set of computer users having printer.
M represent the set of computer users having modem.
S represent the set of computer users having scanner
9
SOLUTION
a. Modem and printer but no Scanner is shaded.
(M∩P∩Sc)
10
SOLUTION
c. scanner or printer but no modem is shaded.
d. (Mc∩P)U(Mc∩S)
11
How to prove a set identity
For example: A∩B=B-(B-A)
Four methods:
Use the basic set identities
Use membership tables
Prove each set is a subset of each other
This is like proving that two numbers are equal by showing that each
is less than or equal to the other
Use set builder notation and logical equivalences
12
What we are going to prove…
A∩B=B-(B-A)
A B
A∩B B-A
B-(B-A)
13
14
Proof by using basic set identities
Prove that A∩B=B-(B-A)
A B = B-(B A ) Definition of difference (A - B = A ∩ Bc )
= B (B A ) Definition of difference (A - B = A ∩ Bc )
= B (B A) Complementation Law
= (B A) Complement Law A ∩ Ac = ∅
= (B A) Identity Law A∪∅= A
16
What is a membership table
• Membership tables show all the combinations of
sets an element can belong to
– 1 means the element belongs, 0 means it does not
• Consider the following membership table:
A B AUB A∩B A-B
1 1 1 1 0
1 0 1 0 1
0 1 1 0 0
0 0 0 0 0
The top row is all elements that belong to both sets A and B
Thus, these elements are in the union and intersection, but not the
difference
17
Proof by membership tables
19