SPEA V706 · Math Camp · Day 1
A chance experiment is a situation whose outcome is not settled in advance.
An outcome is one possible result of the experiment.
The sample space is the set of all possible outcomes.
Use \Omega to represent the sample space
\omega \in \Omega is one particular outcome
For a 6-sided die, the sample space is \Omega = \{1, 2, 3, 4, 5, 6\}.
Suppose we roll the die 10 times. Use i=1...10 to index each roll. \omega_i is whatever came up on the $i^{it} roll.
An event is a subset of the sample space.
Roll a six-sided die:
Union: A \cup B is the set of outcomes that belongs to event A, or event B, or both A and B.
Intersection: A \cap B is the set of outcomes that belong to both event A and event B
Complement: A^c is the set of outcomes that do not belong to event A”
Suppose the sample space is \{1, 2, 3, 4, 5, 6\}.
Event A = \{1, 2, 3\}
Event B = \{2, 3, 4\}.
\Pr(A) is a function that maps the sample space to the real number line, with the following properties:
0 \le \Pr(A) \le 1
\Pr(\Omega) = 1 and \Pr(\varnothing) = 0
\Pr(A \cup B) = \Pr(A) + \Pr(B) when A and B are disjoint
If A and B are not disjoint, then: \Pr(A \cup B) = \Pr(A) + \Pr(B) - \Pr(A \cap B).
Frequentist: If you repeat the chance experiment (roll the die) many times, then \Pr(A) is the fraction of times that event A occurs after many repetitions.
Bayesian: \Pr(A) represents your degree of belief that event A will occur, based on the available evidence.
The probability of rolling a 6 on a fair 6-sided die is \frac{1}{6}
The probability of a drawing a red card from a standard deck of 52 cards is \frac{26}{52} = \frac{1}{2}
The probability of rolling a sum of 7 on two fair 6-sided dice is \frac{6}{36} = \frac{1}{6}
Use j=1...N to index the set of newly enrolled undergraduate students at Indiana University in 2026.
Suppose that GPA_j is student j’s high school GPA.
Suppose we randomly select 1 student from the N newly enrolled students.
What is the probability that the selected student has a high school GPA above 3.5?
What is the probability that the selected student will graduate in 4 years?
\Pr(A \cap B) is the joint probability that both A and B occur.
\Pr(A \mid B) is the conditional probability of A, given that B has occurred.
Conditional probability is defined as:
\Pr(A \mid B) = \frac{\Pr(A \cap B)}{\Pr(B)} \qquad \text{for } \Pr(B) > 0
What is the probability that a student will graduate in 4 years, given that they have a high school GPA above 3.5?
Rearrange the conditional probability definition to get the multiplication rule:
\Pr(A \cap B) = \Pr(A \mid B)\,\Pr(B)
A and B are independent when learning B tells you nothing about A:
\Pr(A \mid B) = \Pr(A) \qquad \Longleftrightarrow \qquad \Pr(A \cap B) = \Pr(A)\,\Pr(B)
Suppose you know \Pr(B \mid A) but you want to know \Pr(A \mid B)?
Write the conditional probability, then substitute the multiplication rule in the numerator:
\begin{align*} \Pr(A \mid B) &= \frac{\Pr(A \cap B)}{\Pr(B)} \\[4pt] &= \frac{\Pr(B \mid A)\,\Pr(A)}{\Pr(B)} \end{align*}
When she is 51 years old, Asha has a routine screening mammogram. Her doctor’s office calls her back for additional evaluation because the mammogram result is positive.
Given that she tested postive on the mammogram, what is the probability that Asha actually has breast cancer?
Data from 10,000 screening mammograms:
| Positive | Negative | Total | |
|---|---|---|---|
| Breast cancer | 53 | 11 | 64 |
| No breast cancer | 932 | 9,004 | 9,936 |
| Total | 985 | 9,015 | 10,000 |
The base rate (the prior probability) of breast cancer is:
\Pr(Cancer)=\frac{64}{10{,}000}=0.0064,
The sensitivity of the mammogram is the probability that the test will be positive given that the patient has breast cancer:
\Pr(Positive \mid Cancer)=\frac{53}{64}\approx0.828.
The false positive rate is the probability that the test will be positive given that the patient does not have breast cancer:
\Pr(Positive \mid No \, Cancer)=\frac{932}{9,936}\approx0.0938.
The probability of a positive mammogram is the sum of the probabilities of a true positive and a false positive:
\begin{align} \Pr(Positive) &= \Pr(Positive \mid Cancer)\Pr(Cancer) + \Pr(Positive \mid No \, Cancer)\Pr(No \, Cancer) \\ &= (0.828)(0.0064) + (0.0938)(0.9936) \\ &\approx 0.0985. \end{aling}
\begin{align} \Pr(Cancer \mid Positive) &= \frac{\Pr(Positive \mid Cancer)\Pr(Cancer)}{\Pr(Positive)} \\ &= \frac{(0.828)(0.0064)}{0.0985} \\ &\approx 0.054. \end{align}
Before the mammogram, the “prior probability” that Asha has breast cancer is about 0.0064, which implies that about about 6.4 women per 1,000 in her age group actually have cancer.
But mammograms contain new information about Asha’s cancer status. Bayes rule shows how to update our belief based on this new information.
In this example, the positive mammogram result implies that the probability that Asha has breast cancer is about 0.054, which implies that about 54 women per 1,000.
Thus, a possitive mammogram increases the chances that Asha has cancer a lot in relative terms. But the absolute risk is still pretty low: there is a 94.6% chance that she does not have cancer, even after the positive mammogram result.
Talking about probability in terms of chance experiments can be cumbersome and hard to relate to the real world.
It is very common to model chance experiments using the idea of a random variable.
A random variable is a function that assigns a real number to each outcome in a sample space.
X : \Omega \to \mathbb{R} is a random variable thattakes outcomes from the sample space as input and returns a real number as output.
Suppose we roll two 6-sided dice. We can define many different random variables.
Working with random variables usually easier than working with the sample space and events directly.
We can describe a random variable by its probability distribution, which is a function that assigns probabilities to the values of the random variable.
Two main types of probability functions: cumulative distribution function (CDF) and probability density function (PDF) or probability mass function (PMF).
A random variable is described by its CDF:
F_X(x) = \Pr(X \le x)
As x runs from -\infty to +\infty, F_X climbs weakly from 0 to 1
F_X is a complete summary of X: if you know F, you can use it to find the probability of any event.
When we say “the population” or “the data generating process,” this is the object we mean.
X is continuous if F_X is smooth and differentiable.
X is discrete if F_X is a staircase, jumping at the values X can take.
For continuous X — the density is the derivative of the CDF:
f_X(x) = F_X'(x)
Integrate it to get a probability:
\Pr(a \le X \le b) = \int_a^b f_X(x)\,dx
Integrating the density over the whole real line gives 1:
For discrete X — the PMF is the probability that the random variable will take on each value from its support.
Suppose that X can take on values x_1, x_2, \ldots, x_k. Then the PMF is p_X(x_j) = \Pr(X = x_j)
The PMF is the size of the steps in the CDF – it’s the discrete analogue of the density.
p_X(x_j) = F_X(x_j) - F_X(x_{j-1})
Sum the PMF over all possible values to get 1: \sum_{j=1}^k p_X(x_j) = 1
Log hourly wages for 526 workers, drawn as an empirical CDF and as a density
The pink guide on the left reads the median off the CDF backwards, from probability 0.5 to the value
A joint distribution describes two or more random variables at once.
The joint CDF of two random variables X and Y is
F_{X,Y}(x, y) = \Pr(X \le x,\ Y \le y)
If X and Y are continuous, the joint density is:
f_{X,Y}(x,y) = \frac{\partial^2}{\partial x \partial y} F_{X,Y}(x, y)
The marginal CDF of X is:
F_X(x) = \Pr(X \le x) = \int_{-\infty}^x f_X(t)\,dt
The conditional CDF of Y given X = x is:
F_{Y \mid X}(y \mid x) = \Pr(Y \le y \mid X = x) = \int_{-\infty}^y f_{Y \mid X}(t \mid x)\,dt
Marginal — integrate the other variable out and recover one variable on its own:
f_X(x) = \int f_{X,Y}(x, y)\,dy
Conditional — fix one variable and ask about the other:
f_{Y \mid X}(y \mid x) = \frac{f_{X,Y}(x, y)}{f_X(x)}
That is the same renormalizing move as \Pr(A \mid B), now with densities.
X and Y are statistically independent when the joint distribution or density factors into the marginals:
f_{X,Y}(x,y) = f_X(x)\,f_Y(y) \qquad \text{equivalently} \qquad f_{Y \mid X}(y \mid x) = f_Y(y)
Probability starts from a known F and reasons forward to what the data might look like.
Statistics starts from realized data and reasons backward to what F might be.
We never see F. We see a sample of draws from it.
The job is to use those draws to learn features of F, and to be honest about how uncertain the answer is
“Population,” “DGP,” and “the truth” are all names for F
A random variable is a function on the sample space, and it is what we work with instead of \Omega
The CDF is a complete description of a random variable; the density or mass function is the same information in slope form
Conditioning renormalizes onto the event you were told about, and Bayes’ rule flips the direction of conditioning
A joint distribution carries the relationship between variables
F is the population.