- Virtual Laboratories
- 0. Foundations
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9

Poincaré's quote, on the title page of this chapter could not be more wrong (what was he thinking?). Set theory is the foundation of probability and statistics, as it is for almost every branch of mathematics.

First, a set is simply a collection of objects; the objects are referred to as elements of the set. The statement that $s$ is an element of set $S$ is written $s\in S$. By definition, a set is completely determined by its elements; thus sets $A$ and $B$ are equal if they have the same elements:

$$A=B\text{\hspace{0.5em}if and only if\hspace{0.5em}}s\in A\equiv s\in B$$If $A$ and $B$ are sets then $A$ is a subset of $B$ if every element of $A$ is also an element of $B$:

$$A\subseteq B\text{\hspace{0.5em}if and only if\hspace{0.5em}}s\in A\implies s\in B$$Concepts in set theory are often illustrated with small, schematic sketches known as Venn diagrams, named for John Venn. The Venn diagram in the picture below illustrates the subset relation.

Membership is a primitive, undefined concept in naive set theory. Moreover, sets are usually constructed by either listing the elements of the set or by giving a condition that must be satisfied by the elements of the set. However, the following construction, known as Russell's paradox after the mathematician and philosopher Bertrand Russell, shows that we cannot be too cavalier in the construction of sets.

Let $R=\{A\colon A\text{\hspace{0.5em}is a set and\hspace{0.5em}}A\notin A\}$. Show that $R\in R$ if and only if $R\notin R$

Usually, the sets under discussion in a particular context are all subsets of a specified set $S$, often called a universal set. The use of a universal set prevents the type of problem that arises in Russell's paradox. That is, if $S$ is a given set and $p(x)$ is a predicate on $S$ (that is, a valid mathematical statement that is either true or false for each $x\in S$, then $\{x\in S\colon p(x)\}$ is a valid subset of $S$.

In contrast to a universal set, the empty set, denoted $\emptyset $, is the set with no elements.

Show that $\emptyset \subseteq A$ for every set $A$.

Suppose that $A$, $B$ and $C$ are subsets of a set $S$. Prove the following results, which show that the subset relation is a partial order on the collection of subsets of $S$.

- $A\subseteq A$ (the reflexive property).
- If $A\subseteq B$ and $B\subseteq A$ then $A=B$ (the anti-symmetric property).
- If $A\subseteq B$ and $B\subseteq C$ then $A\subseteq C$ (the transitive property).

If $S$ is a set, then the set of all subsets of $S$ is known as the power set of $S$ and is denoted $(S)$.

The following special sets are used throughout the project, and often play the role of universal sets.

- $\mathbb{N}$: the set of natural numbers (which, in this project, means the nonnegative integers)
- $$: the set of positive integers
- $\mathbb{Z}$: the set of integers
- $\mathbb{Q}$: the set of rational numbers
- $\mathbb{R}$: the set of real numbers
- $\mathbb{C}$: the set of complex numbers

We are now ready to review the basic operations of set theory. For the following definitions, suppose that $A$ and $B$ are subsets of a universal set, which we will denote by $S$.

The union of $A$ and $B$ is the set obtained by combining the elements of $A$ and $B$.

$$A\cup B=\{s\in S\colon s\in A\lor s\in B\}$$The intersection of $A$ and $B$ is the set of elements common to both $A$ and $B$:

$$A\cap B=\{s\in S\colon s\in A\land s\in B\}$$If the intersection of sets $A$ and $B$ is empty, then $A$ and $B$ are said to be disjoint:

$$A\cap B=\emptyset $$The set difference of $B$ and $A$ is the set of elements that are in $B$ but not in $A$:

$$B\setminus A=\{s\in S\colon s\in B\land s\notin A\}$$The complement of
$A$
is the set of elements that are *not* in
$A$:

Note that union, intersection, and difference are binary set operations, while complement is a unary set operation.

In the Venn diagram applet, select each of the following and note the shaded area in the diagram.

- $A$
- $B$
- $(A)$
- $(B)$
- $A\cup B$
- $A\cap B$

In the following problems, $A$, $B$, and $C$ are subsets of a universal set $S$. The proofs are straightforward, and just use the definitions and basic logic.

Show that $A\cap B\subseteq A\subseteq A\cup B$

Prove the identity laws:

- $A\cup \emptyset =A$
- $A\cap S=A$

Prove the idempotent laws:

- $A\cup A=A$
- $A\cap A=A$

Prove the complement laws:

- $A\cup (A)=S$
- $A\cap (A)=\emptyset $

Prove the double complement law: $((A))=A$

Prove the commutative laws:

- $A\cup B=B\cup A$
- $A\cap B=B\cap A$

Prove the associative laws:

- $A\cup B\cup C=A\cup B\cup C$
- $A\cap B\cap C=A\cap B\cap C$

Thus, we can write $A\cup B\cup C$ and $A\cap B\cap C$ without ambiguity.

Prove the distributive laws:

- $A\cap (B\cup C)=A\cap B\cup A\cap C$
- $A\cup B\cap C=(A\cup B)\cap (A\cup C)$

Prove DeMorgan's laws (named after Agustus DeMorgan):

- $(A\cup B)=(A)\cap (B)$
- $(A\cap B)=(A)\cup (B)$.

Prove that the following statements are equivalent:

- $A\subseteq B$
- $(B)\subseteq (A)$
- $A\cup B=B$
- $A\cap B=A$
- $A\setminus B=\emptyset $

Prove the following results. The first part shows that set difference can be expressed in terms of complement and intersection. The next three parts show that *all* of the other set operations (complement, union, and intersection) can be expressed in terms of difference.

- $B\setminus A=B\cap (A)$
- $(A)=S\setminus A$
- $A\cap B=A\setminus A\setminus B$
- $A\cup B=S\setminus S\setminus A\setminus S\setminus A\setminus S\setminus B$

Show that $A\cup B\setminus A\cap B=A\setminus B\cup B\setminus A$. This set is called the symmetric difference of $A$ and $B$, and is sometimes denoted $(A, B)$. The elements of this set belong to one but not both of the given sets.

Show that the elements of $A\cap B\cup (A\cup B)$ belong to both the given sets or to neither of the sets.

Prove that there are 16 different (in general) sets that can be constructed from two given events $A$ and $B$.

In the Venn diagram applet, observe the diagram of each of the 16 sets that can be constructed from $A$ and $B$ using the set operations.

Product sets are sets of sequences. The defining property of a sequence, of course, is that *order* as well as *membership* is important.

Let us start with ordered pairs. In this case, the defining property is that $\left(\begin{array}{c}a\\ b\end{array}\right)=\left(\begin{array}{c}c\\ d\end{array}\right)$ if and only if $a=c$ and $b=d$. Interestingly, the structure of an ordered pair can be defined just using set theory. The construction in the exercise below is due to Kazamierz Kuratowski

Define $\left(\begin{array}{c}a\\ b\end{array}\right)=\{\{a\}, \{a, b\}\}$ Show that this definition captures the defining property of an ordered pair given above.

More generally, two ordered sequences of the same size (finite or infinite) are the same if and only if their corresponding coordinates agree:

$$\left(\begin{array}{c}s_{1}\\ s_{2}\\ \\ s_{n}\end{array}\right)=\left(\begin{array}{c}t_{1}\\ t_{2}\\ \\ t_{n}\end{array}\right)\text{\hspace{0.5em}if and only if \hspace{0.5em}}s_{i}=t_{i}\text{\hspace{0.5em}for \hspace{0.5em}}i\in \{1, 2, , n\}$$ $$\left(\begin{array}{c}s_{1}\\ s_{2}\\ \end{array}\right)=\left(\begin{array}{c}t_{1}\\ t_{2}\\ \end{array}\right)\text{\hspace{0.5em}if and only if \hspace{0.5em}}s_{i}=t_{i}\text{\hspace{0.5em}for \hspace{0.5em}}i\in \{1, 2, \}$$Suppose now that we have a sequence of sets $\left(\begin{array}{c}S_{1}\\ S_{2}\\ \\ S_{n}\end{array}\right)$. The Cartesian product of the sets (named for René Descartes) is defined as follows:

$$S_{1}\times S_{2}\times \times S_{n}=\{\left(\begin{array}{c}s_{1}\\ s_{2}\\ \\ s_{n}\end{array}\right)\colon \forall i\in \{1, 2, , n\}\colon s_{i}\in S_{i}\}$$If $S_{i}=S$ for each $i$, then the product set can be written compactly as $S^{n}$. In particular, recall that $\mathbb{R}$ denotes the set of real numbers so that $\mathbb{R}^{n}$ is $n$-dimensional Euclidean space, named after Euclid, of course.

Finally, suppose that we have an infinite sequence of sets $\left(\begin{array}{c}S_{1}\\ S_{2}\\ \end{array}\right)$. The Cartesian product of the sets is defined by

$$S_{1}\times S_{2}\times =\{\left(\begin{array}{c}s_{1}\\ s_{2}\\ \end{array}\right)\colon \forall i\in \{1, 2, \}\colon s_{i}\in S_{i}\}$$The elements of $\{0, 1\}^{n}$ are called bit strings of length $n$. As the name suggests, we sometimes represent elements of this product set as strings rather than sequences (that is, we omit the parentheses and commas). Since the coordinates just take two values, there is no risk of confusion.

We will now see how the set operations relate to the Cartesian product operation. Suppose that $S$ and $T$ are sets and that $A\subseteq S$, $B\subseteq S$ and $C\subseteq T$, $D\subseteq T$. The sets in the exercises below are subsets of $S\times T$

The most important rules that relate Cartesian product with union, intersection, and difference are the distributive rules. Show that

- $A\times C\cup D=A\times C\cup A\times D$
- $A\cup B\times C=A\times C\cup B\times C$
- $A\times C\cap D=(A\times C)\cap (A\times D)$
- $A\cap B\times C=(A\times C)\cap (B\times C)$
- $A\times C\setminus D=A\times C\setminus A\times D$
- $A\setminus B\times C=A\times C\setminus B\times C$

Show that

- $A\cup B\times C\cup D=A\times C\cup A\times D\cup B\times C\cup B\times D$
- $A\times C\cup B\times D\subseteq A\cup B\times C\cup D$

In general, the product of unions is larger than the corresponding union of products.

On the other hand, the product of intersections is the same as the corresponding intersection of products. Show that

$$(A\times C)\cap (B\times D)=A\cap B\times C\cap D$$In general, the product of differences is smaller than the corresponding difference of products. Show that

- $A\setminus B\times C\setminus D=A\times C\setminus A\times D\setminus B\times C\setminus B\times D$
- $A\setminus B\times C\setminus D\subseteq A\times C\setminus B\times D$

The operations of union and intersection can easily be extended to a finite or even an infinite collection of sets.

Suppose that $A$ is a nonempty collection of subsets of a universal set $S$. In some cases, the subsets in $A$ may be naturally indexed by a nonempty index set $I$, so that $A=\{A_{i}\colon i\in I\}$. (In a technical sense, any collection of subsets can be indexed--by itself!)

The union of the collection of sets $A$ is the set obtained by combining the elements of the sets in $A$:

$$A=\{s\in S\colon \exists A\in A\colon s\in A\}$$If $A=\{A_{i}\colon i\in I\}$, so that the collection of sets is indexed, then we use the more natural notation:

$$i\in I\cup A_{i}=\{s\in S\colon \exists i\in I\colon s\in A_{i}\}$$The intersection of the collection of sets $A$ is the set of elements common to all of the sets in $A$:

$$A=\{s\in S\colon \forall A\in A\colon s\in A\}$$If $A=\{A_{i}\colon i\in I\}$, so that the collection of sets is indexed, then we use the more natural notation:

$$i\in I\cap A_{i}=\{s\in S\colon \forall i\in I\colon s\in A_{i}\}$$The collection of sets $A$ is pairwise disjoint if the intersection of any two sets in the collection is empty:

$$A\cap B=\emptyset \text{\hspace{0.5em}for every \hspace{0.5em}}A\in A\text{\hspace{0.5em}and \hspace{0.5em}}B\in A\text{\hspace{0.5em}with \hspace{0.5em}}A\neq B$$The collection of sets $A$ is said to partition a set $B$ if the collection $A$ is pairwise disjoint and $A=B$. Partitions are intimately related to equivalence relations.

In the following problems, $A=\{A_{i}\colon i\in I\}$ is a collection of subsets of a universal set $S$, indexed by a nonempty set $I$, and $B$ is a subset of $S$.

Prove the general distributive laws

$$(i\in I\cup A_{i})\cap B=i\in I\cup A_{i}\cap B$$ $$i\in I\cap A_{i}\cup B=i\in I\cap (A_{i}\cup B)$$Then restate the laws in the notation where the collection $A$ is not indexed.

Prove the general De Morgan's laws:

$$(i\in I\cup A_{i})=i\in I\cap (A_{i})$$ $$(i\in I\cap A_{i})=i\in I\cup (A_{i})$$Restate the laws in the notation where the collection $A$ is not indexed.

Suppose that the collection $A$ partitions $S$. Show that for any subset $B$, the collection $\{A\cap B\colon A\in A\}$ partitions $B$.

Let $S=\{1, 2, 3, 4\}\times \{1, 2, 3, 4, 5, 6\}$. This is the set of outcomes when a 4-sided die and a 6-sided die are tossed. Further let $A=\{\left(\begin{array}{c}x\\ y\end{array}\right)\in S\colon x=2\}$ and $B=\{\left(\begin{array}{c}x\\ y\end{array}\right)\in S\colon x+y=7\}$. Give each of the following sets in list form:

- $A$
- $B$
- $A\cap B$
- $A\cup B$
- $A\setminus B$
- $B\setminus A$

Let $S=\{0, 1\}^{3}$. This is the set of outcomes when a coin is tossed 3 times (0 denotes tails and 1 denotes heads). Further let $A=\{\left(\begin{array}{c}x_{1}\\ x_{2}\\ x_{3}\end{array}\right)\in S\colon x_{2}=1\}$ and $B=\{\left(\begin{array}{c}x_{1}\\ x_{2}\\ x_{3}\end{array}\right)\in S\colon x_{1}+x_{2}+x_{3}=2\}$. Give each of the following sets in list form, using bit-string notation:

- $S$
- $A$
- $B$
- $(A)$
- $(B)$
- $A\cap B$
- $A\cup B$
- $A\setminus B$
- $B\setminus A$

Let $S=\{0, 1\}^{2}$. This is the set of outcomes when a coin is tossed twice (0 denotes tails and 1 denotes heads). Give $(S)$ in list form.

A standard card deck can be modeled by the product set

$$D=\{, 2, 3, 4, 5, 6, 7, 8, 9, 10, , , \}\times \{, , , \}$$where the first coordinate encodes the denomination or kind (ace, 2-10, jack, queen, king) and where the second coordinate encodes the suit (clubs, diamonds, hearts, spades). Sometimes we represent a card as a *string* rather than an ordered pair (for example
$()$). For the problems in this subsection, the card deck
$D$ is the universal set.

Let $H$ denote the set of hearts and $F$ the set of face cards. Find

- $H\cap F$
- $H\setminus F$
- $F\setminus H$
- $(H, F)$

For the problems in this subsection, the universal set is $\mathbb{R}$.

Let $A_{n}=\left[0 , 1-\frac{1}{n}\right]$ for $n\in $. Find

- $n\cap \cap \cap A_{n}$
- $n\cup \cup \cup A_{n}$
- $n\cap \cap \cap (A_{n})$
- $n\cup \cup \cup (A_{n})$