Discrete Mathematics : Set Theory
Abid Afsan Hamid
Lecturer
CSE Department
Northern University of Business and Technology, Khulna
1 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set
● Set is the fundamental discrete structure on which all other
discrete structures are built.
● A set may be viewed as any well-defined collection of objects
● A set is an unordered collection of objects
2 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set
● Objects in the set are called the elements or members of the
set
● Synonyms for “set” are “class,” “collection,” and “family.”
● It is common for sets to be denoted using uppercase letters.
Lowercase letters are usually used to denote elements of
sets.
3 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set
4 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set
● There are several ways to describe a set. One way is to list all
the members of a set separated by commas, when this is
possible. We use a notation where all members of the set are
listed between braces.
● For example, the notation {a, b, c, d} represents the set with
the four elements a, b, c, and d. This way of describing a set
is known as the roster method.
5 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Examples
● The set V of all vowels in the English alphabet can be written
as V = {a, e, i, o, u}. The set O of odd positive integers less
than 10 can be expressed by O = {1, 3, 5, 7, 9}.
● Although sets are usually used to group together elements
with common properties, there is nothing that prevents a set
from having seemingly unrelated elements.
● For instance, {a, 2, Fred, New Jersey} is the set containing
the four elements a, 2, Fred, and New Jersey.
6 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Examples
● Sometimes the roster method is used to describe a set
without listing all its members. Some members of the set are
listed, and then ellipses (. . .) are used when the general
pattern of the elements is obvious.
● Example : the set of positive integers less than 100 can be
denoted by {1, 2, 3, . . . , 99}.
7 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Examples
● Another way to describe a set is to use set builder notation.
We characterize all those elements in the set by stating the
property or properties they must have to be members.
● Example : B = {x | x is an even integer, x > 0}
● B is the set of x such that x is an even integer and x is greater
than 0. A letter, usually x, is used to denote a typical member
of the set; and the vertical line | is read as “such that” and the
comma as “and.”
8 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Examples
● The set O of all odd positive integers less than 10 can be
written as
● O = {x | x is an odd positive integer less than 10},
OR
● specifying the universe as the set of positive integers, as
O = {x ∈ Z+ | x is odd and x < 10}.
9 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Examples
● Let E = {x | x2 − 3x + 2 = 0}, F = {2, 1} and G = {1, 2, 2, 1}.
Then E = F = G.
● We emphasize that a set does not depend on the way in
which its elements are displayed. A set remains the same if its
elements are repeated or rearranged.
● We describe a set by listing its elements only if the set
contains a few elements; otherwise we describe a set by the
property which characterizes its elements.
10 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Example of Special Symbol (set)
Example of Special Symbol (Set)
11 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Subsets
● Suppose every element in a set A is also an element of a set
B, that is, suppose a ∈ A implies a ∈ B. Then A is called a
subset of B.
● We also say that A is contained in B or that B contains A. This
relationship is written A ⊆ B or B ⊇ A
● Two sets are equal if they both have the same elements or,
equivalently, if each is contained in the other. That is:
A = B if and only if A ⊆ B and B ⊆ A
12 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Subsets
● If A is not a subset of B, that is, if at least one element of A
does not belong to B, we write
A⊆ B
● if A ⊆ B and A≠B, then we say A is a proper subset of B
(sometimes written A ⊂ B).
13 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Subsets
● Consider the sets:
A = {1, 3, 4, 7, 8, 9}, B= {1, 2, 3, 4, 5}, C= {1, 3}.
● Then C ⊆ A and C ⊆ B since 1 and 3, the elements of C, are
also members of A and B.
● But B A since some of the elements of B, e.g., 2 and 5, do
not belong to A. Similarly, A B.
14 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Subsets
● Example : let A = Z+ , B = {n ∈ Z | 0 ≤ n ≤ 100}, and C = {100,
200, 300, 400, 500}. Evaluate the truth and falsity of each of
the following statements.
● a. B ⊆ A
● b. C is a proper subset of A
● c. C and B have at least one element in common
● d. C ⊆ B
● e. C ⊆ C
15 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Subsets
● Solution a. False. Zero is not a positive integer. Thus zero is
in B but zero is not in A, and so B A.
● b. True. Each element in C is a positive integer and, hence, is
in A, but there are elements in A that are not in C. For
instance, 1 is in A and not in C.
● c. True. For example, 100 is in both C and B.
● d. False. For example, 200 is in C but not in B.
● e. True. Every element in C is in C.
16 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Conclusion
● Let A, B, C be any sets. Then:
● (i) A ⊆ A
● (ii) If A ⊆ B and B ⊆ A, then A = B
● (iii) If A ⊆ B and B ⊆ C, then A ⊆ C
17 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Universal Set
● All sets under investigation in any application of set theory are
assumed to belong to some fixed large set called the
universal set which we denote by U unless otherwise stated
or implied.
● A universal set is a set which contains all objects, including
itself and a Universal Set is the set of all elements under
consideration, denoted by capital U . All other sets are
subsets of the universal set.
18 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Empty Set
● Let S= {x | x is a positive integer, x2 = 3}
● Such a set with no elements is called the empty set or null set
and is denoted by ∅.
● A special set that has no elements. This set is called the
empty set, or null set.
19 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Singleton Set
● Theorem : For any set A, we have ∅ ⊆ A ⊆ U.
● A set with one element is called a singleton set. A common
error is to confuse the empty {∅} has one more element than
∅. {∅} which is a singleton set. The single element of the set
{∅} is the empty set itself!
20 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Disjoint Sets
● Two sets A and B are said to be disjoint if they have no
elements in common. For example, suppose A = {1, 2}, B=
{4, 5, 6}, and C = {5, 6, 7, 8}
● Then A and B are disjoint, and A and C are disjoint. But B and
C are not disjoint since B and C have elements in common,
e.g., 5 and 6.
● If A and B are disjoint, then neither is a subset of the other
(unless one is the empty set).
21 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Venn Diagrams
● A Venn diagram is a pictorial representation of sets in which
sets are represented by enclosed areas in the plane.
● The universal set U is represented by the interior of a
rectangle, and the other sets are represented by disks lying
within the rectangle.
22 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Venn Diagrams
● If A ⊆ B, then the disk representing A will be entirely within
the disk representing B. If A and B are disjoint, then the disk
representing A will be separated from the disk representing B.
● A and B are disjoint
23 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Union
● The following figure is a Venn diagram in which A ∪ B is
shaded.
24 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : 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}
● The following is a Venn diagram in which A ∩ B is shaded.
25 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations
● Sets A and B are said to be disjoint or non-intersecting if they
have no elements in common or, using the definition of
intersection, if A ∩ B = ∅, the empty set.
● Suppose S = A ∪ B and A ∩ B = ∅
● Then S is called the disjoint union of A and B.
26 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations
● Example : Let A = {1, 2, 3, 4}, B = {3, 4, 5, 6, 7}, C = {2, 3, 8,
9}. Then
● A ∪ B = {1, 2, 3, 4, 5, 6, 7}
● A∪ C = {1, 2, 3, 4, 8, 9}
● B∪ C = {2, 3, 4, 5, 6, 7, 8, 9},
● A ∩ B = {3, 4}, A∩ C = {2, 3}, B∩ C = {3}
27 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Complement
● All sets under consideration at a particular time are subsets of
a fixed universal set U. The absolute complement or, simply,
complement of a set A, denoted by AC, is the set of elements
which belong to U but which do not belong to A. That is,
● AC = {x | x ∈ U, x∉A}
● Some texts denote the complement of A’.
28 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Complement
● Following figure is a Venn diagram in which AC is shaded.
29 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Minus
● The relative complement of a set B with respect to a set A or,
simply, 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; that
is A\B = {x | x ∈ A, x∉B}
● The set A\B is read “A minus B.” Many texts denote A\B by A
− B or A ∼ B.
30 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Minus
● Following figure is a Venn diagram in which A\B is shaded.
31 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Symmetric Difference
● The symmetric difference of sets A and B, denoted by A ⊕ B,
consists of those elements which belong to A or B but not to
both. That is,
● A ⊕ B = (A ∪ B)\(A ∩ B) or A ⊕ B = (A\B) ∪ (B\A)
32 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Symmetric Difference
● Following figure is a Venn diagram in which A ⊕ B is shaded.
33 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Example
● Suppose U = N = {1, 2, 3, . . .} is the universal set. Let A = {1,
2, 3, 4}, B= {3, 4, 5, 6, 7}, C= {2, 3, 8, 9}, E= {2, 4, 6, . . .}
(Here E is the set of even integers.)
● Then: A’ = {5, 6, 7, . . .}
● B’ = {1, 2, 8, 9, 10, . . .}
● E’ = {1, 3, 5, 7, . . .}
● That is, E’ is the set of odd positive integers.
34 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Set Operations : Example
● Suppose U = N = {1, 2, 3, . . .} is the universal set.
● Let A = {1, 2, 3, 4}, B= {3, 4, 5, 6, 7}, C= {2, 3, 8, 9}, E= {2, 4,
6, . . .} (Here E is the set of even integers.)
● Also: A\B = {1, 2}, A\C = {1, 4}, B\C = {4, 5, 6, 7}, A\E = {1, 3},
● B\A = {5, 6, 7}, C\A = {8, 9}, C\B = {2, 8, 9},
● E\A = {6, 8, 10, 12, . . .}, A ⊕ B = (A\B) ∪ (B\A) = {1, 2, 5, 6,
7}, B⊕ C = {2, 4, 5, 6, 7, 8, 9}, A ⊕ C = (A\C) ∪ (C\A) = {1, 4,
8, 9}, A⊕ E = {1, 3, 6, 8, 10, . . .}.
35 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Algebra of Sets
● Sets under the operations of union, intersection, and
complement satisfy various laws (identities) which are listed in
the following Table.
36 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Algebra of Sets
37 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Duality
● The identities in previous Table are arranged in pairs, as, for
example, (2a) and (2b).We now consider the principle behind
this arrangement. 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.
● For example, dual of (U ∩ A) ∪ (B ∩ A) = A is
(∅ ∪ A) ∩ (B ∪ A) = A
38 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Counting Principle
● Let A be a subset of a finite universal set U. Then n(AC)= n(U)
− n(A)
● Suppose a class U with 30 students has 18 full-time students.
Then there are 30−18 = 12 part-time students in the class U.
39 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Counting Principle
● Suppose A and B are finite sets. Then A ∪ B and A ∩ B are
finite and n(A ∪ B) = n(A) + n(B) − n(A ∩ B)
● That is, we find the number of elements in A or B (or both) by
first adding n(A) and n(B) (inclusion) and then subtracting n(A
∩ B) (exclusion) since its elements were counted twice.
40 CSE Department, Northern Uni. Of Business & Technology 09/04/2023
Power Sets
● For a given set S , we may speak of the class of all subsets of
S. This class is called the power set of S , and will be denoted
by P(S). If S is finite, then so is P(S). In fact, the number of
elements in P(S) is 2 raised to the power n(S). That is,
n(P(S)) = 2n(S)
● Suppose S = {1, 2, 3}. Then P(S) = [∅, {1}, {2}, {3}, {1, 2}, {1,
3}, {2, 3}, S], note that the empty set ∅ belongs to P(S) since ∅
is a subset of S. Similarly, S belongs to P(S).
41 CSE Department, Northern Uni. Of Business & Technology 09/04/2023