Reading a Joint Probability Table
A joint probability table records probabilities for pairs of values taken by two random variables. To find the conditional mean of one variable given a value of the other, first isolate the relevant row or column, then rescale its entries so they sum to one. The conditional mean is the weighted average using those rescaled probabilities—not the average of the joint probabilities themselves.
In a table with values of \(X\) as rows and values of \(Y\) as columns, \(p_{X,Y}(x,y)\) is the entry where row \(x\) meets column \(y\). Summing across row \(x\) gives \(p_X(x)\). Dividing each entry in that row by the row total gives the conditional probabilities for \(Y\) given \(X=x\). A row with total zero cannot be used for conditioning: the event \(X=x\) has probability zero, so the displayed ratio is undefined.
Why the Row Must Be Normalized
The entries in a row are joint probabilities, not conditional probabilities. Their sum is the probability of the row event \(X=x\), which is generally less than one. Dividing by that sum converts the joint probabilities into probabilities conditional on that row.
Once the row is normalized, calculating its mean is an ordinary finite weighted sum. Equivalently, the normalization and averaging can be combined into one formula.
Worked Calculations
Worked Example: Conditional Means From Each Row
The table gives the joint probability mass function of \(X\) and \(Y\). Find the conditional mass function of \(Y\) and its mean for each possible value of \(X\).
| \(X\) | \(Y=0\) | \(Y=1\) | Row total |
|---|---|---|---|
| 0 | 0.10 | 0.20 | 0.30 |
| 1 | 0.15 | 0.15 | 0.30 |
| 2 | 0.10 | 0.30 | 0.40 |
The row totals are the marginal probabilities \(P(X=0)=0.30\), \(P(X=1)=0.30\), and \(P(X=2)=0.40\). They sum to one, as required. For \(X=0\), divide both entries by \(0.30\): $$ P(Y=0\mid X=0)=\frac{0.10}{0.30}=\frac13,\qquad P(Y=1\mid X=0)=\frac{0.20}{0.30}=\frac23. $$ Therefore, $$ E[Y\mid X=0]=0\left(\frac13\right)+1\left(\frac23\right)=\frac23. $$ For \(X=1\), the conditional probabilities are \(0.15/0.30=1/2\) for each value of \(Y\), so $$ E[Y\mid X=1]=0\left(\frac12\right)+1\left(\frac12\right)=\frac12. $$ For \(X=2\), they are \(0.10/0.40=1/4\) and \(0.30/0.40=3/4\). Hence $$ E[Y\mid X=2]=0\left(\frac14\right)+1\left(\frac34\right)=\frac34. $$ The conditional mean changes with the conditioning value: it is \(2/3\), \(1/2\), and \(3/4\) for \(X=0,1,2\), respectively.
Worked Example: A Conditional Mean of a Function
Suppose the joint table is as follows. Find \(E[Y\mid X=1]\) and \(E[h(X,Y)\mid X=1]\) for \(h(x,y)=x+y^2\).
| \(X\) | \(Y=0\) | \(Y=1\) | \(Y=2\) | Row total |
|---|---|---|---|---|
| 0 | 0.20 | 0.10 | 0.10 | 0.40 |
| 1 | 0.10 | 0.20 | 0.30 | 0.60 |
For the row \(X=1\), divide by the row total \(0.60\). The conditional probabilities of \(Y=0,1,2\) are $$ \frac{0.10}{0.60}=\frac16,\qquad \frac{0.20}{0.60}=\frac13,\qquad \frac{0.30}{0.60}=\frac12. $$ They sum to \(1/6+1/3+1/2=1\). The conditional mean of \(Y\) is $$ E[Y\mid X=1]=0\left(\frac16\right)+1\left(\frac13\right)+2\left(\frac12\right) =\frac13+1=\frac43. $$ For the function \(h(x,y)=x+y^2\), the values along this row are \(h(1,0)=1\), \(h(1,1)=2\), and \(h(1,2)=5\). Weight each of these by the corresponding conditional probability: $$ E[h(X,Y)\mid X=1] =1\left(\frac16\right)+2\left(\frac13\right)+5\left(\frac12\right) =\frac16+\frac46+\frac{15}{6} =\frac{20}{6} =\frac{10}{3}. $$ This calculation uses the function values themselves as the quantities being averaged; the probabilities still come from the conditional row.
Worked Example: Comparing Conditional Means Across Groups
Here \(X\) is a group label and \(Y\) is a numerical outcome. Find \(E[Y\mid X=a]\), \(E[Y\mid X=b]\), and \(E[Y\mid X=c]\).
| Group \(X\) | \(Y=0\) | \(Y=2\) | \(Y=5\) | Row total |
|---|---|---|---|---|
| \(a\) | 0.10 | 0.20 | 0.10 | 0.40 |
| \(b\) | 0.15 | 0.05 | 0.20 | 0.40 |
| \(c\) | 0.05 | 0.10 | 0.05 | 0.20 |
For group \(a\), the conditional probabilities are \(0.10/0.40=1/4\), \(0.20/0.40=1/2\), and \(0.10/0.40=1/4\). Thus $$ E[Y\mid X=a]=0\left(\frac14\right)+2\left(\frac12\right)+5\left(\frac14\right) =1+\frac54=\frac94=2.25. $$ For group \(b\), the conditional probabilities are \(0.15/0.40=3/8\), \(0.05/0.40=1/8\), and \(0.20/0.40=1/2\). Therefore, $$ E[Y\mid X=b]=0\left(\frac38\right)+2\left(\frac18\right)+5\left(\frac12\right) =\frac14+\frac52=\frac{11}{4}=2.75. $$ For group \(c\), the conditional probabilities are \(0.05/0.20=1/4\), \(0.10/0.20=1/2\), and \(0.05/0.20=1/4\). Hence $$ E[Y\mid X=c]=0\left(\frac14\right)+2\left(\frac12\right)+5\left(\frac14\right) =2.25. $$ The conditional mean is higher in group \(b\), while groups \(a\) and \(c\) have the same conditional mean. Equal means do not require identical conditional distributions: the table entries for groups \(a\) and \(c\) differ, but their normalized rows produce the same weighted average.
Common Mistakes and Interpretation
A conditional mean is a summary of the distribution within a specified conditioning value. It is not generally the same for every row, and it need not equal one of the possible values of \(Y\). It can be fractional even when \(Y\) only takes integer values, because it is a weighted average.
- Using joint entries directly as weights. In the first example, the entries in the \(X=0\) row sum to \(0.30\), not \(1\). Use each entry divided by \(0.30\), or divide the weighted joint sum by \(0.30\).
- Dividing by the wrong total. To find \(E[Y\mid X=x]\), use the marginal probability for that particular row, not the overall total (which is \(1\)) or a column total.
- Confusing a conditional mean with a joint contribution. The quantity \(y\,p_{X,Y}(x,y)\) is one contribution to an unnormalized row sum. It becomes part of the conditional mean only after the row sum is divided by \(p_X(x)\).
- Conditioning on a zero-probability row. If \(p_X(x)=0\), division by the row total is impossible. The table does not determine a conditional mass function for that value through this ratio.
In applications, comparing \(E[Y\mid X=x]\) across values of \(x\) describes how the average outcome differs across those conditions or groups. The table provides both the size of each group, through its row total, and the distribution within that group, through its normalized row. Keep these roles separate: row totals answer how probable the conditioning values are, while normalized rows determine the corresponding conditional means.
Check Your Understanding
Use the definitions and calculations above to answer the following questions.
- In a joint table with \(P(X=2,Y=0)=0.12\), \(P(X=2,Y=1)=0.18\), and \(P(X=2,Y=3)=0.30\), what is \(P(X=2)\), and what is the conditional mass function of \(Y\) given \(X=2\)?
- Using the row in Question 1, calculate \(E[Y\mid X=2]\).
- Why is it incorrect to treat the joint entries in a row as conditional probabilities when their total is less than one?
- For a finite joint table, write the formula for \(E[h(X,Y)\mid X=x]\) using joint probabilities and the row total.
- If two conditioning values have different conditional mass functions but the same conditional mean, does this contradict the definition? Explain.