Why Condition on a Particular Value?
A joint probability table describes two discrete random variables together. It can answer questions such as, “What is the probability of this pair of outcomes?” A conditional probability mass function (pmf) answers a narrower question: once one variable’s value is known, how are the possible values of the other variable distributed? This is useful whenever a classification, observation, or outcome is already known and the remaining uncertainty must be described.
The central calculation is a division: take the joint probability for a pair of values and divide it by the marginal probability of the value being conditioned on. The main practical challenge is choosing that denominator correctly. In a table, it is the total probability in the row or column corresponding to the stated condition.
For a finite table, the marginal is found by adding the joint probabilities across all possible values of \(X\) while holding \(Y=y\) fixed. If \(Y\) is displayed in the columns, add down the column for \(y\). If \(Y\) is displayed in the rows, add across the row for \(y\). The layout does not change the rule: the denominator must be the probability of the condition.
Why the Division Produces a Conditional PMF
For any event \(B\) with \(P(B)>0\), conditional probability is defined by \(P(A\mid B)=P(A\cap B)/P(B)\). Apply this definition with \(A=\{X=x\}\) and \(B=\{Y=y\}\). Their intersection is the event that both equalities hold, so its probability is the joint pmf value \(p_{X,Y}(x,y)\). The probability of \(B\) is the marginal \(p_Y(y)\). This gives the conditional-pmf formula.
The same reasoning also explains why the resulting values form a pmf. For fixed \(y\) with positive marginal probability, sum the formula over all possible \(x\):
Thus, conditioning selects the joint probabilities associated with the given value and rescales them to total one. Values of \(x\) that cannot occur with the condition have joint probability zero and therefore conditional probability zero.
Reading Conditional Probabilities from Tables
A table may contain probabilities or counts. When it contains probabilities, use the relevant joint probability in the numerator and the marginal probability in the denominator. When it contains counts from a common finite sample, the conditional probability is the relevant count divided by the total count among observations satisfying the condition. The common sample-size factor cancels: if a cell has count \(n_{xy}\) and the conditioning column has total \(n_y\), then \((n_{xy}/n)/(n_y/n)=n_{xy}/n_y\).
Before calculating, state which variable is being conditioned on and identify its value. That determines the denominator. Then calculate each conditional pmf entry, and finally add entries if the question asks for a set of values rather than a single value.
Worked Example: Conditional Group Probabilities from File Counts
A hypothetical review classifies 80 claim files by processing group \(X\in\{A,B,C\}\) and whether an alert was recorded, \(Y\in\{0,1\}\). The counts are shown below. Find the conditional pmf of \(X\) given an alert, the probability that the group is A or C given an alert, and the conditional pmf of \(X\) given no alert.
| Group \(X\) | No alert \(Y=0\) | Alert \(Y=1\) | Row total |
|---|---|---|---|
| A | 12 | 8 | 20 |
| B | 18 | 12 | 30 |
| C | 10 | 20 | 30 |
| Column total | 40 | 40 | 80 |
Method. Condition on the alert status, so use the alert-column total, 40, as the denominator. The three alert counts are 8, 12, and 20. They sum to 40, so they exhaust the alert files.
Therefore, the conditional pmf assigns probabilities \(0.2000, 0.3000, 0.5000\) to A, B, and C, respectively. The event “A or C” contains two mutually exclusive group values, so add their conditional probabilities:
For no alert, the conditioning column total is also 40. Thus,
Check. The alert probabilities sum to \(0.2000+0.3000+0.5000=1.0000\), and the no-alert probabilities sum to \(0.3000+0.4500+0.2500=1.0000\). The error to avoid is dividing each count by the full 80 files: that would give joint probabilities, not probabilities conditional on alert or no alert.
Conditional PMFs from Joint Probabilities
With a probability table, first check that the table entries are joint probabilities and identify the marginal of the conditioning variable. Then divide each joint entry in the selected row or column by that marginal. The entries outside the selected row or column do not enter the conditional pmf.
Worked Example: Conditioning on a Column of a Joint PMF
For discrete variables \(X\) and \(Y\), suppose the joint pmf is given by the following table. Find the pmf of \(X\) given \(Y=2\), and calculate \(P(X\geq 1\mid Y=2)\).
| \(X\) | \(Y=1\) | \(Y=2\) |
|---|---|---|
| 0 | 0.10 | 0.05 |
| 1 | 0.15 | 0.20 |
| 2 | 0.25 | 0.25 |
Method. The marginal probability of \(Y=2\) is the sum of its column:
Because this marginal is positive, the conditional pmf is defined. Divide each entry in the \(Y=2\) column by \(0.50\):
The event \(X\geq1\) includes \(X=1\) and \(X=2\), so its conditional probability is
Check. The conditional probabilities sum to \(0.10+0.40+0.50=1.00\). The whole joint table also sums to \(0.10+0.05+0.15+0.20+0.25+0.25=1.00\). A common mistake is to use the row total for \(X=1\) as the denominator when computing \(P(X=1\mid Y=2)\). The condition is \(Y=2\), so the correct denominator is the \(Y=2\) marginal, \(0.50\), not the \(X=1\) marginal.
Changing Which Variable Is Conditioned On
A joint table supports conditional pmfs in either direction, but the calculation changes when the conditioning variable changes. To find \(X\) given \(Y=y\), use the \(Y=y\) marginal. To find \(Y\) given \(X=x\), use the \(X=x\) marginal. These are generally different distributions; the two variables must not be interchanged just because they appear in the same joint table.
Worked Example: Conditioning in Both Directions from Counts
A hypothetical portfolio review records a risk tier \(X\in\{\text{low},\text{medium},\text{high}\}\) and the number of review flags \(Y\in\{0,1,2\}\) for 48 files. Find the pmf of risk tier given exactly one flag, the probability of a non-low tier under that condition, and the pmf of the number of flags given a high tier.
| Risk tier \(X\) | \(Y=0\) | \(Y=1\) | \(Y=2\) | Row total |
|---|---|---|---|---|
| Low | 8 | 4 | 2 | 14 |
| Medium | 5 | 7 | 4 | 16 |
| High | 3 | 6 | 9 | 18 |
| Column total | 16 | 17 | 15 | 48 |
Method for the first condition. Given \(Y=1\), the relevant column contains \(4,7,6\), and its total is \(4+7+6=17\). Hence,
The probability of a non-low tier is the sum for medium and high:
Method for the reverse condition. Given a high tier, use the high row total, 18. The counts for zero, one, and two flags are 3, 6, and 9, respectively:
Check. The first conditional probabilities sum to \((4+7+6)/17=1\); the second sum to \((3+6+9)/18=1\). The error to avoid is keeping the denominator 17 when reversing the condition. For \(Y\) given \(X=\text{high}\), the condition selects a row, so the denominator is 18.
A Reliable Table Procedure and Common Traps
The conditional-pmf calculation is short, but errors often come from reading the condition too quickly. Use the following sequence whenever a table is given:
Write the variable and its specified value, such as \(Y=1\). This identifies which marginal is needed.
Sum the joint probabilities or counts over all possible values of the other variable while keeping the condition fixed.
Divide each joint probability or count in the selected row or column by the conditioning marginal or count total.
If the event includes multiple values, add the corresponding conditional pmf entries.
Verify that the conditional pmf entries sum to one and that the conditioning marginal is positive.
A typical wrong calculation makes the numerator and denominator refer to different conditions. For example, in the 48-file table above, dividing the high-tier, one-flag count 6 by the high-tier row total 18 gives \(P(Y=1\mid X=\text{high})=6/18\). It does not give \(P(X=\text{high}\mid Y=1)\). For the latter, the condition is one flag, so the denominator is the one-flag total 17, and the answer is \(6/17\). Both ratios are valid conditional probabilities, but they answer different questions.
Another important limitation is a zero marginal. If a table assigns probability zero to \(Y=y\), then the ratio for conditioning on \(Y=y\) has a zero denominator. The usual discrete conditional pmf is not specified by this formula at that value. Do not divide by zero or silently choose a denominator from a different row or column.
Check Your Understanding
For each problem, identify the conditioning marginal before calculating. Answers are given at the end of each question.
- A hypothetical review table has counts \((X=A,Y=0)=6\), \((X=A,Y=1)=4\), \((X=B,Y=0)=3\), and \((X=B,Y=1)=7\). Find the conditional pmf of \(X\) given \(Y=1\), and find \(P(X=A\mid Y=1)\). (Answer: \(P(X=A\mid Y=1)=4/11=0.3636\), \(P(X=B\mid Y=1)=7/11=0.6364\); requested probability \(0.3636\).)
- A joint pmf has \(P(X=0,Y=b)=0.08\), \(P(X=1,Y=b)=0.12\), and \(P(X=2,Y=b)=0.20\), with \(P(Y=b)=0.40\). Find the conditional pmf of \(X\) given \(Y=b\), and \(P(X\geq1\mid Y=b)\). (Answer: conditional probabilities \(0.2000, 0.3000, 0.5000\); \(P(X\geq1\mid Y=b)=0.8000\).)
- Among a hypothetical set of files, counts by tier and outcome are: low tier \((Y=0,Y=1)=(14,6)\), medium tier \((9,11)\), and high tier \((7,13)\). Find the pmf of tier given \(Y=0\), and the probability of medium or high tier given \(Y=0\). (Answer: \(14/30=0.4667,\ 9/30=0.3000,\ 7/30=0.2333\); medium or high \(=16/30=0.5333\).)
- A joint probability table assigns \(P(X=0,Y=0)=0.20\), \(P(X=1,Y=0)=0.30\), and zero probability to every pair with \(Y=2\). Is \(P(X=1\mid Y=2)\) defined by the usual conditional-pmf formula? (Answer: No; \(P(Y=2)=0\), so the formula has a zero denominator.)
- A hypothetical count table has rows \(X=A,B,C\) and columns \(Y=0,1,2\): row A is \((3,5,2)\), row B is \((4,2,4)\), and row C is \((5,3,2)\). Find the conditional pmf of \(X\) given \(Y=2\), and \(P(X=A\text{ or }X=C\mid Y=2)\). (Answer: the \(Y=2\) total is 8; conditional probabilities for A, B, C are \(2/8,4/8,2/8\); requested probability \(4/8=0.5000\).)