1. Big picture
Section 1 studied events. Section 2 studied one random variable. Section 3 studies two random variables together: how they vary jointly, how to summarize each one separately, and how knowing one variable changes the distribution of the other.
The joint distribution answers questions such as $P(X=x,Y=y)$ or $P((X,Y)\in A)$.
The marginal distribution of $X$ ignores $Y$ by summing or integrating over all $Y$ values.
The conditional distribution of $X$ given $Y=y$ updates probabilities after information about $Y$ is known.
2. Joint PMF table
For discrete random variables, the joint PMF can be stored in a table. The entries must be nonnegative and the total sum must be $1$.
Interactive joint table
Edit the four probabilities below. Click Normalize if the total is not $1$.
| $Y=0$ | $Y=1$ | Row sum $p_X(x)$ | |
|---|---|---|---|
| $X=0$ | |||
| $X=1$ | |||
| Column sum $p_Y(y)$ |
Read from the table
$P(X=1,Y=0)=$
$P(X=1)=$
$P(Y=1)=$
$P(X=1\mid Y=1)=$
3. Marginal distributions
The word marginal comes from the margins of a table: row sums and column sums.
Discrete case
Continuous case
4. Conditional distributions
A conditional distribution rescales one slice of the joint distribution so that the slice has total probability $1$.
Conditional probabilities from current table
The bars in the plot should add to $1$ because a conditional distribution is a complete probability distribution after conditioning.
5. Independence checker
Two discrete random variables are independent if every joint entry factors into the product of its marginals.
Current table result
Maximum factorization error:
6. Total probability and Bayes' theorem
The law of total probability combines several conditional probabilities. Bayes' theorem reverses the conditioning direction.
Interactive medical test example
Computed probabilities
Overall positive rate $P(+)=$
Posterior probability $P(D\mid +)=$
With the default values, the overall positive probability is $(0.95)(0.01)+(0.10)(0.99)=0.1085$, matching the course homework-style calculation.
7. Continuous joint density
For two continuous random variables, probability is volume under a surface over a region.
Uniform unit square: geometric probability
Let $(X,Y)$ be uniform on $[0,1]^2$. Then $f_{X,Y}(x,y)=1$ on the square, so probabilities equal areas.
8. Bivariate normal explorer
A standard bivariate normal pair has correlation parameter $\rho$. When $\rho=0$, the variables are independent. As $|\rho|$ increases, the cloud becomes more line-shaped.
Conditional normal intuition
For a standard bivariate normal pair,
$$X\mid Y=y\sim N(\rho y,1-\rho^2).$$
Conditional mean $E[X\mid Y=y]=$
Conditional variance $\mathrm{Var}(X\mid Y=y)=$
9. Simulation lab
Simulation helps students connect joint distributions to empirical frequencies.