Lesson 4
Lesson 4
4.1.1 Union
The union of two sets A and B, denoted by A ∪ B, is the set of all elements which belong to
A or to B; that is
A ∪ B = {x : x ∈ A or x ∈ B} .
4.1.2 Intersection
The intersection of two sets A and B, denoted by A ∩ B, is the set of elements which belong
to both A and B; that is,
A ∩ B = {x : x ∈ A and x ∈ B} .
1
2 ITE 1812 - Mathematic for IT
Example 4.1
4.1.3 Complement
The complement of a set A, denoted by AC , is the set of elements which belong to U but which
do not belong to A.
AC = {x : x ∈ U, x 6∈ A} .
2
Degree of Bachelor of Information Technology 3
4.1.4 Difference
The difference of A and B, denoted by A \ B, is the set of elements which belong to A but
which do not belong to B.
A \ B = {x : x ∈ A, x 6∈ B} .
A ⊕ B = (A ∪ B) \ (A ∩ B) or A ⊕ B = (A \ B) ∪ (B \ A) .
3
4 ITE 1812 - Mathematic for IT
Example 4.2
Furthermore:
A⊕B = (A \ B) ∪ (B \ A) = {1, 2, 5, 6, 7} ,
B⊕C = (B \ C) ∪ (C \ B) = {2, 4, 5, 6, 7, 8, 9} ,
A⊕C = (A \ C) ∪ (B \ C) = {1, 4, 8, 9}
and A ⊕ E = (A \ E) ∪ (E \ A) = {1, 3, 6, 8, 10, . . . } .
4
Degree of Bachelor of Information Technology 5
4.2.2 Duality
Suppose E is an equation of set algebra. The dual E ∗ of E is the equation obtained by replacing
each occurrence of ∪, ∩, U and ∅ in E by ∩, ∪, ∅, and U respectively.
(U ∩ A) ∪ (B ∩ A) = A is (∅ ∪ A) ∩ (B ∪ A) = A.
Note that the pairs of laws in Table 4.1 are duals of each other.
n (A ∪ B) = n(A) + n(B).
Proof
In counting the elements of A ∪ B, first count those that are in A. There are n(A) of these.
The only other elements of A ∪ B are those that are in B but not in A. But since A and B
are disjoint, no element of B is in A, so there are n(B) elements that are in B but not in A.
Therefore, n(A ∪ B) = n(A) + n(B).
For any sets A and B, the set A is the disjoint union of A \ B and A ∩ B. This leads to the
Corollary 4.1.
Corollary 4.1
Let A and B be finite sets. Then
Given any set A, recall that the universal set U is the disjoint union of A and AC . Accord-
ingly, Lemma 4.1 we can prove the Corollary 4.2.
Corollary 4.2
Let A be a subset of a finite universal set U . Then
There is a expression for n(A ∪ B) even when they are not disjoint, called the inclusion-
exclusion principle.
5
6 ITE 1812 - Mathematic for IT
That is, we find the number of elements in A or B by first adding n(A) and n(B) (inclusion)
and then subtracting n(A ∩ B) (exclusion) since its elements were counted twice.
We can apply this result to obtain a similar expression for three sets.
Corollary 4.3
Suppose A, B and C are finite sets. Then A ∪ B ∪ C is finite and
Example 4.3
Suppose a list A contains the 30 students in a mathematics class and a list B contains
the 35 students in an English class and suppose there are 20 names on both lists. Find
the number of students:
(c) on list A or B.
Solution.
We can draw a Venn diagram for the problem as in Figure 4.6.
6
Degree of Bachelor of Information Technology 7
(d) By using (a) and (b), 10 + 15 = 25. Therefore number of students on exactly one
list is 25.
Self-Assessment Exercises
1. Draw the Venn diagrams and shade the regions representing each of the following sets:
(a) (A ∪ B) \ C
(b) AC ∩ (B C ∪ C)
(c) (B C ∩ C C ) ∪ (AC ∩ B C ) ∪ (C C ∩ AC )
2. In a class of 80 students, 50 students know English, 55 know French and 46 know German
language. 37 students know English and French, 28 students know French and German,
25 students know English and German and 7 students know none of the languages. Find
out
3. It is known that in university 60% of the students play tennis, 50% of them play netball,
70% badminton, 20% play tennis and netball, 40% play netball and badminton and 30%
play tennis and badminton. If someone claimed that 20% students play badminton and
tennis and netball, would you believe his claim? Why?
Suggested Reading
Chapter 2: Kenneth Rosen, (2011) Discrete Mathematics and Its Applications, 7th Edition,
McGraw-Hill Education.