Lecture #8: Joint Distributions

MATH 321 – Mathematical Statistics I

Torin Quinlivan

Knox College

October 22, 2025

Multivariate Random Variables

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 indentically and independently distributed (i.i.d.) random variables.

Similarly, linear regression is built on a specific relationship of random variables: \[ Y = \beta X + \varepsilon, \qquad \varepsilon \sim N(0, 1) \]

Bivariate Normal Distribution

Joint Probability Mass Functions

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, \xi) \mid \{ X(\omega) = x \} \cap \{ Y(\xi) = y \}]. \end{aligned} \]

If the area \(X\) and \(Y\), \(A\), are defined on is a subset of \(\mathbb{R}^2\) (\(A \subset \mathbb{R} \times \mathbb{R}\)), then: \[ P(A) = \sum_{(x, y) \in A} p_{X,Y}(x, y). \]

Note that these are valid PMFs! All properties apply!

Joint PMF Example

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}\)
  1. What is the probability of getting a heads and an even number?
  2. Are \(X\) and \(Y\) independent?

Joint Probability Density Functions

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 inegrated to yield a probability: \[ P(\mathcal{A}) = \int_A f_{X,Y}(x,y) \, dx \, dy, \] for any event \(\mathcal{A} \subseteq \Omega_X \times \Omega_Y\).

In particular, if \(A = [a,b] \times [c,d]\), then \[ P(\mathcal{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!

Joint PDF Example

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} \]

  1. What is the probability that \(X \ge 2\) and \(Y \ge 2\)?
  2. What is the probability that X and Y are less than 1 apart?

Marginal PMFs and Marginal PDFs

The marginal probability mass function (PMF) is defined as: \[\begin{align} 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{align}\]

The marginal probability density function (PDF) is defined as: \[\begin{align} 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{align}\]

Note that these are valid PMFs/PDFs! All properties apply!

Joint PMF Example

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}\)
  1. Find the marginal PMFs of \(X\) and \(Y\).

Joint PDF Example

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} \]

  1. Find the marginal PDFs of \(X\) and \(Y\).

Extending to \(N\) Random Variables

A collection of random variables \(X_1, X_2, \dots, X_N\) is called independent and identically distributed (i.i.d.) if:

  1. All \(X_1, X_2, \dots, X_N\) are mutually independent.

  2. 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\).

Joint Expectation

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: Suppose \(X, Y \sim N(0,1)\). Find \(E(XY)\).

Covariance

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) = Var(X)\).

Covariance

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 variable, then \(Cov(X_i, X_j)\) makes the covariance matrix, \(\Sigma\).

Joint Expectation and Variance

Theorem: For any \(X\) and \(Y\),

  1. \(E[X + Y] = E[X] + E[Y]\).
  2. \(Var[X + Y] = Var[X] + Var[Y] + 2Cov(X,Y)\).

Joint Expectation and Variance

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\).

Joint Expectation and Variance

Theorem: Then the following hold:

  1. \(E(U_1) = \displaystyle\sum_{i = 1}^n a_i \mu_i\).
  2. \(Var[U_1] = \displaystyle\sum_{i=1}^n a_i^2 Var[Y_i] + 2 \underset{1 \le i < j \le n}{\sum \sum} a_i a_j Cov(Y_i,Y_j)\).
  3. \(Cov(U_1, U_2) = \displaystyle\sum_{i=1}^n \sum_{j=1}^m a_i b_j Cov(Y_i, X_j)\).

Covariance and Independence

Theorem: If \(X\) and \(Y\) are independent, then \[ E[XY] = E[X]E[Y]. \]

Theorem: Consider the following two statements:

  1. \(X\) and \(Y\) are independent.
  2. \(Cov(X, Y) = 0\).
  1. Does statement (a) imply statement (b)?
  2. Does statement (b) imply statement (a)?

Example of Zero Covariance but Non-Independent

Example: Consider the following two variables \(X\) and \(Y\).

\(k\)
1 2 3 4
\(X\) \(1\) \(0\) \(-1\) \(0\)
\(Y\) \(0\) \(1\) \(0\) \(-1\)
  1. What is the covariance of \(X\) and \(Y\)?
  2. Are \(X\) and \(Y\) independent?

The Correlation Coefficient

Let \(X\) and \(Y\) be two random variables. The correlation coefficient is \[ \rho = \frac{Cov(X, Y)}{\sqrt{Var(X) Var(Y)}}. \]

Properties:

  1. \(\rho\) is always between \(-1\) and \(1\), i.e. \(-1 \le \rho \le 1\).
  2. When \(X = Y\), \(\rho = 1\).
  3. When \(X = -Y\), \(\rho = -1\).
  4. When \(X\) and \(Y\) are uncorrelated, \(\rho = 0\).

Cauchy-Schwarz Inequality

Theorem: For any random variables \(X\) and \(Y\), \[ \big( E[XY] \big)^2 \le E[X^2] E[Y^2]. \]

Conditional Probability

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\)?

Conditional PMFs

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)}. \]

For fixed \(y\), \(p_{X \mid Y}(x \mid y)\) is a PMF.

Conditional PMFs

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} \]

Conditional PMFs Example

\(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}\)
  1. Find the marginal PMF \(p_X(x)\).
  2. Find the conditional PMF \(p_{X \mid Y}(x \mid 1)\).

Conditional PDFs

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)}. \]

Conditional CDFs

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)}. \]

Conditional Probabilities

Theorem: Let \(X\) and \(Y\) be continuous random variables, and let \(A\) be an event.

  1. \(P(X \in A \mid Y = y) = \displaystyle\int_A f_{X \mid Y}(x \mid y) \, dx\).
  2. \(P(X \in A) = \displaystyle\int_{\Omega_Y} P(X \in A \mid Y = y) f_Y(y) \, dy\).

Conditional CDF Example

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)\).

Conditional Expectation

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 \, p_{X \mid Y}(x \mid y) \] for continuous random variables.

Conditional Expectation and Linear Regression

Conditional Expectation and Linear Regression

Conditional Expectation Example

\(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\)
  1. Find \(E[X \mid Y = 10^2]\).
  2. Find \(E[X \mid Y = 10^4]\).

Law of Total Expectation

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]]. \]

Law of Total Expectation Example

\(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\)
  1. Find \(E[X]\)