Basic Structures: Sets, Functions,
Sequences, Sums, and Matrices
Set Operations
Set Operations
Union
Intersection
Disjoint
Difference
Complement
Union of Sets
An element x belongs to the union of the sets A and B if and only if x belongs to A
or x belongs to B.
Example
The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is,
{1, 3, 5} ∪ {1, 2, 3}={1, 2, 3, 5}.
A={a,b,c}, B={k,l,m}. The union of the two sets is given by
A ∪ B={a,b,c}∪{k,l,m}={a,b,c,k,l,m}.
C={1,2,3,4}, D={2,4,6,7}. The union of the sets is given by
C ∪ D={1,2,3,4}∪{2,4,6,7}={1,2,3,4,6,7}.
Note that elements are not repeated in a set
Intersection of the sets
An element x belongs to the intersection of the sets A and B if and only if x belongs to A
and x belongs to B. This tells us that
Example
The intersection of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 3}; that is,
{1, 3, 5} ∩ {1, 2, 3}={1, 3}.
If A={1,2,3}, B={1,4,5} then A ∩ B = {1}
If A={1,2,3}, B={4,5} then A ∩ B = ∅
Disjoint
Let A = {1, 3, 5, 7, 9} and B = {2, 4, 6, 8, 10}. Because A ∩ B = ∅, A and B are disjoint
If A={1,2,3}, B={4,5} then A ∩ B = ∅ --- A and B are disjoint
Difference of Sets
Example
The difference of {1, 3, 5} and {1, 2, 3} is the set {5}; that is,
{1, 3, 5} − {1, 2, 3}= {5}.
This is different from the difference of {1, 2, 3} and {1, 3, 5}
{1, 2, 3} - {1, 3, 5} = {2}.
If A={1,2,3}, B={1,2,4,5} then A - B = {3}
If A={1,2,3}, B={1,2,4,5} then B - A = {4,5}
If A = { 10, 11, 12, 13 } and B = { 13, 14, 15 }, then
(A - B) = { 10, 11, 12 } and (B - A) = { 14, 15 }. Here, we can see (A - B) ≠ (B - A)
Complement of a Set
The complement of A is the set of everything that is not in A
Example
Exercises
Let A = {1, 2, 3, 4, 5} and B = {0, 3, 6}. Find
A∪B =
A∩B=
A− B=
B−A=
Let A = {a, b, c, d, e} and B = {a, b, c, d, e, f, g, h}. Find
A∪B =
A∩B=
A− B=
B−A=
Generalized Unions and Intersections
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}.
Exercises
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 ∩ B ∩ C = {4,6}
A ∪ B ∪ C = {0,1,2,3,4,5,6,7,8,9,10}
(A ∪ B) ∩ C
A ∪ B = {0,1,2,3,4,5,6,8,10}, C = {4, 5, 6, 7, 8, 9, 10}
(A ∪ B) ∩ C = {4, 5, 6, 8, 10}
(A ∩ B) ∪ C
(A ∩ B) = {0,2,4,6}, C = {4, 5, 6, 7, 8, 9, 10}
(A ∩ B) ∪ C = {0,2,4,5,6,7,8,9,10}
Creating a Venn Diagram
A={1,3,5,7,9}
B = { 6 , 7 , 8 , 9 , 10 }
The two large circles represent the two sets.
The numbers which appear in both sets are 7 and 9. These will
go in the central section, because this is part of both circles.
The numbers 1, 3 and 5 still need to be put in Set A, but not in
Set B, so these go in the left section of the diagram.
Similarly, the numbers 6, 8 and 10 are in Set B, but not in Set
A, so will go in the right section of the diagram.
The numbers 2 and 4 are not in either set, so will go outside
the two circles.
A ∪ B = {1,3,5,6,7,8,9,10}
A ∩ B = {7,9}
Exercises
U = All the whole numbers from 1 to 10
Set A = { 1 , 4 , 5 , 7 , 8 }
Set B = { 2 , 6 , 8 , 10 }
Exercises
U = All the whole numbers from 1 to 10
Set A = { 1 , 4 , 5 , 7 , 8 }
Set B = { 2 , 6 , 8 , 10 }
Exercises
U= The whole numbers from 1 to 12
List set B.
List set A.
Which set contains all the even numbers?
Which set contains only the multiples of 4?
Exercises
U= The whole numbers from 1 to 12
List set B. = 4,8,12
List set A. = 2,4,6,8,10,12
Which set contains all the even numbers? = Set A
Which set contains only the multiples of 4? = Set B
Exercises
U= The whole numbers from 1 to 20
List set E.
List set S.
What is the intersection of E and S?
Exercises
U= The whole numbers from 1 to 20
List set E. = 2,4,6,8,10,12,14,16,18,20
List set S. = 1,4,9,16
What is the intersection of E and S? = 4,16
Creating a Venn Diagram
Given that U = {1, 2, ..., 9, 10}, A = {1, 2, 3, 4, 5, 6}, B = {2, 4, 6, 8, 9}, and C = {3, 5, 6,
7, 9}, populate a Venn diagram and use this to find [(A – C) ∪ B].
Exercises
U= {0,1,2,3,4,5,6,7,8,9,10}
Given that A = {0, 2, 4, 6, 8, 10}, B = {0, 1, 2, 3, 4, 5, 6}, and C = {4, 5, 6, 7, 8, 9, 10}
populate a Venn diagram.
References
Discrete Mathematics and Its Applications by Rosen, K.
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]