Sets
Sets
Sets
BASIC
STRUCTURES:
SETS
• 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}.
• The set of positive integers less than 100 can be denoted by {1, 2, 3, … , 99}
How to describe a set by saying what properties its
members have.
Intervals Notation
Types of Set
Finite Set
A set which contains a definite number of elements is called a finite set.
Infinite Set
A set which contains infinite number of elements is called an infinite set.
Example − S={ x | x∈N and x>10}
Subset
A set X is a subset of set Y (Written as X⊆Y) if every element of X is an element of set Y.
Example 1 − Let, X={1,2,3,4,5,6} and Y={1,2}.
Here set Y is a subset of set X as all the elements of set Y is in set X. Hence, we can write
Y⊆X.
Example 2 − Let, X={1,2,3} and Y={1,2,3}.
Here set Y is a subset (Not a proper subset) of set X as all the elements of set Y is in set X.
Hence, we can write Y⊆X.
Proper Subset Types of Set
The term “proper subset” can be defined as “subset of but not equal to”.
A Set X is a proper subset of set Y (Written as X⊂Y) if every element of X
is an element of set Y and |X|<|Y|.
Example − Let, X={1,2,3,4,5,6} and Y={1,2}. Here set Y⊂X since all elements in Y
are contained in X too and X has at least one element is more than set Y.
Universal Set
It is a collection of all elements in a particular context or application. All the sets in that
context or application are essentially subsets of this universal set. Universal sets are
represented as U.
Example − We may define U as the set of all animals on earth. In this case, set of
all mammals is a subset of U, set of all fishes is a subset of U, set of all insects is a
subset of U, and so on.
Equivalent Set
If the cardinalities of two sets are same, they are called equivalent sets.
Example − If A={1,2,6} and B={16,17,22},
they are equivalent as cardinality of A is equal to the cardinality of B.
i.e. |A|=|B|=3
Equal Set
If two sets contain the same elements they are said to be equal.
Example − If A={1,2,6} and B={6,1,2}, they are equal as every
element of set A is an element of set B and every element of set B is
an element of set A.
Another look at Equality of Sets
Types of Set
Overlapping Set
Two sets that have at least one common element are called overlapping sets.
Example − Let, A={1,2,6} and B={6,12,42}.
There is a common element ‘6’, hence these sets are overlapping sets.
Disjoint Set
Two sets A and B are called disjoint sets if they do not have even one element in
common.
Therefore, disjoint sets have the following properties −
n(A∩B)=∅
n(A∪B)=n(A)+n(B)
Example − Let, A={1,2,6} and B={7,9,14}, there is not a single common
element, hence these sets are disjoint sets.
What is the power set of the set {0, 1, 2}?
Solution: The power set ({0, 1, 2}) is the set of all subsets of {0, 1, 2}.
Hence, Examples ({0, 1, 2}) = {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}.
Note that the empty set and the set itself are members of this set of subsets
Truth Sets
and
Quantifiers
Set Operation Venn Diagrams
If sets A and B are represented as regions in the plane, relationships
between A and B can be represented by pictures, called Venn
diagrams, that were introduced by the British mathematician John
Venn in 1881.
Set Operation
Union of Sets: Union of Sets A and B is defined to be the set of all those elements which belong to A or B or
both and is denoted by A∪B.
A∪B = {x: x ∈ A or x ∈ B}
Example: Let A = {1, 2, 3}, B= {3, 4, 5, 6}
A∪B = {1, 2, 3, 4, 5, 6}.
|A ∪ B|=|A|+|B|−|A ∩ B|
Principle of inclusion–exclusion.
Intersection of Sets: Intersection of two sets A and B is the set of all those elements which belong to both
A and B and is denoted by A ∩ B.
A ∩ B = {x: x ∈ A and x ∈ B}
Example: Let A = {11, 12, 13}, B = {13, 14, 15}
A ∩ B = {13}.
Difference of Sets: The difference of two sets A and B is a set of all those elements which belongs to A but
do not belong to B and is denoted by A - B.
A - B = {x: x ∈ A and x ∉ B}
Example: Let A = {1, 2, 3, 4} and B = {3, 4, 5, 6}
then A - B = {3, 4} and B - A = {5, 6}
Set Operation
Complement of a Set: The Complement of a Set A is a set of all those elements of
the universal set which do not belong to A and is denoted by Ac.
A ⨁ B = (A ∪ B) - (A ∩ B)
Example: Let A = {a, b, c, d}
B = {a, b, l, m}
A ⨁ B = {c, d, l, m}
Set Identities Generalized Unions and Intersections
Methods of identity Proof
1. Prove that each set (side of the identity) is a subset of the other.
2. Use set builder notation and propositional logic.
3. Membership Tables:Verify that elements in the same combination of sets
always either belong or do not belong to the same side of the identity. Use 1
to indicate it is in the set and a 0 to indicate that it is not.
Proving Set
Identities
Proof of Second De Morgan Law
Set-Builder Notation: Second De Morgan Law
Use a membership table to show that A ∩ (B ∪ C) = (A ∩ B) ∪ (A
∩ C).
Generalized Unions and
Intersections
Computer Representation of Sets
There are various ways to represent sets using a computer. One method is to store the
elements of the set in an unordered fashion. However, if this is done, the operations of
computing the union, intersection, or difference of two sets would be time-consuming,
because each of these operations would require a large amount of searching for elements.
We will present a method for storing elements using an arbitrary ordering of the elements of
the universal set. This method of representing sets makes computing combinations of sets
easy.
Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and the ordering of elements of U has the elements in increasing order;
that is,
ai = i. What bit strings represent the subset of all odd integers in U, the subset of all even integers in U, and
the subset of integers not exceeding 5 in U?
The bit string that represents the set of odd integers in U, namely, {1, 3, 5, 7, 9}, has a one bit
in the first, third, fifth, seventh, and ninth positions, and a zero elsewhere.
It is 10 1010 1010.
(We have split this bit string of length ten into blocks of length four for easy reading.)
Similarly, we represent the subset of all even integers in U, namely, {2, 4, 6, 8, 10},
by the string 01 0101 0101.
The set of all integers in U that do not exceed 5, namely, {1, 2, 3, 4, 5}, is represented
by the string 11 1110 0000.