---
title: "Two discrete variables"
description: "Check that a table or formula is a valid joint PMF, find its support, normalize a constant, and sum the right cells for events like X + Y ≥ 1."
canonical_url: "https://fanout.sh/ml-math/lessons/joint-rvs-joint-laws-for-discrete-variables-t-12uczxr"
md_url: "https://fanout.sh/ml-math/lessons/joint-rvs-joint-laws-for-discrete-variables-t-12uczxr.md"
access: "public"
---

# Two discrete variables

Check that a table or formula is a valid joint PMF, find its support, normalize a constant, and sum the right cells for events like X + Y ≥ 1.

Two measurements from the same outcome belong in one probability table. Learn to read that table, keep one measurement, condition on the other, and accumulate probabilities below two thresholds.

## One outcome, two measurements

Imagine choosing one record at random from a collection of $20$ equally likely records. Each record has two numerical measurements: a tag $X$ that is $0$ or $1$, and a count $Y$ that is $0$, $1$ or $2$. A random variable is a numerical value determined by the random outcome. Here the same selected record determines both variables.

We choose the following example counts: among records tagged $0$, the three counts occur $2$, $3$ and $1$ times; among records tagged $1$, they occur $4$, $2$ and $8$ times. Divide each count by $20$ to get its probability. Rows represent $X$; columns represent $Y$.

| $p_{X,Y}(x,y)$ | $Y=0$ | $Y=1$ | $Y=2$ |
| --- | --- | --- | --- |
| $X=0$ | $2/20$ | $3/20$ | $1/20$ |
| $X=1$ | $4/20$ | $2/20$ | $8/20$ |

This is a joint probability mass function, or joint PMF. Its entry $p_{X,Y}(x,y)$ means $P(X=x,Y=y)$: the probability that both equalities hold. For example, $p_{X,Y}(1,2)=8/20=2/5$. The number $2$ is a possible value of $Y$; the fraction $2/5$ is a probability. They have different jobs.

Every entry must be nonnegative, and the entries must total $1$. Here $(2+3+1+4+2+8)/20=1$. A compact way to write that addition is a double sum: first add across the possible $y$ values at each fixed $x$, then add those row totals. The subscripts below the sums name values of the variables, not row numbers.

$$p_{X,Y}(x,y)\ge0,\qquad \sum_x\sum_y p_{X,Y}(x,y)=1$$

### Select the records described by an event

1. For $P(X=1,Y\le1)$, keep row $X=1$ and columns $Y=0,1$. Add their disjoint possibilities: $(4+2)/20=3/10$.
2. For $P(X=0\text{ or }Y=2)$, add the $X=0$ row, with total $6/20$, and the $Y=2$ column, with total $9/20$. Their shared cell $(0,2)$ was counted twice, so subtract $1/20$. The result is $14/20=7/10$.
3. For $P(XY\ge1)$, test the product at each pair. All $X=0$ cells fail. In row $X=1$, only $Y=1,2$ qualify, giving $(2+8)/20=1/2$.

If the table had instead been given as unknown multiples $c$ of the six counts, normalization would give $20c=1$, hence $c=1/20$. This is how an unknown probability multiplier is determined: add its weights over the stated possible pairs before solving for it.

A possible value pair can still have zero mass

The positive-mass support consists of the pairs whose entries are positive; every other pair has probability zero. It need not contain every combination of the separate values. For example, a different model puts mass $1/2$ at $(0,0)$ and $1/2$ at $(1,1)$. Both variables can be $0$ or $1$, yet $(0,1)$ and $(1,0)$ never occur. For countably many possible pairs, the same nonnegative-sum definition applies.

---
This representation contains public Fanout content only. Protected Pro lessons, account data, billing, checkout, and pricing are not included.

Browse the public content map: https://fanout.sh/sitemap.md
