2. Sets and Elements
• Definition of a set:
– A set is simply a collection of objects or elements or
members.
• E.g. A={1,2,3,4} describe a set A made up of four elements 1, 2,
3, and 4.
– A set is determined by its elements and not by any
particular order in which the elements might be listed.
Hence above mentioned set can be expressed as:
• E.g. A={1,3,4,2}
– Elements making up a set as assumed to be distinct
– Only one occurrence of each element even if there are
duplicates in the set:
• E.g. A={1,2,3,3,4}
3. Specifying a Set
• Roster Method
– List all the members of a set, when this is possible.
– All members of the set are listed between braces
– E.g.
• V = {a, e, i, o, u}.
• O = {1, 3, 5, 7, 9}
– 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.
4. Specifying a Set
• Set Builder
– Characterize all those elements in the set by
stating the property or properties they must have
to be members.
– E.g.
• 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}
• the universe as the set of positive integers as
– O = {x ∈ Z+ | x is odd and x < 10}
5. Set Notation
• N = {0, 1, 2, 3,...}, the set of natural numbers
• Z = {..., −2, −1, 0, 1, 2,...}, the set of integers
• Z+ = {1, 2, 3,...}, the set of positive integers
• Q = {p/q | p ∈ Z, q ∈ Z, and q = 0}, the set of
rational numbers
• R, the set of real numbers
• R+, the set of positive real numbers
• C, the set of complex numbers.
6. Intervals
• [a, b] ={x | a ≤ x ≤ b} closed interval
• [a, b) ={x | a ≤ x<b}
• (a, b] ={x | a<x ≤ b}
• (a, b) ={x | a<x<b} open interval
7. Universal Set
• In any application of the theory of set, the
numbers of all sets under investigation usually
belong to some fixed large set called Universal
Set
• It is represented by U unless otherwise
specified.
8. Empty Set
• There is a special set that has no elements.
• This set is called the empty set, or null set, and is
denoted by ∅.
• The empty set can also be denoted by { } (that is,
we represent the empty set with a pair of braces
that encloses all the elements in this set).
• Often, a set of elements with certain properties
turns out to be the null set. For instance, the set
of all positive integers that are greater than their
squares is the null set.
9. Singleton Set
• A set with one element is called a singleton
set.
• A common error is to confuse the empty {∅}
has one more element than ∅.
• Set ∅ with the set {∅}, which is a singleton set.
• The single element of the set {∅} is the empty
set itself.
10. Venn Diagram
• Sets can be represented graphically using Venn
diagrams
• In Venn diagrams
– the universal set U, which contains all the objects
under consideration, is represented by a rectangle.
– Inside this rectangle, circles or other geometrical
figures are used to represent sets.
– Sometimes points are used to represent the particular
elements of the set.
– Sometimes points are used to represent the particular
elements of the set.
11.
12. Subsets
• It is common to encounter situations where the elements of one
set are also the elements of a second set.
• The set A is a subset of B if and only if every element of A is also an
element of B.
OR
• If every element is a set A is also an element of a set B then A is
called a subset of B.
• We use the notation A ⊆ B to indicate that A is a subset of the set
B.
• If at least one element of A does not belong to B, we write A ⊈ B
• If A⊆B, then it is still possible that A=B.
• When A⊆B, but A≠B, we say A is a proper subset of B written a
A⊂B.
13. Subsets
• Examples
– Suppose there are three sets A, B, and C as
following
• A={1,3}
• B={1,2,3}
• C={1,3,2}
– Sets A and B both are subsets of Set C
• Set A is a proper subset of Set C A⊂C
• Set B is an improper subset of Set C B⊆C
14.
15. Finite Sets
• A set is said to be finite if it contains exactly n
elements where n is a nonnegative integer.
• Finite set have a one-to-one correspondence
between the elements in the set and the
element in some set n, where n is a natural
number and n is cardinality of the set.
16. Cardinality
• It is a measure of the "number of distinct
elements of the set".
• Let S be a set. If there are exactly n distinct
elements in S where n is a nonnegative integer,
• we say that S is a finite set and that n is the
cardinality of S.
• Cardinality of S is denoted by |S|.
• For example, the set A = {2, 4, 6} contains 3
distinct elements, and therefore A has
a cardinality of 3.
17. Infinite Sets
• Definition:
– A set which is not finite, is called an infinite set.
• Countable Infinite Sets
– A set is countably infinite if its elements can be put in one-to-
one correspondence with the set of natural numbers. In other
words, one can count off all elements in the set in such a way
that, even though the counting will take forever, you will get to
any particular element in a finite amount of time.
– For example, the set of integers {0,1,−1,2,−2,3,−3,…} is clearly
infinite. However, as suggested by the above arrangement, we
can count off all the integers.
– Counting off every integer will take forever. But, if you specify
any integer, say −10,234,872,306, we will get to this integer in
the counting process in a finite amount of time.
18. Power Sets
• Many problems involve testing all
combinations of elements of a set to see if
they satisfy some property.
• To consider all such combinations of elements
of a set S, we build a new set that has as its
members all the subsets of S.
• Given a set S, the power set of S is the set of
all subsets of the set S. The power set of S is
denoted by P(S).
19. Power Sets
• Example
– What is the power set of the set {0, 1, 2}?
– The power set P({0, 1, 2}) is the set of all subsets
of {0, 1, 2}.
– Hence, P({0, 1, 2}) = {∅, {0}, {1}, {2}, {0, 1}, {0, 2},
{1, 2}, {0, 1, 2}}.
20. Cartesian Products
• Because sets are unordered
– A different structure is needed to represent
ordered collections.
– This is provided by ordered n-tuples.
• Definition
– 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}.
21. Cartesian Products
• 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.
• The Cartesian product
– of the 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.
• In other words,
– A1 × A2 ×・ ・ ・×An = {(a1, a2, . . . , an) | ai ∈ Ai for i =
1, 2, . . . , n}.
22. Cartesian Products
• Examples #1
– What is the Cartesian product of A = {1, 2} and B = {a,
b, c}?
– The Cartesian product A × B is
• A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}.
• Example #2
– What is the Cartesian product A × B × C, where A = {0,
1}, B = {1, 2}, and C = {0, 1, 2} ?
• A × B × C = {(0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 0), (0, 2, 1), (0, 2,
2), (1, 1, 0), (1, 1, 1), (1, 1, 2), (1, 2, 0), (1, 2, 1), (1, 2, 2)}.
23. Set Operations
• Union
– of sets A and B contains elements in A, B or
both A ∪ B = { x | x ∈ A v x ∈ B}
– Example
• {1, 2, 3} ∪ {3, 4} = {1, 2, 3, 4}
• {1, 2, 3} ∪ {1, 2, 3} = {1, 2, 3}
24.
25. Set Operations
• Intersection
– of sets A and B contains those elements in both A
and B
– A ∩ B = { x | x ∈ A ^ x ∈ B}
– Example
• {1, 2, 3} ∩ {3, 4} = { 3 }
• {1, 2, 3} ∩ {4} = ∅
• {1, 2, 3} ∩ {1, 2, 3} = {1, 2, 3}
26.
27. Set Operations
• Disjoint
– when intersection is empty A ∩ B = ∅.
– Example
• {1, 2 } ∩ {3, 4} = ∅
• Cardinality of union.
– |A ∪ B| = |A| + |B| - |A ∩ B|
• Difference,
– A - B is set containing elements in A but not in B.
– A - B = { x | x ∈ A ^ x ∉ B}
28.
29. Set Operations
• Complement, U - A or Ac
– is with respect to the universal set, U.
• A = { x | x ∈ U ^ x ∉ A}
• A = { x | x ∉ A}
30.
31. Set Operations
• Fundamental Products
– Consider n distinct sets A1, A2, A3, …, An. A
fundamental product of the sets is a set of the
form
AAAA n
**
3
*
2
*
1 ...
32. Set Operations
• Fundamental Products
– Example: Consider three sets A, B, and C. The following
lists the eight fundamental products of the three sets
– P1 = A∩B∩C
– P2 = A∩B∩Cc
– P3 = A∩Bc∩C
– P4 = A∩Bc∩Cc
– P5 = Ac∩B∩C
– P6 = Ac∩B∩Cc
– P7 = Ac∩Bc∩C
– P8 = Ac∩Bc∩Cc
33. Set Operations
• Symmetric Difference
– The symmetric difference of sets A and B, denoted
by A ⊖B, consists of those elements which belong
to Set A or Set B but not to both that is
• A⊖B = (AB)∪(A∩B) or A⊖B = (AB)∪(BA)
– Example: Suppose A={1,2,3,4,5,6} and
B={4,5,6,7,8,9}.
– Then AB={1,2,3} and BA={7,8,9}
– A⊖B = {1,2,3,7,8,9}
35. Inclusion-Exclusion Principle
• The inclusion–exclusion principle is a counting
technique which generalizes the familiar
method of obtaining the number of elements
in the union of two finite sets; symbolically
expressed as
– n(A∪B) = n(A) + n(B)
– n(A∪B) = n(A) + n(B) – n(A∩B)
36.
37. Partitions
• Let S be a non-empty set.
• A Partition of S is a sub-division of S into subsets
that are
– Non-overlapping
– Non-empty
• Precisely, a partition of S is a collection {Ai} of
non-empty subsets of S such that:
– Each a in S belongs to one of the Ai
– The sets of {Ai} are mutually disjoint that is, if
• Ai≠ Aj then Ai∩ Aj= Ø
40. Multisets
• Sets:
– An unordered collection of distinct objects.
• Multisets:
– Sets in which some elements occur more than once
– A={1,1,1,2,2,3}
• Notation to represent a multiset by:
– S={n1.a1,n2.a2,…,ni.ai}
– This denotes that a1 occurs n1 times
– The number ni=1,2,3,.. Are called multiplicities of the
elements ni.
– A={3.1,2.2,1.3}
41. Union of Multisets
• The union of the multisets A and B is the
multiset where the multiplicity of an element
is the maximum of its multiplicities in A and B
42. Intersection Multisets
• The Intersection of A and B is the multiset
where the multiplicity of an element the
minimum of its multiplicities in A and B.
43. Difference of Multisets
• The difference of A and B is the multiset
where the multiplicity of an element is the
multiplicity of element in A less its multiplicity
in B unless this difference is negative, in which
case the multiplicity is zero.
44. Sum of Multisets
• The Sum of A and B is the multiset where the
multiplicity of an element is sum of
multiplicities in set A and set B denoted by
A+B.
63. { } set (a,b) ordered pair a∈A element of
| such that A×B cartesian product x∉A not element of
A ∩ B intersection |A| cardinality A - B relative complement
A ∪ B union #A cardinality A ⊖ B symmetric difference
A ⊆ B subset aleph-null
A ⊂ B proper subset / strict subset aleph-one
A ⊄ B not subset Ø empty set
A ⊇ B superset universal set
A ⊃ B proper superset / strict superset 0
natural numbers / whole
numbers set (with zero)
A ⊅ B not superset 1
natural numbers / whole
numbers set (without
zero)
2A power set integer numbers set
power set rational numbers set
A = B equality real numbers set
Ac complement complex numbers set
A B relative complement A ∆ B symmetric difference