1 Sets and functions
Sets and set notation appear many places in quantum chemistry. The goal of this chapter is to train you in the basic usage of sets and set notation.
Exercises: abstract sets and functions
Exercise 1.1 (Days of the week as a set) The days of the week form a simple example of a finite set. Recall that we write the elements of a set inside braces, such as
\[ A=\{a,b,c\}. \]
Write the days of the week as a set \(D\) using braces \(\{\ \}\).
How many elements does \(D\) contain? Write your answer using the notation \(|D|\) for the number of elements in a set.
Is Monday an element of \(D\)? Write your answer using the symbol \(\in\).
Is January an element of \(D\)? Write your answer using the symbol \(\notin\).
Let \(W\) be the set consisting of Saturday and Sunday. Write \(W\) using braces. Is \(W\) a subset of \(D\)? Express your answer using the symbol \(\subseteq\).
Let
\[ M=\{\text{Monday},\text{Tuesday},\text{Wednesday},\text{Thursday},\text{Friday}\}. \]
What is \(M\cup W\)? What is \(M\cap W\)?
Suppose another student writes the days in a different order,
\[ D'=\{\text{Sunday},\text{Saturday},\text{Friday},\text{Thursday},\text{Wednesday},\text{Tuesday},\text{Monday}\}. \]
Is \(D'=D\)?
Exercise 1.2 (Ordered pair) An ordered pair \((x,y)\) is a two-element “set” where the order matters. Two ordered pairs \((x,y)\) and \((u,v)\) are equal if and only if \(x=u\) and \(y = v\). From this it follows that \((x,y) = (y,x)\) if and only if \(x=y\). A definition of an ordered pair as a set is \[(x,y) = \{ \{x\}, \{x,y\} \}.\] Show that \((x,y) = (y,x)\) if and only if \(x=y\) using the set theoretic definition.
Exercise 1.3 (Rational numbers as ordered pairs) A nonnegative rational number \(p/q\), \(p,q\in\mathbb{N}\), \(q > 0\), can be written as an ordered pair \((p,q)\). Write down the rational numbers \(1/4\), \(2/3\), \(0\), \(1/3\) as ordered pairs using set theory, both for the pair and for each integer. (Strictly speaking we the number itself is an equivalence class of such pairs, i.e., \(pn/qn = p/q\), so we must identify \((p,q)\) and \((np,nq)\). Ignore equivalence classes in this exercise.)
Exercise 1.4 (Cartesian product of two sets) The cartesian product of two sets \(A\) and \(B\) is \[A \times B = \{ (a,b) \mid a\in A, \; b\in B\}.\] Write down the cartesian product of \(\{\heartsuit,\diamondsuit,\spadesuit,\clubsuit\}\) and \(\{1,2,3\}\), using the set theoretic definition for the ordered pair. You can skip spelling out the set theoretic definition of the natural numbers.
Exercise 1.5 (Ordered pair as a two-element set) Similar to the previous exercise, write down \(\{1,2,3\} \times \{2,3,4\}\).
Exercise 1.6 (Function from one set to another set) A function \(f: A \to B\) from one set \(A\) to another set \(B\) is a rule that assigns to every \(a\in A\) precisely one \(b\in B\). In terms of set theory, a function \(f:A\to B\) is a subset of \(A\times B\), such that
For all \(a\in A\) there exists \(b\in B\) such that \((a,b)\in f\).
For all \(a \in A\) and \(b,b'\in B\), if \((a,b)\in f\) and \((a,b')\in f\), then \(b=b'\).
Write down the function \(f:\{1,2,3\} \to \{1,2,3\}\), \(f(1) = 2\), \(f(2)=3\), \(f(3)=1\), using the set theoretic definition of ordered pairs and the cartesian product.
De Morgan’s laws are useful when discussing subsets \(A,B\) of a larger set \(X\). Recall that the complement of \(A\) relative to \(X\) is \(A^\complement = X \setminus A\). De Morgan’s laws state that:
\((A \cup B)^\complement = A^\complement \cap B^\complement\).
\((A \cap B)^\complement = A^\complement \cup B^\complement\).
Exercise 1.7 (De Morgan’s laws) Draw a picture, representing \(X\) as the whole sheet, \(A\) and \(B\) as overlapping shapes, e.g., circles. Label \(A\), \(B\), \(A\cap B\), and \(A \cup B\), making another drawing if necessary. Convince yourself that De Morgan’s laws are correct.
Exercise 1.8 (De Morgan’s laws 2) Prove De Morgan’s laws mathematically. Note that the complement operation acts like negation of truth, i.e., \(a \in A^\complement\) if and only if \(a \in X\) and \(a \notin A\).
Exercises: Sets in quantum chemistry
Exercise 1.9 (Classically allowed region for Morse potential) Figure Figure 1.1 shows the Morse potential - a common model potential for vibrational motion of a diatomic molecule:
\[ V(r) = D_e \left( 1 - e^{-a(r-r_e)} \right)^2 - D_e, \]
where \(D_e>0\) is the dissociation energy, \(r_e>0\) is the equilibrium bond length, and \(a>0\) is a parameter that determines the width of the potential well. The total energy of the molecule is denoted by \(E \in \mathbb{R}\). The classically allowed region for the total energy \(E\) is the set \(S_E\) of all bond lengths \(r\) such that \(V(r) \leq E\):
\[ S_E = \{ r \in \mathbb{R} \mid V(r) \leq E \} \]
Explain the notation \(S_E = \{ r \in \mathbb{R} \mid V(r) \leq E \}\) in words. In particular, what does the vertical bar \(|\) mean?
Can you find a condition on \(E\) such that \(S_E\) is the empty set?
Can you find a condition on \(E\) such that \(S_E\) is the whole real line?
Based on the figure, which of the following statements are true?
- \(S_{E_1} = (r_2,r_3)\)
- \(S_{E_1} = [r_2,r_3]\)
- \(S_{E_1} = \{ r_2,r_3 \}\)
Based on the figure, which of the following statements are true?
- \(S_{E_2} = (r_1,+\infty)\)
- \(S_{E_2} = [r_1,+\infty)\)
- \(S_{E_2} = \{ r_1,r_2, r_3 \}\)
Exercise 1.10 (Molecules as sets) In this exercise, a molecule is informally defined only by its chemical composition: the number of atoms of each element occurring in its molecular formula. Thus, \(\mathrm{H_2}\) and \(\mathrm{CO}\) are two distinct molecules, while \(\mathrm{HCOOH}\) and \(\mathrm{CO_2H_2}\) represent the same molecule, since both contain one C atom, two H atoms, and two O atoms.
We ignore molecular geometry, bonding, isotopes, charge, and all questions of chemical stability. In particular, any formal combination of atoms is deemed a molecule, whether or not such a species could exist physically.
We restrict our attention to the four elements C, H, O, and N. Let \(M\) denote the set of all molecules that can be constructed from these elements. A molecule must contain at least one atom.
One useful way of describing a molecule is by the ordered quadruple
\[ (n_{\mathrm C},n_{\mathrm H},n_{\mathrm O},n_{\mathrm N}), \tag{1.1}\]
where each \(n_X\) is the number of atoms of element \(X\) in the molecule. For example,
\[ \mathrm{CH_4}\longleftrightarrow (1,4,0,0), \]
and
\[ \mathrm{N_2O}\longleftrightarrow (0,0,1,2). \]
Explain why Equation 1.1 uniquely determines an element of \(M\). Give 4-5 additional examples of molecules in terms of this representation.
Express \(M\) in terms of \(\mathbb N_0=\{0,1,2,\ldots\}\). What is the cardinality of \(M\)? Is it finite, countably infinite, or uncountably infinite? Justify your answer.
Let
\[ M_2=\{m\in M\mid m\text{ contains exactly two atoms}\}. \]
Find \(|M_2|\) and list all elements of \(M_2\).
Let \(S\subset M\) be the set
\[ S=\left\{m\in M\mid m\text{ contains at least one H atom}\right\}. \]
Describe \(S\) in terms of the quadruple representation above. Is \(S\) finite, countably infinite, or uncountably infinite? Justify your answer.
- Describe the complement \(M\setminus S\). What is its cardinality?
Define
\[ C=\left\{m\in M\mid m\text{ contains at least one C atom}\right\}. \]
Describe the following sets both in words and in terms of the quadruple representation:
\[ C\cap S,\qquad C\cup S,\qquad C\setminus S. \]
Determine the cardinality of each set.
For \(n\geq 1\), define
\[ M_n=\left\{m\in M\mid m\text{ contains exactly }n\text{ atoms}\right\}. \]
Thus, a molecule in \(M_n\) satisfies
\[ n_{\mathrm C}+n_{\mathrm H}+n_{\mathrm O}+n_{\mathrm N}=n. \]
Show that
\[ |M_n|=\binom{n+3}{3}. \]
Check that your formula agrees with your answer to part b.
Explain why
\[ M=\bigcup_{n=1}^{\infty}M_n. \]
Are the sets \(M_n\) pairwise disjoint? Use this decomposition to give another argument that \(M\) is countably infinite.
Show that \(M\) and \(S\) have the same cardinality. Explain why this is possible even though \(S\) is a proper subset of \(M\).