MATH 321 – Mathematical Statistics I
October 17, 2026
It’s all well and good to consider random variables in isolation, but to do the actual interesting things you all want to do in probability and statistics, we need to understand how random variables relate to one another.
For instance, most of inferential statistics is built on the assumption of independent and identically distributed (i.i.d.) random variables.
Similarly, linear regression is built on a specific relationship of random variables: \[ Y = \beta_0 + \beta_1 X + \varepsilon, \qquad \varepsilon \sim \text{Normal}(0, \sigma^2) \]
Let \(X\) and \(Y\) be two discrete random variables. The joint probability mass function (PMF) of \(X\) and \(Y\) is defined as: \[ \begin{aligned} p_{X,Y}(x, y) &= P[\{ X = x \} \cap \{ Y = y \}] \\ &= P[\{ \omega \in \Omega : X(\omega) = x \text{ and } Y(\omega) = y \}]. \end{aligned} \]
For any set \(A \subseteq \mathbb{R}^2\), \[ P[(X, Y) \in A] = \sum_{(x, y) \in A} p_{X,Y}(x, y). \]
Note that these are valid PMFs! All properties apply!
Example: Let \(X\) be a coin toss and \(Y\) be a die roll. Find \(p_{X,Y}\).
| \(Y\) | |||||||
| 1 | 2 | 3 | 4 | 5 | 6 | ||
| \(X\) | \(H\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) |
| \(T\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | |
Let \(X\) and \(Y\) be two continuous random variables. The joint probability density function (PDF) of \(X\) and \(Y\) is a function \(f_{X,Y}(x,y)\) that can be integrated to yield a probability: \[ P[(X, Y) \in A] = \iint_A f_{X,Y}(x,y) \, dx \, dy, \] for any event \(A \subseteq \Omega_X \times \Omega_Y\).
In particular, if \(A = [a,b] \times [c,d]\), then \[ P[(X, Y) \in A] = \iint_A f_{X,Y}(x,y) \, dA = \int_a^b \int_c^d f_{X,Y}(x,y) \, dy \, dx. \]
Note that these are valid PDFs! All properties apply!
Example: Let \(X\) and \(Y\) be jointly uniformly distributed on \(A = [1,3] \times [1,4]\).
\[ f_{X,Y}(x,y) = \begin{cases} \frac{1}{6}, & \text{for } 1 \le x \le 3, 1 \le y \le 4, \\ 0, & \text{otherwise}. \end{cases} \]
The marginal probability mass function (PMF) is defined as: \[ \begin{aligned} p_X(x) &= \sum_{y \in \Omega_Y} p_{X,Y}(x,y) & &\text{and} & p_Y(y) &= \sum_{x \in \Omega_X} p_{X,Y}(x,y). \end{aligned} \]
The marginal probability density function (PDF) is defined as: \[ \begin{aligned} f_X(x) &= \int_{\Omega_Y} f_{X,Y}(x,y) \, dy & &\text{and} & f_Y(y) &= \int_{\Omega_X} f_{X,Y}(x,y) \, dx. \end{aligned} \]
Note that these are valid PMFs/PDFs! All properties apply!
Two random variables \(X\) and \(Y\) are independent if their joint PMF/PDF factors into the product of the marginals: \[ p_{X,Y}(x, y) = p_X(x) \, p_Y(y) \qquad \text{or} \qquad f_{X,Y}(x, y) = f_X(x) \, f_Y(y) \] for all \(x\) and \(y\).
Equivalently, \(P[X \in A, Y \in B] = P[X \in A] \, P[Y \in B]\) for all events \(A\) and \(B\).
Example: Let \(X\) be a coin toss and \(Y\) be a die roll. Find \(p_{X,Y}\).
| \(Y\) | |||||||
| 1 | 2 | 3 | 4 | 5 | 6 | ||
| \(X\) | \(H\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) |
| \(T\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | \(\frac{1}{12}\) | |
Example: Let \(X\) and \(Y\) be jointly uniformly distributed on \(A = [1,3] \times [1,4]\).
\[ f_{X,Y}(x,y) = \begin{cases} \frac{1}{6}, & \text{for } 1 \le x \le 3, 1 \le y \le 4, \\ 0, & \text{otherwise}. \end{cases} \]
A collection of random variables \(X_1, X_2, \dots, X_N\) is called independent and identically distributed (i.i.d.) if:
All \(X_1, X_2, \dots, X_N\) are mutually independent.
All \(X_1, X_2, \dots, X_N\) have the same distribution, i.e. \(F_{X_1}(x) = F_{X_2}(x) = \dots = F_{X_N}(x)\) for all \(x\).
Let \(X\) and \(Y\) be two random variables. The joint expectation is \[ E[XY] = \sum_{y \in \Omega_Y} \sum_{x \in \Omega_X} xy \, p_{X,Y}(x,y), \] if \(X\) and \(Y\) are discrete, or \[ E[XY] = \int_{\Omega_Y} \int_{\Omega_X} xy \, f_{X,Y}(x,y) \, dx \, dy, \] if \(X\) and \(Y\) are continuous.
Example: Let \(f_{X,Y}(x,y) = x + y\) for \(0 \le x, y \le 1\) and \(0\) otherwise. Find \(E[XY]\).
\[ \begin{aligned} E[XY] &= \int_0^1 \int_0^1 xy(x + y) \, dy \, dx = \int_0^1 \int_0^1 (x^2 y + x y^2) \, dy \, dx \\ &= \int_0^1 \left( \frac{x^2}{2} + \frac{x}{3} \right) dx = \frac{1}{3}. \end{aligned} \]
Let \(X\) and \(Y\) be two random variables. Then the covariance of \(X\) and \(Y\) is \[ Cov(X,Y) = E[(X - \mu_X)(Y - \mu_Y)], \] where \(\mu_X = E[X]\) and \(\mu_Y = E[Y]\).
Note that \(Cov(X, X) = V(X)\).
Theorem: Let \(X\) and \(Y\) be two random variables. Then \[ Cov(X,Y) = E[XY] - E[X]E[Y]. \]
If \(X_1, X_2, \dots, X_n\) are random variables, then the matrix with \((i, j)\) entry \(Cov(X_i, X_j)\) is the covariance matrix, \(\Sigma\).
Example: Let \[ f_{X,Y}(x,y) = \begin{cases} 2, & 0 < y < x < 1, \\ 0, & \text{otherwise}. \end{cases} \]
Find \(Cov(X, Y)\).
Theorem: For any \(X\) and \(Y\),
Theorem: Let \(Y_1, Y_2, \dots, Y_n\) and \(X_1, X_2, \dots, X_m\) be random variables with \(E(Y_i) = \mu_i\) and \(E(X_j) = \xi_j\). Define: \[ U_1 = \sum_{i=1}^n a_i Y_i \qquad \text{ and } \qquad U_2 = \sum_{j=1}^m b_j X_j \] for constants \(a_1, a_2, \dots, a_n\) and \(b_1, b_2, \dots, b_m\).
Theorem: Then the following hold:
Theorem: If \(X\) and \(Y\) are independent, then \[ E[XY] = E[X]E[Y]. \]
Question: Consider the following two statements:
Example: Let \(k\) be chosen uniformly at random from \(\{1, 2, 3, 4\}\), and define \(X\) and \(Y\) by the table below.
| \(k\) | ||||
| 1 | 2 | 3 | 4 | |
| \(X\) | \(1\) | \(0\) | \(-1\) | \(0\) |
| \(Y\) | \(0\) | \(1\) | \(0\) | \(-1\) |
Let \(X\) and \(Y\) be two random variables. The correlation coefficient is \[ \rho = \frac{Cov(X, Y)}{\sqrt{V(X) V(Y)}}. \]
Properties:
(Assume \(V(X), V(Y) > 0\).)
Theorem: For any random variables \(X\) and \(Y\), \[ \big( E[XY] \big)^2 \le E[X^2] E[Y^2]. \]
Recall that, if we have two events \(A\) and \(B\) and \(P(B) \ne 0\), that the conditional probability of \(A\) given \(B\) is: \[ P(A \mid B) = \frac{P(A \cap B)}{P(B)}. \]
Can we generalize this to random variables, so that we can determine the distribution of \(X\) given \(Y = y\)?
Let \(X\) and \(Y\) be two discrete random variables. The conditional probability mass function (PMF) of \(X\) given \(Y\) is \[ p_{X \mid Y}(x \mid y) = \frac{p_{X, Y}(x, y)}{p_Y(y)}, \qquad \text{provided } p_Y(y) > 0. \]
For fixed \(y\), \(p_{X \mid Y}(x \mid y)\) is a PMF.
Theorem: Let \(X\) and \(Y\) be two discrete random variables. Let \(A\) be an event. \[ \begin{aligned} P[X \in A \mid Y = y] &= \sum_{x \in A} p_{X \mid Y}(x \mid y) \\ &= \frac{\sum_{x \in A} p_{X, Y}(x, y)}{p_Y(y)}, \end{aligned} \] and \[ \begin{aligned} P[X \in A] &= \sum_{x \in A} \sum_{y \in \Omega_Y} p_{X \mid Y}(x \mid y) p_Y(y) \\ &= \sum_{y \in \Omega_Y} P[X \in A \mid Y = y] p_Y(y). \end{aligned} \]
| \(Y\) | |||||
| \(1\) | \(2\) | \(3\) | \(4\) | ||
| \(X\) | \(1\) | \(\frac{1}{20}\) | \(\frac{1}{20}\) | \(\frac{1}{20}\) | \(0\) |
| \(2\) | \(\frac{1}{20}\) | \(\frac{2}{20}\) | \(\frac{3}{20}\) | \(\frac{1}{20}\) | |
| \(3\) | \(\frac{1}{20}\) | \(\frac{2}{20}\) | \(\frac{3}{20}\) | \(\frac{1}{20}\) | |
| \(4\) | \(0\) | \(\frac{1}{20}\) | \(\frac{1}{20}\) | \(\frac{1}{20}\) | |
Let \(X\) and \(Y\) be two continuous random variables. The conditional probability density function (PDF) of \(X\) given \(Y\) is \[ f_{X \mid Y}(x \mid y) = \frac{f_{X, Y}(x, y)}{f_Y(y)}, \qquad \text{provided } f_Y(y) > 0. \]
Let \(X\) and \(Y\) be continuous random variables. Then the conditional cumulative distribution function of \(X\) given \(Y = y\) is \[ F_{X \mid Y}(x \mid y) = \frac{\displaystyle\int_{-\infty}^x f_{X,Y}(t, y) \, dt}{f_Y(y)}. \]
Theorem: Let \(X\) and \(Y\) be continuous random variables, and let \(A\) be an event.
Example: Suppose that \(f(x, y) = \frac{e^{-\frac{x}{y}} e^{-y}}{y}\) for \(0 < x, y < \infty\) and 0 otherwise. Find \(P(X > 1 \mid Y = y)\).
The conditional expectation of \(X\) given \(Y=y\) is \[ E[X \mid Y = y] = \sum_x x \, p_{X \mid Y}(x \mid y) \] for discrete random variables, and \[ E[X \mid Y = y] = \int_{-\infty}^\infty x \, f_{X \mid Y}(x \mid y) \, dx \] for continuous random variables.
| \(X\) | ||||||
| \(0.01\) | \(0.1\) | \(1\) | \(10\) | \(100\) | ||
| \(Y\) | \(10^4\) | \(0\) | \(0\) | \(\frac{1}{12}\) | \(\frac{1}{18}\) | \(\frac{1}{36}\) |
| \(10^2\) | \(\frac{5}{12}\) | \(\frac{5}{18}\) | \(\frac{5}{36}\) | \(0\) | \(0\) | |
Theorem: The Law of Total Expectation states that \[ E[X] = \sum_y E[X \mid Y = y] p_Y(y), \] or \[ E[X] = \int_{-\infty}^\infty E[X \mid Y = y] f_Y(y) \, dy. \]
Corollary: Let \(X\) and \(Y\) be two random variables. Then \[ E[X] = E[E[X \mid Y]]. \]
| \(X\) | ||||||
| \(0.01\) | \(0.1\) | \(1\) | \(10\) | \(100\) | ||
| \(Y\) | \(10^4\) | \(0\) | \(0\) | \(\frac{1}{12}\) | \(\frac{1}{18}\) | \(\frac{1}{36}\) |
| \(10^2\) | \(\frac{5}{12}\) | \(\frac{5}{18}\) | \(\frac{5}{36}\) | \(0\) | \(0\) | |