Sets in discrete math
Definitions
Set - is an unordered collection of objects. Usually sets are denoted by capital letters. A set contains its elements.
In the example above, the special character means that the lower case letter is an element of the set . If is not an element of , we write .
When two sets contain the same elements, they are said to be equal. = {e}, = {e} means that or provided that .
Describing sets
Roster method There are a few ways of describing sets. One of them is the roster method. In roster method curly braces are used to list out the elements of a set. = 3 is a set of positive integers between 1 and 3 inclusive. It is fundamental to note that the order inside set does not matter: 2 = 3 because 2 and 3, that is
- 2 3).
Also, notice that we separate the elements with comma and we ignore the duplicates.
When the quantity of the elements is large, roster method does not fit well for the purpose. We would not want to list out all 1000 elements when we need to create a set that contains integers from 1 to 1000. One solution is to use three dots ... (which is also called ellipsis). So = {1,2,3 ..., 1000} would describe a set with positive integers 1 to 1000.
Set-builder notation A set can also be described as set-builder notation = {} - set of all objects for which the predicate is true. A set of all even positive integers less than 5 can be written as
- = { is an even integer less than 5}
Or = {1,2,3 ..., 1000} can be written as
- = { is a whole number and 1 1000}
Some sets appear so often that they have special notations for them.
Set | Definition |
---|---|
= {0,1,2,3, } | Natural numbers |
= { -2,-1,0,1,2,3, } | Integers |
= { -2,-1,0,1,2,3, } | Positive integers |
= { and are integers with } | Rational Numbers |
= { is a real number} | Real numbers |
= { is a positive real number} | Positive real numbers |
Empty and Universal sets
- - is the notation to define an empty set (also written as )
- denotes a universal set
For example, = {} =
There are two traps that a lot of people fall into when dealing with sets.
- This is incorrect because it is like comparing apples and oranges, one of them is set and the other one is a number
- = {} This is incorrect as well because the left side is an empty set while the right side is a set with a single element (which is also called a singleton set)
Subsets If every element of set is also an element of set , we can say that is a subset of or . For example,
- when is true
- {apple, banana, cherry} {apple, banana, cherry, lemon, kiwi}
- {4,5,6} {7,8,4,5,6}
When an element exists in one set and not in the other, we use the notation:
- {2,3,4} {3,4,5,6} because the number 2 is not present in the second set
The empty set is a subset of every set
Proper set When every elements of set is also an element of set but there is at least one element in set that is not in set , is a proper subset of . In symbols we write . For example,
- {3,4} {3,4,5,6}
Cardinality Cardinality of a set is the number of elements a set contains. For example, = {6,7,8,9} has four elements, therefore the cardinality of the set is 4, often written as || = 4. The empty set has a cardinality of 0: = =
- = 0
A set can be finite and infinite. The cardinality symbol | | above is used to describe finite sets.
Power sets Let's say there is a set which contains and :
- = {}.
If wanted to get the all subsets of set , they would be the followings:
- (since it is a subset of any set)
- {}
- {}
- {}
Now, the power set of , is the set of all subsets. It is denoted by the special sign
- = {}
- = {, {}, {}, {}}
If the size of a set is written as
- =
then the size of a power set is