Professional Documents
Culture Documents
Set Theory
Mathematics
• Already been introduced to the
concepts of sets, sequences,
and functions, and we’ve used
them informally several times
Set
• What is a set? Well, simply put, it's a collection
• First we specify a common property among "things" (we define
this word later) and then we gather up all the "things" that have
this common property.
Set of clothes
For example, the items you wear: hat, shirt, jacket, pants, and so on.
You could come up with at least a hundred. This is known as a set.
For A ⊂ B to be true, it must be the case that A ⊆ B and there must exist an element x of B that
is not an element of A, i.e.
∀x(x ∈ A → x ∈ B) ∧ ∃x(x ∈ B ∧ x ∉ A)
Cardinality of Set
Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative integer,
then S is a finite set.
n is the cardinality of S, denoted by |S|.
A set is said to be infinite if it is not finite. Example:
1. A be the set of odd positive integers less than 10, |A| =5
2. S be the set of letters in the English alphabet, |S| =?
Power set
Let S be a set.
The power set of S is the set of all subsets of S, denoted by P(S). If a set has n elements, then its power
set has 2n elements
P({a ,b }) = {Ø,{a},{b},{a ,b }}
Set
Ordered n-tuples
The ordered n-tuple (a1, a2,...,an) is the ordered collection that has a1 as its first
element, a2 as its second element,..., and an as its nth element.
• a1 as its first element
• a2 as its second element
• ...
• an as its nth element
•Example: (a ,b ) is an ordered 2-tuple (ordered pair).
Ordered n-tuple
Let A=(a1, a2, …, an) and B=(b1, b2, …, bn) be ordered
n-tuples.
A and B are equal if and only if each corresponding pair of their
elements are equal, denoted by A=B. A=B if and only ai = bi
and for i = {1,2,…,n}
Example: Assume c ≠ b.
Are ordered 3-tuples (a ,b ,c ) and (a ,c ,b ) equal?
Set
• Cartesian product
•Let A and B be sets.
• The Cartesian product of A and B, denoted by A × B,
• is the set of all ordered pairs (a, b), where a ∈ A and
• b ∈ B. Hence,
A × B = {(a, b) | a ∈ A ∧ b ∈ B}.
Example:
•Cartesian product of A = {1, 2} and B = {a, b, c}? A × B = {(1, a), (1, b), (1, c), (2, a), (2,
b), (2, c)}
•The Cartesian product of sets A1, A2, …, An, denoted by A1 × A2 × … × An is the set of ordered n-tuples (a1,
a2, …, an), where ai belongs to Ai for i = 1,2, …, n.
Representation
• Roster Form { 5; 13; 17; 29; 37; 41; 53; 61; 73; : : : :}
• Venn Diagram
Representation
Statement (or Descriptive) Form
Set of apple, orange, pear, and banana Roster (or List) Form
N: Set of all natural numbers
Z: Set of all integers
Q: Set of all rational numbers
R: Set of all real numbers
Z+: Set of all positive integers
Set-builder notation
Representation
Set-builder notation
(general form)
(potential)
(Actual)
Representation
Statement Form
Triadic set of apple, orange, pear, and banana
N: Triadic set of all natural numbers
Roster Form
Z: Triadic set of all integers
or
(general form)
Actualized
(potential)
(non-actualized
potential) or
(Actual)
Representation
• Venn Diagram
Sets can be represented graphically using Venn diagram.
There are 100 students in a year group.
38 of them do archery. This information
can be shown on a Venn diagram.
• Universal set U contains all objects under consideration say English alphabets
is represented by a rectangle
• Other geometric figures are used to represent sets. Say set of vowels
• Points are used to represent particular elements of sets. i.e. a, e, i, o, u
Show set A={a,b,c} using Venn diagram
Operation
• Two sets can be combined in many different ways.
• Set operations can be used to combine sets.
Union
Let A and B be sets.
The union of A and B, denoted by A ∪ B, is
the set containing those elements that are either in A or
in B, or in both. A ∪ B = {x | x ∈ A ∨ x ∈ B}.
Shaded area represents A U B.
Intersection
Let A and B be sets.
The intersection of A and B, denoted by
A ∩ B, is the set containing those elements in both A and B.
A ∩ B = {x | x ∈ A ∧ x ∈ B}
• A – B is shaded.
Operation
Complement
Let U be the universal set and A be a set.
The complement A, denoted by Ā, is the com-
plement of A with respect to U (which is U-A).
Ā = {x ∈ U | x ∉ A}.
Disjoint • Ā is shaded.
Two sets are called disjoint if their intersection is the empty set.
Example;
Let A = {1, 3, 5, 7, 9} and B = {2, 4, 6, 8, 10}.
A ∩ B = ∅, thus
A and B are disjoint
Generalized Union Generalized Intersection
The union of a collection of sets is the set that The intersection of a collection of sets is the
contains those elements that are members of at set that contains those elements that are
least one set in the collection. members of all the sets in the collection.
We use the notation We use the notation
A1 ∪ A2 ∪ · · · ∪ An =
to denote the union of the sets A1, A2, . . . , An A1 ∩ A2 ∩ · · · ∩ An =
Set Identities
• Much like the logical equivalences there are set identities which arise
frequently and can be proved using the definitions.
Membership Tables
Set data structures are commonly used in a variety of computer science applications, including
• algorithms,
• data analysis
• databases.
The main advantage of using a set data structure is that it allows you to perform operations on a
collection of elements in an efficient and organized way.
In data structures, sets are often used to store and organize information. For example, sets can
be used to implement data structures such as hash tables and bloom filters. These data structures
rely on set operations such as union, intersection, and difference to efficiently store and retrieve
data.
In graph theory, sets are used to represent the vertices and edges of a graph. The set notation is
used to represent the relationships between the vertices and edges, and set operations are used
to perform operations such as finding the shortest path between two nodes.
In algorithms, set notation is also used to represent and manipulate sets of data.
In Database Set-based operations are used to manipulate and query databases, making it easy to
retrieve and analyze large amounts of data.
Application
In Java,
Set<Obj> set = new HashSet<Obj>
();
hash_Set.add(“apple");
hash_Set.add(“orange");
hash_Set.add(“pear");
hash_Set.add(“banana");
In C++, In Javascript,
Set is a data structure
Const A = new Set([ “apple“,“orange“, “pear“,
“banana“]);
In Python,
thisset = {"apple", “orange", “pear", “banana"}
In Golang,
Set is a data structure implemented using maps
Paradox
A seemingly absurd or self-contradictory statement that is or may be true
• 2=4 This sentence is false
Zeno’s Paradox
“That which is in locomotion must arrive
at the half-way stage before it arrives at
the goal.”
• Banach-Tarski Paradox
• The complement of a fuzzy set S is the set S, with the degree of the
membership of an element in S equal to 1 minus the degree of
membership of this element in S. Find F (the fuzzy set of people
who are not famous) and R (the fuzzy set of people who are not
rich).
• The union of two fuzzy sets S and T is the fuzzy set S ∪ T , where
the degree of membership of an element in S ∪ T is the maximum
of the degrees of membership of this element in S and in T . Find
the fuzzy set F ∪ R of rich or famous people.
• The intersection of two fuzzy sets S and T is the fuzzy
set S ∩ T , where the degree of membership of an element
in S ∩ T is the minimum of the degrees of membership
of this element in S and in T . Find the fuzzy set F ∩ R
of rich and famous people.