A Math review
The math used in this textbook is all covered in high school or in introductory calculus. However, you may have forgotten it, or never understood it very well in the first place.
This appendix will review the most important mathematical terms, concepts, and methods. It can be used to review ideas before starting the main text, or as a reference while going through the main text.
Chapter goals
In this appendix, we will review how to:
- Define a set using enumeration or set-builder notation.
- Determine the cardinality (size) of a set.
- Identify whether sets are identical, disjoint, or subsets.
- Perform set algebra operations on simple sets.
- Use the indicator function.
- Use the summation operator.
- Apply the rules of arithmetic to a summation.
- Find the limit of a sequence.
If you have trouble with a few of these ideas, don’t panic. This is not a math class. For example, if you forget what it means for two sets to be “disjoint”, you can always ask.
A.1 Sets
The most fundamental notion in mathematics is the idea of a set. A set is typically described as a collection or gathering of distinct objects. These objects are called the elements of the set. Sets are not ordered, and elements cannot be repeated.
A.1.1 Defining a set
We have several ways of defining or describing sets. The simplest is enumeration, which means you just list the elements: \[\begin{align} A &= \{1,2,3\} \\ B &= \{Avocado, Banana\} \end{align}\] Notice that the list of elements is surrounded by curly brackets.
A second way of defining a set is to use set-builder notation. Set builder notation defines sets in terms of rules their elements must satisfy. For example: \[\begin{align} C = \{x \in B: x \textrm{ is yellow} \} \end{align}\] We read this as “\(C\) is the set of all \(x\) in the set \(B\) such that \(x\) is yellow.” In other words:
- Avocados are not in set \(C\) because they are not yellow.
- Bananas are in set \(C\) because they are in set \(B\) and they are yellow.
- Lemons are not in set \(C\) because they are not in set \(B\).
We sometimes leave the initial set implicit: \[\begin{align} C = \{x: x \textrm{ is yellow} \} \end{align}\] We would interpret this as saying that \(C\) is the set of everything that is yellow. There are a few special sets defined by convention:
- The empty set, usually written \(\emptyset\), is a set with no elements.
- The universal set (usually written \(\mathbb{U}\)) is the set of “everything” we might be talking about in a given context. The universal set is usually implicit, though we will occasionally need to define it explicitly.
- The set of integers is usually written as \(\mathbb{Z}\).
- The set of rational numbers is usually written as \(\mathbb{Q}\).
- The set of real numbers is usually written as \(\mathbb{R}\).
- The set of positive integers is \(\mathbb{Z}_+\), the set of positive real numbers is \(\mathbb{R}_+\), etc.
Finally we can just refer to an abstract set without specifying its contents, just like we can refer to a variable in algebra without specifying its value.
A.1.2 Characteristics of a set
The size or cardinality of the set \(A\), usually written \(|A|\), is simply the number of elements it has.
- \(A\) is a singleton if \(|A| = 1\).
- \(A\) is a finite set if \(|A|\) is a finite number. Otherwise it is an infinite set.
Example A.1 Cardinality (size)
The integers (\(\mathbb{Z}\)) and real numbers (\(\mathbb{R}\)) are infinite sets: \[\begin{align} |\mathbb{Z}| &= \infty \\ |\mathbb{R}| &= \infty \end{align}\]
These are finite sets: \[\begin{align} |\{1,2,3\}| &= 3 \\ |\{Avocado\}| &= 1 \\ |\emptyset| &= 0 \end{align}\] In addition, \(\{Avocado\}\) is a singleton.
A.1.3 Set algebra
Let \(A\) and \(B\) be two sets. We have several ways of describing how they are related:
- \(A\) and \(B\) are identical (written \(A = B\)) if they contain the same elements.
- \(A\) and \(B\) are disjoint if they have no elements in common.
- \(A\) is a subset of \(B\) (written \(A \subseteq B\) or \(A \subset B\) ) if all elements of \(A\) are also elements of \(B\).
Example A.2 Set relationships
These sets are identical: \[\begin{align} \{1,2\} &= \{1,2\} \\ \{1,2\} &= \{2,1\} \end{align}\] These sets are not identical: \[\begin{align} \{1,2\} &\neq \{1,2,3\} \\ \{1,2\} &\neq \{1,3\} \end{align}\] These sets are disjoint: \[\begin{align} \{1,2\} \textrm{ and } \{3,4\} \end{align}\] These sets are not disjoint: \[\begin{align} \{1,2,3\} \textrm{ and } \{3,4\} \end{align}\] The first of these sets is a subset of the second set: \[\begin{align} \{1,2\} &\subset \{1,2\} \\ \{1,2\} &\subset \{1,2,3\} \end{align}\] The first of these sets is not a subset of the second set: \[\begin{align} \{1,2\} \not\subset \{1,3\} \end{align}\]
We can also perform various mathematical operations on sets.
- The intersection of \(A\) and \(B\) (usually written \(A \cap B\)) is the set of everything that is an element of both \(A\) and \(B\). \[\begin{align} A \cap B = \{x: x \in A \textrm{ and } x \in B\} \end{align}\]
- The union of \(A\) and \(B\) (usually written \(A \cup B\)) is the set of everything that is in \(A\) or \(B\) (or both): \[\begin{align} A \cup B = \{x: x \in A \textrm{ or } x \in B\} \end{align}\]
- The complement of \(A\) is written \(A'\), \(\neg A\) or \(A^c\), and is simply everything that is not in \(A\): \[\begin{align} A^c = \{x: x \notin A\} \end{align}\]
Example A.3 Set operations
Intersections take all common elements from the two sets: \[\begin{align} \{1,2\} \cap \{3,4\} &= \emptyset \\ \{1,2,3\} \cap \{3,4\} &= \{3\} \end{align}\] Unions take all elements from the two sets: \[\begin{align} \{1,2\} \cup \{3,4\} &= \{1,2,3,4\} \\ \{1,2,3\} \cup \{3,4\} &= \{1,2,3,4\} \end{align}\] The complement of a set is everything (in the universal set, whatever that is) else:
- The complement of “people in the labour force” is “people not in the labour force” (if we take the universal set to be “people”).
- The complement of “the Canucks win” is “the Canucks do not win” (if we take the universal set to be “outcomes of today’s Canucks game”).
The combination of these basic definitions, relationships (identity, element, subset) and operations (union, intersection, complement) are collectively called set algebra.
Some standard results about sets
Given the basic components of set algebra, we can establish many useful rules. This is not a course on set theory, so I will simply list some of the most important rules for your reference. None of these rules is difficult to prove, and most of them should make intuitive sense to you.
- Non-negative cardinality: \[\begin{align} |A| \geq 0 \end{align}\]
- Cardinality of unions: \[\begin{align} |A \cup B| = |A| + |B| -|A \cap B| \leq |A| + |B| \end{align}\]
- Cardinality of intersections: \[\begin{align} |A \cap B| \leq min(|A|,|B|) \end{align}\]
- Commutative laws: \[\begin{align} A \cup B &= B \cup A \\ A \cap B &= B \cap A \end{align}\]
- Associative laws: \[\begin{align} (A \cup B) \cup C &= A \cup (B \cup C) \\ (A \cap B) \cap C &= A \cap (B \cap C) \end{align}\]
- Distributive laws: \[\begin{align} A \cup (B \cap C) &= (A \cup B) \cap (A \cup C) \\ A \cap (B \cup C) &= (A \cap B) \cup (A \cap C) \end{align}\]
- Identity laws: \[\begin{align} A \cup \emptyset &= A \\ A \cap \mathbb{U} &= A \end{align}\]
- Double-complement law: \[\begin{align} (A^c)^c = A \end{align}\]
- Idempotent laws: \[\begin{align} A \cup A &= A \\ A \cap A &= A \end{align}\]
- Domination laws: \[\begin{align} A \cup \mathbb{U} &= \mathbb{U} \\ A \cap \emptyset &= \emptyset \end{align}\]
- DeMorgan’s laws: \[\begin{align} (A \cup B)^c &= A^c \cap B^c \\ (A \cap B)^c &= A^c \cup B^c \end{align}\]
Notice that these rules generally come in pairs, with union and intersection switched. This duality is a general feature of set algebra.
A.2 Functions
A.2.1 Definition of a function
A function is a rule that matches (“maps”) elements of one set (called the domain of the function) to elements of another set (called the range of the function). We use the notation: \[\begin{align} f: D \rightarrow R \end{align}\] to declare that a particular function \(f\) has domain \(D\) and range \(R\).
Example A.4 Domain and range of a function
- \(f:\mathbb{R} \rightarrow \mathbb{R}\) means that the function \(f\) takes a real number, and returns a real number.
- \(g:\mathbb{Z}_+ \rightarrow \{0,1\}\) means that the function \(g\) takes a positive integer, and returns either zero or one.
- \(s: \{Avocado,Banana,Cantaloupe\} \rightarrow \mathbb{Z}\) means that the function \(s\) takes either \(Avocado\), \(Banana\) or \(Cantaloupe\) and returns an integer.
If a function has a finite domain, we can define the function by simple enumeration.
Example A.5 A function defined by enumeration
Since the function \(s: \{Avocado,Banana,Cantaloupe\} \rightarrow \mathbb{Z}\) has a finite domain, we can define it by listing all of its values: \[\begin{align} s(x) &= \begin{cases} 0 & \textrm{if $x = Banana$} \\ 1 & \textrm{if $x = Avocado$} \\ 500 & \textrm{if $x = Cantaloupe$} \\ \end{cases} \end{align}\] or we could make a table:
\(fruit\) | \(s(fruit)\) |
---|---|
Avocado | 1 |
Banana | 0 |
Cantaloupe | 500 |
We can also define a function by a mathematical expression, or we can just refer to a function without defining exactly what it is, just like we can talk about a variable \(x\) or a set \(A\) without assigning it a particular value.
Function or multiplication?
Students sometimes confuse functions and multiplication because of the way we conventionally write functions, students sometimes get confused. Suppose I write this: \[\begin{align} z = f(x+y) \end{align}\] There are two possible interpretations of this statement:
- \(f\) is a number, so \(z\) is equal to the number \(f\) times the number \((x+y)\).
- \(f\) is a function, so \(z\) is equal to the function \(f\) applied to the number \((x+y)\).
It is sometimes clear from the context which of these interpretations is correct in a given problem. But please ask if you aren’t sure.
A.2.2 Linear functions
A linear function is one that takes the form: \[\begin{align} f(x) &= a + bx \end{align}\] where \(a\) and \(b\) are constants. For example \(x\) is a linear function of \(x\), as are \(3 + x\), \(5x\), etc. Linear functions are particularly easy to work with, and we will see them regularly in statistics.
A.2.3 The indicator function
The indicator function is a special function whose argument is a statement. The indicator function is typically represented by \(I(\cdot)\) or \(\mathbb{1}(\cdot)\). It returns a value of one if the statement is true, and zero if it is false: \[\begin{align} I(statement) &= \begin{cases} 0 & \textrm{if $statement$ is false} \\ 1 & \textrm{if $statement$ is true} \\ \end{cases} \end{align}\] We use indicator functions all the time in probability and statistics because they allow us to express qualitative statements as quantitative variables.
Example A.6 Indicator functions
\[\begin{align} I(3 < 5) = 1 \\ I(3 = 5) = 0 \\ I(\textrm{Ottawa is the capital of Canada}) = 1 \\ I(\textrm{Ottawa is in Alberta}) = 0 \end{align}\]
A.3 Sequences and summations
A.3.1 Cartesian products
The Cartesian product of two sets \(A\) and \(B\), usually written \(A \times B\), is the set of all ordered pairs of elements in the two sets.
Example A.7 Cartesian products
If \(A = \{1,2\}\) and \(B = \{3,4\}\) then: \[\begin{align} A \times B = \{(1,3),(1,4),(2,3),(2,4)\} \end{align}\]
A particularly important example of a Cartesian product is: \[\begin{align} \mathbb{R}^2 = \mathbb{R} \times \mathbb{R} \end{align}\] the set of ordered pairs of real numbers. For example, \((0,3)\) and \((0.427,2000)\) are both elements of \(\mathbb{R}^2\).
A.3.2 Sequences
We will also be interested in the set of ordered sequences of \(n\) real numbers (where \(n\) is some positive integer): \[\begin{align} \mathbb{R}^n = \mathbb{R} \times \mathbb{R} \times \cdots \times \mathbb{R} \end{align}\] We usually distinguish between sequences and sets by using parentheses for sequences and curly brackets for sets.
A sequence is much like a set but with two important differences:
- Order matters.
- Elements can be repeated.
Like sets, sequences can be empty, finite, or infinite.
Example A.8 Sequences and sets
Order matters for sequences but not for sets: \[\begin{align} \{1,2\} &= \{2,1\} \\ (1,2) &\neq (2,1) \end{align}\] Sequences can include repeated elements, but sets cannot: \[\begin{align} \{1,3,1\} \textrm{ is not a valid set.} \\ (1,3,1) \textrm{ is a valid sequence.} \end{align}\] Sequences have cardinality (size): \[\begin{align} () \textrm{ is an empty sequence.} \\ (2,4,6) \textrm{ is a finite sequence.} \\ (2,4,6,\ldots) \textrm{ is an infinite sequence.} \end{align}\]
We usually number each element in a sequence. The number assigned to a given element is called its index. Typically, the first element in a sequence is numbered either 0 or 1, and the remaining elements are numbered sequentially after that.
We can define sequences by simple enumeration as in the examples above. These are a few other ways of defining a sequence:
- As a sequence of variables with subscripts: \((x_1,x_2,x_3)\). We will usually use a variable for the subscript when we want to talk about an arbitrary element of the sequence; for example the variable \(x_i\) is the \(i\)th element in the sequence \((x_1,x_2,x_3,\ldots)\).
- As functions of other sequences: \(y_i = \ln(x_i)\).
- As functions of the index itself \(x_i = a^i\)
A.3.3 Summations
Many statistics we are calculating are constructed by adding up a sequence of numbers. It will be convenient to use the summation operator, which looks like this: \[\begin{align} \sum_{(\textrm{index}) \in (\textrm{set})}(\textrm{variable that depends on index}) \end{align}\] Notice that an expression using the summation operator has several components:
- The summation sign \(\sum\).
- An expression identifying the index variable, and what values it takes on. The index variable is usually but not always called \(i\).
- An expression identifying what is to be added up. It is usually but not always a function of the index variable.
Example A.9 Summations
\(\sum_{i \in A}\) means we add up over all of the values in the set \(A\): \[\begin{align} \sum_{i \in \{1,2,3\}} x_i = x_1 + x_2 + x_3 \end{align}\]
\(\sum_{i = start}^{end}\) means we add up over all of the integers between \(start\) and \(end\): \[\begin{align} \sum_{i=1}^3 x_i &= x_1 + x_2 + x_3 \\ \sum_{i=1}^n x_i &= x_1 + x_2 + \cdots + x_n \end{align}\] The index set can be infinite: \[\begin{align} \sum_{i=1}^{\infty} x_i = x_1 + x_2 + \cdots \end{align}\] The summation can be of any expression that depends on the index: \[\begin{align} \sum_{i=1}^3 \ln x_i &= \ln x_1 + \ln x_2 + \ln x_3 \\ \sum_{j=1}^3 \beta^j &= \beta + \beta^2 + \beta^3 \end{align}\] But the expression does not have to vary with the index: \[\begin{align} \sum_{i=1}^3 2x &= 2x + 2x + 2x = 6x \\ \sum_{i=1}^3 3 &= 3 + 3 + 3 = 9 \end{align}\] We can use multiple summation operators in an expression: \[\begin{align} \sum_{j=1}^2 \sum_{i=1}^2 x_iy_j &= \sum_{j=1}^2 (x_1y_j + x_2y_j) \\ &= x_1y_1 + x_1y_2 + x_2y_1 + x_2y_2 \end{align}\] The summation operator looks fancy, but remember it is just a concise way of describing a sum. If you are ever struggling with understanding a summation, write it out.
You learned the basic properties of addition and multiplication in Grade 3:
- Associative property: \[\begin{align} (a + b) + c &= a + (b+c) \\ (ab)c &= a(bc) \end{align}\]
- Commutative property: \[\begin{align} a + b &= b + a \\ ab &= ba \end{align}\]
- Distributive property: \[\begin{align} a(b+c) = ab + ac \end{align}\]
An expressions using the summation operator describes a sum, so it also obeys these properties:
- The associative and commutative properties allow you to switch any two summation operators: \[\begin{align} \sum_{i \in A} \sum_{j \in B} x_iy_j = \sum_{j \in B} \sum_{i \in A} x_iy_j \end{align}\] and to take the summation operator “into” or “out of” a sum: \[\begin{align} \sum_{i \in A} (x_i + y_i) = \left(\sum_{i \in A} x_i\right) + \left(\sum_{i \in A} y_i \right) \end{align}\]
- The distributive property allows you to take any constant out of the summation operator: \[\begin{align} \sum_{i=1}^n ax_i = a \sum_{i=1}^n x_i \end{align}\]
We will use these three results later on.
A.4 Limits
Let \((x_1,x_2,\ldots)\) be a sequence of infinite length. We say that some number \(c\) is the limit of this sequence if \(x_i\) gets closer and closer to \(c\) as \(i\) gets bigger and bigger.
- The limit of a sequence can be a number.
- The limit of a sequence can be \(\infty\) or \(-\infty\).
- Not all sequences have limits.
Example A.10 Limits
\[\begin{align} \lim (1,1,1,\ldots) &= 1 \\ \lim\left(1,\frac{1}{2},\frac{1}{3},\ldots\right) &= 0 \\ \lim(1,2,3,\ldots) &= \infty \\ \lim(-1,-2,-3,\ldots) &= -\infty \\ \lim(0,1,0,1,0,1,\ldots) & \textrm{ does not exist} \end{align}\]
You will learn or have learned the formal definition of a limit in your calculus course. I won’t make you re-learn it for this class, but the formal definition is provided below for your reference.
Definition of a limit
Let \((x_1,x_2,\ldots)\) be a sequence of infinite length. We say that the number \(c\) is the limit of this sequence: \[\begin{align} \lim_{i\rightarrow \infty} x_i = c \end{align}\] if for any \(\delta > 0\) there exists an \(N_{\delta}\) such that: \[\begin{align} |x_i - c| < \delta \textrm{ for all } i > N_{\delta} \end{align}\]
Chapter review
This appendix provides some of the basic mathematical background needed for this course. There are many other useful sources if you need further information:
- Wikipedia’s coverage of mathematics and introductory statistics content is usually quite reliable, and there is no shame in using it.
- Your calculus textbook will typically provide much more detail on functions, sequences, and limits, and almost any undergraduate math textbook will include an appendix on set theory.
Finally, you can always just ask. Many students are reluctant to ask questions, but instructors are generally happy to answer them.
Practice problems
Answers can be found in the appendix.
GOAL #1: Define a set using enumeration or set-builder notation
- Use enumeration to define \(A\) as the set of “people who live in your house”.
- Use set-builder notation to define \(B\) as the set of integers between 1 and 1,000.
GOAL #2: Determine the cardinality (size) of a set
- Calculate the cardinality of the sets you defined in problems (1) and (2) above.
GOAL #3: Identify whether sets are identical, disjoint, or subsets
- Let \(A = \{1,2,3\}\), let \(B = \{2\}\), let \(C = \emptyset\), and let
\(D = \{x \in \mathbb{Z}: 1 < x < 3\}\).
- Which pairs of sets are identical?
- Which sets are disjoint with \(A\)?
- Which sets are subsets of \(A\)?
- Which sets are subsets of \(B\)?
GOAL #4: Perform set algebra operations on simple sets
- Let \(A = \{1,2,3\}\), let \(B = \{2,4\}\), let \(C = \emptyset\), and let
\(D = \{x \in \mathbb{Z}: 1 < x < 3\}\).
- Find \(A \cap B\).
- Find \(A \cup B\).
- Find \(A \cap D\).
- Find \(A \cup D\).
- Suppose the universe set is \(U = \{1,2,3,4,5\}\). Find \(B^C\).
- Suppose the universe set is the set of integers \(\mathbb{Z}\). Find \(B^C\).
GOAL #5: Use the indicator function
- Let \(x = 4\).
- Find \(I(x < 5)\)
- Find \(I(x \textrm{ is an odd number})\)
- Find \(I(x < 5) - I(\sqrt{x} \textrm{ is an integer})\).
GOAL #6: Use the summation operator
- Find the values of each of these summations
- Find \(\sum_{x = 1}^5 x^2\).
- Find \(\sum_{i \in \{1,3,5\}} \ln(i)\).
- Find \(\sum_{i = 1}^\infty x_i I(i < 4)\).
GOAL #7: Apply the rules of arithmetic to a summation
- Which of the following statements are true?
- \(\sum_{i=1}^n (5 + 2 x_i) = 5 + 2 \sum_{i=1}^n x_i\).
- \(\sum_{i=1}^n (x_i \times y_i) = \sum_{i=1}^n x_i \times \sum_{i=1}^n y_i\).
- \(\sum_{i=1}^n (x_i + y_i) = \sum_{i=1}^n x_i + \sum_{i=1}^n y_i\).
- \(\left(\sum_{i=1}^n x_i\right)^2 = \sum_{i=1}^n x_i^2\).
GOAL #8: Find the limit of a sequence
- Find the limit of each of these sequences, if it exists.
- \((1, \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \ldots)\)
- \((1, -1, 1, -1, \ldots)\)
- \((6, 5 \frac{1}{2}, 5 \frac{1}{3}, 5 \frac{1}{4}, \ldots)\)
- \((-1, \frac{1}{2}, -\frac{1}{3}, \frac{1}{4}, \ldots)\)
- \((1, 2, 3, 4, \ldots)\)