Professional Documents
Culture Documents
LECTURE 14, 15
Set Operations
Course Instructor:
1 Rida Memon
Set Operations: Union
AUB
U
A B
2
Set Operations: Union
Further examples
{1, 2, 3} U {3, 4, 5} = {1, 2, 3, 4, 5}
{1, 2} U = {1, 2}
3
Set Operations: Union
4
Set Operations: Intersection
A∩B
U
A B
5
Set Operations: Intersection
Formal definition for the intersection of two sets: A ∩ B =
{ x | x A and x B }
Further examples
{1, 2, 3} ∩ {3, 4, 5} = {3}
{1, 2} ∩ =
Any set intersection with the empty set yields the empty set
6
Set Operations: Intersection
7
Disjoint Sets
• Two sets are disjoint if the have NO elements in common
• Another example: the set of the even numbers and the set
of the odd numbers
8
Disjoint Sets
U
A B
Overlapping Sets
U
A B
9
Disjoint Sets
Further examples
{1, 2, 3} and {3, 4, 5} are not disjoint
10
Set Operations: Difference
• A difference of two sets is the elements in one set that are
NOT in the other.
C=P-M
11
Set Operations: Difference
A-B
A B
Set Operations: Difference
Formal definition for the difference of two sets:
_
A - B = { x | x A and x B }
A-B=A∩B Important!
Further examples
{1, 2, 3} - {3, 4, 5} = {1, 2}
{1, 2} - = {1, 2}
The difference of any set S with the empty set will be the set S
13
Set Operations: Symmetric Difference
14
Set Operations: Symmetric Difference
Formal definition for the symmetric difference of two
sets:
A B = { x | (x A or x B) and x A ∩ B}
A B = (A U B) – (A ∩ B) Important!
Further examples
{1, 2, 3} {3, 4, 5} = {1, 2, 4, 5}
{New York, Washington} {3, 4} = {New York, Washington, 3, 4}
{1, 2} = {1, 2}
The symmetric difference of any set S with the empty set will be the set
S
15
Complement of Sets
• A complement of a set is all the elements that are NOT
in the set
16
Complement of Sets
_
A
U
A B
A
17
Complement of Sets
_
B
U
A B
18
Complement of Sets
19
Complement of Sets
¯
¯A = A Complementation law
AU¯
A=U Complement law
A ∩¯
A= Complement law
20
Set Identities
21
Set Identities: De-Morgan
Again
These should look
very familiar…
A B A B
A B A B
22
How to Prove a Set Identity
23
Use Venn Diagrams
A∩B=B-(B-A)
A B
B-(B-A)
A∩B B-A
24
Proof by using basic set identities
Prove that A∩B=B-(B-A)
A B B-(B A ) Definition of difference
B (B A ) Definition of difference
B (B A ) DeMorgan’s law
B (B A) Complementation law
(B B ) (B A) Distributive law
(B A) Complement law
(B A) Identity law
A B Commutative law 25
Membership Table
Chapter 2
Section 2.2
Page 127 – 132
Page 134 – 135
Page 138
28
Practice Questions
Chapter 2
Section 2.2
All related Questions
Problem 63 - 65
29
Thanks
End of Lecture
Q/A
30