1.3 Sets
The most fundamental objects we will use in our studies (and really in all of math) are sets. Much of what follows might be review, but it is very important that you are fluent in the language of set theory. Most of the notation we use below is standard, although some might be a little different than what you have seen before.
For us, a set will simply be an unordered collection of objects. Two examples: we could consider the set of all actors who have played The Doctor on Doctor Who, or the set of natural numbers between 1 and 10 inclusive. In the first case, Tom Baker is an element (or member) of the set, while Idris Elba, among many others, is not an element of the set. Also, the two examples are of different sets. Two sets are equal exactly if they contain the exact same elements. For example, the set containing all of the vowels in the declaration of independence is precisely the same set as the set of vowels in the word “questionably” (namely, all of them); we do not care about order or repetitions, just whether the element is in the set or not.
Notation
We need some notation to make talking about sets easier. Consider,
.
This is read, “ is the set containing the elements 1, 2 and 3.” We use curly braces “” to enclose elements of a set. Some more notation:
.
The symbol “” is read “is in” or “is an element of.” Thus the above means that is an element of the set containing the letters , , and . Note that this is a true statement. It would also be true to say that is not in that set:
.
Be warned: we write “” when we wish to express that one of the elements of the set is . For example, consider the set,
.
This is a strange set, to be sure. It contains four elements: the number 1, the letter b, the set , and the empty set , the set containing no elements. Is in ? The answer is no. None of the four elements in are the letter , so we must conclude that . Similarly, consider the set . Even though the elements of are elements of , we cannot say that the set is one of the elements of . Therefore . (Soon we will see that is a subset of , but this is different from being an element of .)
We have described the sets above by listing their elements. Sometimes this is hard to do, especially when there are a lot of elements in the set (perhaps infinitely many). For instance, if we want to be the set of all even natural numbers, would could write,
, but this is a little imprecise. A better way would be
.
Let's look at this carefully. First, there are some new symbols to digest: “” is the symbol usually used to denote that natural numbers, which we will take to be the set . Next, the colon, “:”, is read such that; it separates the elements that are in the set from the condition that the elements in the set must satisfy. So putting this all together, we would read the set as, “the set of all in the natural numbers, such that there exists some in the natural numbers for which is twice .” In other words, the set of all natural numbers, that are even. Here is another way to write the same set.
.
Note: Sometimes mathematicians use or for the “such that” symbol instead of the colon. Also, there is a fairly even split between mathematicians about whether is an element of the natural numbers, so be careful there.
This notation is usually called set builder notation. It tells us how to build a set by telling us precisely the condition elements must meet to gain access (the condition is the logical statement after the “” symbol). Reading and comprehending sets written in this way takes practice. Here are some more examples:
There is also a subtle variation on set builder notation. While the condition is generally given after the “such that”, sometimes it is hidden in the first part. Here is an example.
We already have a lot of notation, and there is more yet. Below is a handy chart of symbols. Some of these will be discussed in greater detail as we move forward.
Relationships Between Sets
We have already said what it means for two sets to be equal: they have exactly the same elements. Thus, for example,
.
(Remember, the order the elements are written down in does not matter.) Also,
since these are all ways to write the set containing the first three positive integers (how we write them doesn't matter, just what they are).
What about the sets and ? Clearly , but notice that every element of is also an element of . Because of this we say that is a subset of , or in symbols or . Both symbols are read “is a subset of.” The difference is that sometimes we want to say that is either equal to or is a subset of , in which case we use . This is analogous to the difference between and .
In the example above, is a subset of . You might wonder what other sets are subsets of . If you collect all these subsets of into a new set, we get a set of sets. We call the set of all subsets of the power set of , and write it .
Another way to compare sets is by their size. Notice that in the example above, has 6 elements and , , and all have 3 elements. The size of a set is called the set's cardinality. We would write , , and so on. For sets that have a finite number of elements, the cardinality of the set is simply the number of elements in the set. Note that the cardinality of is 3. We do not count repeats (in fact, is exactly the same set as ). There are sets with infinite cardinality, such as , the set of rational numbers (written ), the set of even natural numbers, and the set of real numbers (). It is possible to distinguish between different infinite cardinalities, but that is beyond the scope of this text. For us, a set will either be infinite, or finite; if it is finite, the we can determine its cardinality by counting elements.
Operations On Sets
Is it possible to add two sets? Not really, however there is something similar. If we want to combine two sets to get the collection of objects that are in either set, then we can take the union of the two sets. Symbolically,
, read, “ is the union of and ,” means that the elements of are exactly the elements which are either an element of or an element of (or an element of both). For example, if and , then .
The other common operation on sets is intersection. We write,
and say, “ is the intersection of and ,” when the elements in are precisely those both in and in . So if and , then .
Often when dealing with sets, we will have some understanding as to what “everything” is. Perhaps we are only concerned with natural numbers. In this case we would say that our universe is . Sometimes we denote this universe by . Given this context, we might wish to speak of all the elements which are not in a particular set. We say is the complement of , and write,
when contains every element not contained in . So, if our universe is , and , then .
Of course we can perform more than one operation at a time. For example, consider
.
This is the set of all elements which are both elements of and not elements of . What have we done? We've started with and removed all of the elements which were in . Another way to write this is the set difference:
.
It is important to remember that these operations (union, intersection, complement, and difference) on sets produce other sets. Don't confuse these with the symbols from the previous section (element of and subset of). is a set, while is true or false. This is the same difference as between (which is a number) and (which is false).
Having notation like this is useful. We will often want to add or remove elements from sets, and our notation allows us to do so precisely.
You might notice that the symbols for union and intersection slightly resemble the logic symbols for “or” and “and.” This is no accident. What does it mean for to be an element of ? It means that is an element of or is an element of (or both). That is,
.
Similarly,
.
Also,
. which says is an element of the complement of if is not an element of .
There is one more way to combine sets which will be useful for us: the Cartesian product, . This sounds fancy but is nothing you haven't seen before. When you graph a function in calculus, you graph it in the Cartesian plane. This is the set of all ordered pairs of real numbers . We can do this for any pair of sets, not just the real numbers with themselves.
Put another way, . The first coordinate comes from the first set and the second coordinate comes from the second set. Sometimes we will want to take the Cartesian product of a set with itself, and this is fine: (we might also write for this set). Notice that in , we still want all ordered pairs, not just the ones where the first and second coordinate are the same. We can also take products of 3 or more sets, getting ordered triples, or quadruples, and so on.
Venn Diagrams
There is a very nice visual tool we can use to represent operations on sets. A Venn diagram displays sets as intersecting circles. We can shade the region we are talking about when we carry out an operation. We can also represent cardinality of a particular set by putting the number in the corresponding region.
Each circle represents a set. The rectangle containing the circles represents the universe. To represent combinations of these sets, we shade the corresponding region. For example, we could draw as:
Here is a representation of , or equivalently :
A more complicated example is , as seen below.
Notice that the shaded regions above could also be arrived at in another way. We could have started with all of , then excluded the region where and overlap outside of . That region is . So the above Venn diagram also represents . So using just the picture, we have determined that
.
Let , , and .
- Find .
- Find .
- Find .
- Find .
Find an example of sets and such that and .
For example, and .
Find an example of sets and such that and .
For example, and
Recall (the integers). Let be the positive integers. Let be the even integers, be the multiples of 3, and so on.
- Is ? Explain.
- Is ? Explain.
- Find . Describe the set in words, and using set notation.
- Express as a union or intersection of two sets already described in this problem.
- No.
- No.
- is the set of all integers which are multiples of both 2 and 3 (so multiples of 6). Therefore .
- .
Let be the set of all multiples of 2 except for . Let be the set of all multiples of 3 except for 3. And so on, so that is the set of all multiples of except for , for any . Describe (in words) the set .
It might help to think about what the union is first. Then think about what numbers are not in that union. What will happen when you also include ?
Draw a Venn diagram to represent each of the following:
- :
- :
- :
- :
- :
- :
Describe a set in terms of and (using set notation) which has the following Venn diagram:
Let . Find .
We are looking for a set containing 16 sets.
.
Let . Find all sets which have the property .
Find an example of sets and such that , , and .
For example, and gives .
Find an example of sets and such that , , and .
Are there sets and such that , , and ? Explain.
Let . Suppose is a set with .
- What are the smallest and largest possible values of ? Explain.
_____ _____
-
What are the smallest and largest possible values of ? Explain.
_____ _____
- What are the smallest and
largest possible values of ? Explain.
_____ _____
Let . Find examples of sets with the properties below and very briefly explain why your examples work.
- A set with such that .
- A set with .
- A set with .
- A set with
- A set such that .
Let , and be sets.
- Suppose that and . Does this mean that ? Prove your answer. Hint: to prove that you must prove the implication, “for all , if then .”
- Suppose that and . Does this mean that ? Give an example to prove that this does NOT always happen (and explain why your example works). You should be able to give an example where .
In a regular deck of playing cards there are 26 red cards and 12 face cards. Explain, using sets and what you have learned about cardinalities, why there are only 32 cards which are either red or a face card.
Find an example of a set with which contains only other sets and has the following property: for all sets , we also have . Explain why your example works. (FYI: sets that have this property are called transitive.)
Consider the sets and , where and . What are the sets?
We need to be a little careful here. If contains 3 elements, then contains just the number 3 (listed twice). So that would make , which would make , which only has 2 elements. Thus . This means that , so contains at least the elements 1 and 2. Since , we must have , which agrees with the definition of .
Therefore it must be that and
Explain why there is no set which satisfies .
It looks like you should be able to define the set like this. But consider the two possible values for .
Find all sets , , and which satisfy the following.
.
Discrete Mathematics: An Open Introduction, 3rd edition, by Oscar Levin (discrete.openmathbooks.org), licensed under CC BY-SA 4.0; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.