Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Set Theory

by
Dr. Anastasia Sofroniou
Sets
• A set is an collection of objects.
• The objects belonging to a set are also
called the elements of the set.
• A set is said to contain its elements.
• For example,
– all people in a class form a set,
– and each person is an element of that set.
Notation
• One way to describe a set is to list all its
elements between braces:
S = {a, b, c, d}
• The order in which the elements are listed
means nothing.
• Listing any element more than once does
not change the set.
• So {a, b, c, d} = {b, c, c, a, d, d}
Notation

• Sometimes the brace notation is used to


describe a set without listing all its
members.
• E.g. {1, 2, 3, …, 99} is the set of positive
integers less than 100.
Notation
• Another way to describe a set is to use the set
builder notation.
• In this case we define the set using predicates:
S = {x | P(x)}
S contains all the elements which make the
predicate P true.
• E.g. O = {x | x is an odd positive integer}
read as “O is the set of all x such that x is an odd
positive integer.”
Common Sets
• Some sets of numbers are used so often that
they have special symbols to denote them:
– = the set of all ‘real’ numbers.
– = {0, 1, 2, 3, …}, the set of all ‘natural’
numbers.
– = {…, -3, -2, -1, 0, 1, 2, 3, …}, the set of all
integers.
Common Sets
• Furthermore, there exists a unique set that
has no elements at all.
• This set is called the void set, the null set or
the empty set. It is denoted by {} or .
 = {} = {x|xx} = ... = {x|False}

• Any set containing exactly one element is


called a singleton set
Membership of a Set
• The phrase ‘x is an element of the set S’ is written
as
xS
• The phrase ‘x is not an element of the set S’ is
written as
xS
• Example: Let S = {1, 2, 3, 4, 5, 6, 7, 8}, then
5S
but
15  S
Subsets
• A set A is a subset of a set B if every
element of A is also in B, i.e.
x (xA  xB)
• Notation:
AB
or
BA
• Example: Let U = {1, 2, 3, …, 11, 12} and
T = {1, 2, 3, 4, 5, 6}, then T  U.
Subsets
• Two sets are equal if an only if every
element of the first is also in the second,
and vice versa; i.e.
A = B iff A  B and A  B
• If A  B, but A  B, then we write A  B
and we say that A is a proper subset of B.
• Example: Let A = {1, 2, 3}, B = {2, 1, 3}
and C = {3}, then B = A, C  A, C  B.
Subsets
• Any set S is always a subset of itself
SS
• The empty set is a subset of every set
{}  S
• If a set X is a subset of a set Y and Y is a
subset of another set Z, then X is a subset of
Z
X  Y and Y  Z implies X  Z
Cardinality
• The cardinality of a set S is the number of
(distinct) elements in S.
• We denote the cardinality of a set S as: |S|
• For example if Y = {3, 4, 5, 6, 7, 8}, then
|Y| = |{3, 4, 5, 6, 7, 8}| = 6
• If |S|N, then we say S is finite.
• Otherwise, we say S is infinite and we write
|S| = 
Cardinality Examples
• Some other examples are:
|{1, 2}| = 2 = |{a, b}|
|{}| = 0 the same as || = 0
|{a, Mon, yellow}| = 3
| | 
| | 
|{2n  1| n  }| 
Power Sets
• The power set of a set A is the set of all
subsets of A.
• It is written as P(A).
• Note that the empty set {} and the set A
itself are both elements of P(A).
• Examples:
P({a, b}) = {{a, b}, {a}, {b}, {}}
P({}) = { {} }

You might also like