3.1 Mathematical Operations
In this first section, we will review mathematical operations that you have probably encountered before. In many cases, this will be a refresher on the rules and how to read notation.
3.1.1 Order of Operations
Many of you may have learned the phrase, “Please Excuse My Dear Aunt Sally” which stands for Parentheses (and other grouping symbols), followed by Exponents, followed by Multiplication and Division from left to right, followed by Addition and Subtraction from left to right.
There will be many equations in our future, and we must remember these rules.
- Example: \(((1+2)^3)^2 = (3^3)^2 = 27^2 = 729\)
To get the answer, we focused on respecting the parentheses first, identifying the inner-most expression \(1 + 2 = 3\), we then moved out and conducted the exponents to get to \((3^3)^2 = 27^2\).
Note how this is different from the answer to \(1 + (2^3)^2 = 1 + 8^2 = 65\), where the addition is no longer part of the parentheses.
3.1.2 Exponents
Here is a cheat sheet of some basic rules for exponents. These can be hard to remember if you haven’t used them in a long time. Think of \(a\) in this case as a number, e.g., 4, and \(b\), \(k\), and \(l\), as other numbers.
- \(a^0 = 1\)
- \(a^1 = a\)
- \(a^k * a^l = a^{k + l}\)
- \((a^k)^l = a^{kl}\)
- \((\frac{a}{b})^k = (\frac{a^k}{b^k})\)
These last two rules can be somewhat tricky. Note that a negative exponent can be re-written as a fraction. Likewise an exponent that is a fraction, the most common of which we will encounter is \(\frac{1}{2}\) can be re-written as a root, in this case the square root (e.g., \(\sqrt{a}\)).
- \(a^{-k} = \frac{1}{a^k}\)
- \(a^{1/2} = \sqrt{a}\)
3.1.3 Summations and Products
The symbol \(\sum\) can be read “take the sum of” whatever is to the right of the symbol. This is used to make the written computation of a sum much shorter than it might be otherwise. For example, instead of writing the addition operations separately in the example below, we can simplify it with the \(\sum\) symbol. This is especially helpful if you would need to add together 100 or 1000 or more things. We will see these appear a lot in the course, for better or worse, so getting comfortable with the notation will be useful.
Usually, there is notation just below and just above the symbol (e.g., \(\sum_{i=1}^3\)). This can be read as “take the sum of the following from \(i=1\) to \(i=3\). We perform the operation in the expression, each time changing \(i\) to a different number, from 1 to 2 to 3. We then add each expression’s output together.
- Example: \(\sum_{i=1}^3 (i + 1)^2 = (1 + 1)^2 + (2 + 1)^2 + (3+1)^2 = 29\)
We will also encounter the product symbol in this course: \(\prod\). This is similar to the summation symbol, but this time we are multiplying instead of adding.
- Example: \(\prod_{k = 1}^3 k^2 = 1^2 \times 2^2 \times 3^2 = 36\)
3.1.4 Logarithms
In this class, we will generally assume that \(\log\) takes the natural base \(e\), which is a mathematical constant equal to 2.718…. In other books, the base might be 10 by default.
- If we have, \(\log_{10} x = 2\), this is like saying 10^2 = 100.
- With base \(e\), we have \(\log_e x =2\), which is \(e^2 = 7.389\).
- We are just going to write \(\log_e\) as \(\log\) but know that the \(e\) is there.
A key part of maximum likelihood estimation is writing down the log of the likelihood equation, so this is a must-have for later in the course.
Here is a cheat sheet of common rules for working with logarithms.
- \(\log x = 8 \rightarrow e^8 = x\)
- \(e^\pi = y \rightarrow \log y = \pi\)
- \(\log (a \times b) = \log a + \log b\)
- \(\log a^n = n \log a\)
- \(\log \frac{a}{b} = \log a - \log b\)
Why logarithms? There are many different reasons why social scientists use logs.
- Some social phenomena grow exponentially, and logs make it is easier to visualize exponential growth, as is the case in visualizing the growth in COVID cases. See this example.
- Relatedly, taking the log of a distribution that is skewed, will make it look more normal or symmetrical, which has some nice properties.
- Sometimes the rules of logarithms are more convenient than non-logarithms. In MLE, we will take particular advantage of this rule: \(\log (a \times b) = \log a + \log b\), which turns a multiplication problem into an addition problem.