Math 11 Set Operation 7
Math 11 Set Operation 7
Discrete Mathematics
Set Operations
Engr. Marcelo V. Rivera
Union of Sets
A B (the union of A and B) - the set containing those
elements that are in at least one of A and B.
A B = {x | x A x B}
Example
The union of the sets {1, 3, 5} and {1, 2, 3} is:
Answer
The set {1, 2, 3, 5}; that is, {1, 3, 5} {1, 2, 3} = {1, 2, 3, 5}.
Intersection of Sets
A B (the intersection of A and B) - the set containing those
elements that are in both A and B.
A B = {x | x A x B}.
Example
The intersection of the sets {1, 3, 5} and {1, 2, 3} is?
Answer
{1, 3}; that is, {1, 3, 5} {1, 2, 3} = {1, 3}.
Disjoint
Disjoint if the two sets intersection is the empty set.
Illustrative Example:
Let A = {1, 3, 5, 7, 9} and B = {2, 4, 6, 8, 10}. Because A B = ,
A and B are disjoint.
Difference of Sets
AB (the difference of A and B) - the set containing those
elements that are in A but not in B.
Note: The difference of sets A and B is sometimes denoted by
A\B.
AB ={x | x A x B}.
Venn Diagram for the
Difference of A and B
Example
The difference of {1,3,5} and {1,2,3} is?
Answer
Set {5}; that is, {1, 3, 5} {1, 2, 3} = {5}.
Example
The difference of {1, 2, 3} and{1, 3, 5}.
Answer
Set {2}.
Complement of a Set
(the complement of A) - the set of elements in the
universal set that are not in A.
Venn Diagram for the Complement of the Set A:
= {x U | x A}.
Example
Let A = {a, e, i, o, u} (where the universal set is the set of
letters of the English alphabet). What is the complement of A?
Answer
= {b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z}.
Example
Let A be the set of positive integers greater than 10 (with
universal set the set of all positive integers). What is the
complement of A?
Answer
= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
Set Identities
Example
Prove that = .
Membership Table
Membership table - a table displaying the membership of
elements in sets.
Example
Use a membership table to show that
A (B C) = (A B) (A C).
Answer
Example
(Let A, B, and C be sets. Show that = ( ( ) .
Answer
= ( ( ) bythe rst De Morgan law
= ( () by the second De Morgan law
= ( ) by the commutative law for
intersections
= ( ) by the commutative law for
unions.
Generalized Unions and Intersections
A B C and A B C
Example
Let A = {0, 2, 4, 6, 8}, B = {0, 1, 2, 3, 4}, and C = {0, 3, 6, 9}. What
are A B C and A B C?
Answer
The set A B C contains those elements in at least one of A,
B, and C. Hence, A B C = {0, 1, 2, 3, 4, 6, 8, 9}.
The set A B C contains those elements in all three of A, B,
and C. Thus, A B C = {0}.
Collection of Sets
The union of a collection of sets is the set that contains those
elements that are members of at least one set in the
collection.
A1 A2 An =
The intersection of a collection of sets is the set that
contains those elements that are members of all the sets in
the collection.
A1 A2 An =
Illustrative Example
For i = 1,2,..., let Ai ={i, i +1, i+2, ...}. Then,
and
Example
Suppose that Ai ={1, 2, 3, ..., i} for i = 1, 2, 3, .... Then, and is:
Answer
Note: To obtain the bit string for the union and intersection of
two sets we perform bitwise Boolean operations on the bit
strings representing the two sets.
Example
The bit strings for the sets {1, 2, 3, 4, 5} and {1, 3, 5, 7, 9} are
11 1110 0000 and 10 1010 1010, respectively. Use bit strings to
nd the union and intersection of these sets.
Answer
The bit string for the union of these sets is
11 1110 0000 10 1010 1010 = 11 1110 1010, which
corresponds to the set {1, 2, 3, 4, 5, 7, 9}.
The bit string for the intersection of these sets is
11 1110 0000 10 1010 1010 = 10 1010 0000, which
corresponds to the set {1, 3, 5}.
End