A set is just a collection of objects. The objects in the set are called members or elements.
It is common to denote the names of sets by a capital letter, like:
We use curly brackets to denote a set. For example, the set A consisting of the three elements a, b, c, could be written as:
To indicate that a, b and c are elements of the set A we can write:
or more concisely, we can write:
The symbol means “is an element of” or “in”. Note
is the Greek letter epsilon.
The symbol means “not an element of” or “not in”.
Example. If A = {1, 2, 3}, then .
The order in which we list the members of a set doesn’t matter, furthermore, if we list a member of a set more than once, it doesn’t mean that we have duplicates of that member. For example:
{a, b, c}, {c, b, a}, {a, a, b, c}
all mean the same thing: the set which consists of the three elements a, b, c.
Unions and Intersections
The above Figure shows an example of a union and an intersection
The Empty Set
The empty set is denoted:
The empty set is the set with no elements in it, so:
Subsets
The symbol:
means “subset of” or “contained in”.
means every element of A is an element of B.
The above Figure shows an example of
Notes.
- By convention, the empty set is considered a subset of every set.
- If A is any set, then is true.
Set minus
A minus B = all the elements of A that are not in B.
The symbol is called “set minus”.
We will also use the minus sign from arithmetic to mean set minus. So, means the same thing as .
Example. If A = {a, b, c, d} and B = {c, d, e} then
or, equivalently
Complements
If
then the complement of A (relative to S) is S minus A. Complements are extremely important. The complement of A is written as:
Example. If S = {a, b, c, d} and A = {a, b, c} then the complement of A relative to S is {d}.
Often we’ll just say “the complement” when it is clear from context what the complement is relative to.
Disjoint sets
Two sets are called disjoint if their intersection is empty.
The Size of a Set and Finite vs Infinite
The integers are the whole numbers: 0, 1, -1, 2, -2, 3, -3, . . .
The size of a set is how many elements are in that set.
Finite vs infinite: A set is called finite if its size is a non negative integer, like 0, 1, 2, . . . A set is called infinite if its size isn’t finite.
The symbol for infinity is
The size of a set A is typically denoted |A|.
The size of a finite set is how many elements are in that set.
Example. If A = {a, b, c} then the size of A is three because there are three elements in A. We would write:
Example. The size of the empty set is zero.
Examples of infinite sets. The following sets are all infinite.
- The set of integers: 0, 1, -1, 2, -2, 3, -3, . . .
- The set of positive integers: 1, 2, 3, . . .
- The set of positive even integers: 2, 4, 6, 8, 10, . . .
- The real numbers (the number line is a “picture” of the real numbers; the real numbers include all the integers, all the fractions, all the decimal numbers).
- [0, 1] = the numbers between 0 and 1 (including 0 and 1). This is an infinite set because there is an infinite amount of numbers between 0 and 1. For example, the set 1/2, 1/3, 1/4, 1/5, . . . and the set 0.1, 0.12, 0.123, . . . are both infinite sets of numbers and both are contained in [0, 1].
- (0, 1) = the numbers strictly between 0 and 1. The set (0, 1) doesn’t include 0 and 1. The set (0, 1) is infinite for same reason that [0, 1] is infinite.
The Counting Theorem
Counting Theorem. If A and B are finite sets then
Proof. If we count the elements in A and the elements in B we will have counted
the elements in
twice, so we need to remove (subtract) one copy of .
Hence, the Counting Theorem is proven.
Example: If A = {a, b, c } and B = {b, c, d }, then
which agrees with the Counting Theorem since:
because:
Corollary to the Counting Theorem. If A and B are finite disjoint sets then
.
Proof. If A and B are disjoint, then is the empty set. The size of the empty set is 0. So, the Counting Theorem becomes:
Hence, the Corollary to the Counting Theorem is proven.
Example.
Example. If A = {a, b, c} and B = {d, e, f, g} then
because A and B are disjoint (they don’t overlap, their intersection is empty).
Functions
We say f is function from the set A to the set B if f associates each element of A with one element of B. The set A is called the domain of f and the set B is called the range of f. We often write , which we read as “f maps A to B”, and which means f is a function with domain A and range B. We write f(a) = b if b is the element of B that f associates with a.
We often use the letters f, g , x, X, y, Y, to denote functions.
Examples of functions.
- A = B = the real numbers and define f by the formula f(x) = 2x + 3. In this example f is the name of the function and x is the name of the variable. To know what number in the range is associated with a number x in the domain, we just substitute x into the formula. For example, f(10) = 2(10) + 3 = 23. So, f associates the number 23 (which is in the range of f) with the number 10 (which is in the domain of f). Usually we just say “f of 10 is 23”.
- A = the real numbers. B = the non negative real numbers, and define f by the formula . In this example f is the name of the function and x is the name of the variable.
- A = {a, b, c} and B = { 1, 2, 3, 4}. Define f as follows.
f(a) = 1
f(b) = 2
f(c) = 2 - A = {a, b, c} and B = { 1, 2, 3, 4}. The following would NOT be a function because f(a) equals two different values.
f(a) = 1
f(a) = 2 (we can’t have f(a) equaling two different values if f is a function)
f(b) = 3
f(c) = 4 - S = {HH, HT, TH, TT}. Define X to be the function that counts H’s. So,
X(HH) = 2
X(HT) = X(TH) = 1
X(TT) = 0
In the above example we only gave the domain of the function X, which is S. We didn’t say what the range is. Technically, we should say what the range is, but often we don’t. The reason is that for many calculations, you don’t need to know precisely what the range is.
For more information on functions see the Wikipedia entry for functions:
https://en.wikipedia.org/wiki/Function_(mathematics)
Inverse and Preimage of a Function
If and , the preimage or inverse of b (with respect to f) is:
which is the mathematical notation for saying “the set of all such that . The vertical line means “such that”.
Example. If then because and .
Example. Suppose S = {HH, HT, TH, TT} and X is the function on S which counts H’s. Then
Notation. Sometimes, especially in statistics, instead of using the inverse-style notation we use the notation f = b to indicate the preimage of b with respect to f.
Example. Suppose . If we write f = 25, we mean the set .