14  Conditional Distributions

Example 14.1 Roll a fair four-sided die twice. Let \(X\) be the sum of the two rolls, and let \(Y\) be the larger of the two rolls (or the common value if a tie). We have previously found the joint and marginal distributions of \(X\) and \(Y\), displayed in the two-way table below.

\(p_{X, Y}(x, y)\)
\(x\) \ \(y\) 1 2 3 4 \(p_{X}(x)\)
2 1/16 0 0 0 1/16
3 0 2/16 0 0 2/16
4 0 1/16 2/16 0 3/16
5 0 0 2/16 2/16 4/16
6 0 0 1/16 2/16 3/16
7 0 0 0 2/16 2/16
8 0 0 0 1/16 1/16
\(p_Y(y)\) 1/16 3/16 5/16 7/16
  1. Compute \(p_{X|Y}(6|4) = \text{P}(X=6|Y=4)\).




  2. Construct a table, plot, and spinner to represent the conditional distribution of \(X\) given \(Y=4\).




  3. Construct a table, plot, and spinner to represent the conditional distribution of \(X\) given \(Y=3\).




  4. Construct a table, plot, and spinner to represent the conditional distribution of \(X\) given \(Y=2\).




  5. Construct a table, plot, and spinner to represent the conditional distribution of \(X\) given \(Y=1\).




  6. Compute \(p_{Y|X}(4|6) = \text{P}(Y=4|X=6)\).




  7. Construct a table, plot, and spinner to represent the distribution of \(Y\) given \(X=6\).




  8. Construct a table, plot, and spinner to represent the distribution of \(Y\) given \(X=5\).




  9. Construct a table, plot, and spinner to represent the distribution of \(Y\) given \(X=4\).




Figure 14.1: Impulse plots representing the family of conditional distributions of \(X\) given \(Y\) for the dice rolling example. Each plot represents a conditional distribution of \(X\) given \(Y=y\) for a particular value of \(y= 1, 2, 3, 4\).
Figure 14.2: Spinners representing the family of conditional distributions of \(X\) given \(Y\) in the dice rolling example. Each spinner represents a conditional distribution of \(X\) given \(Y=y\) for a particular value of \(y= 1, 2, 3, 4\).

Example 14.2 We have already discussed two ways for simulating an \((X, Y)\) pair in the dice rolling example: simulate a pair of rolls and measure \(X\) (sum) and \(Y\) (max), or spin the joint distribution spinner for \((X, Y)\) once.

  1. Now describe another way for simulating an \((X, Y)\) pair using the spinners in Example 14.1. (Hint: you’ll need one more spinner in addition to the four from the previous example.)




  2. Describe in detail how you can simulate \((X, Y)\) pairs and use the results to approximate \(\text{P}(X = 6 | Y = 4)\).




  3. Describe in detail how you can simulate \((X, Y)\) pairs and use the results to approximate the conditional distribution of \(X\) given \(Y = 4\).




  4. Describe in detail how you can simulate values from the conditional distribution of \(X\) given \(Y=4\) without simulating \((X, Y)\) pairs.




Mosaic plot of conditional distributions of X given values of Y

Mosaic plot of conditional distributions of Y given values of X

14.1 Conditional Expected Value

Example 14.3 Roll a fair four-sided die twice. Let \(X\) be the sum of the two rolls, and let \(Y\) be the larger of the two rolls (or the common value if a tie).

\(p_{X, Y}(x, y)\)
\(x\) \ \(y\) 1 2 3 4 \(p_{X}(x)\)
2 1/16 0 0 0 1/16
3 0 2/16 0 0 2/16
4 0 1/16 2/16 0 3/16
5 0 0 2/16 2/16 4/16
6 0 0 1/16 2/16 3/16
7 0 0 0 2/16 2/16
8 0 0 0 1/16 1/16
\(p_Y(y)\) 1/16 3/16 5/16 7/16
  1. Compute and interpret \(\text{E}(Y)\). How could you find a simulation-based approximation?


  2. We have seen that the long run average value of \(Y\) is 3.125. Would you expect the conditional long run average value of \(Y\) given \(X = 8\) to be greater than, less than, or equal to 3.125? Explain without doing any calculations. What about given \(X = 3\)?




  3. How could you use simulation to approximate the conditional long run average value of \(Y\) given \(X = 6\)?




  4. Compute and interpret \(\text{E}(Y|X=6)\).


  5. Find \(\text{E}(Y|X=x)\) for each possible value of \(x\) of \(X\).




  6. Compute and interpret \(\text{E}(X|Y = 4)\). How could you find a simulation-based approximation?


  7. Find \(\text{E}(X|Y = y)\) for each possible value \(y\) of \(Y\).




  • The conditional expected value (a.k.a. conditional expectation a.k.a. conditional mean), of a random variable \(Y\) given the event \(\{X=x\}\), defined on a probability space with measure \(\text{P}\), is a number denoted \(\text{E}(Y|X=x)\) representing the probability-weighted average value of \(Y\), where the weights are determined by the conditional distribution of \(Y\) given \(X=x\). \[\begin{align*} & \text{Discrete $X, Y$ with conditional pmf $p_{Y|X}$:} & \text{E}(Y|X=x) & = \sum_y y p_{Y|X}(y|x)\\ \end{align*}\]
  • Remember, when conditioning on \(X=x\), \(x\) is treated as a fixed constant. The conditional expected value \(\text{E}(Y | X=x)\) is a number representing the mean of the conditional distribution of \(Y\) given \(X=x\).
  • The conditional expected value \(\text{E}(Y | X=x)\) is the long run average value of \(Y\) over only those outcomes for which \(X=x\).
  • To approximate \(\text{E}(Y|X = x)\), simulate many \((X, Y)\) pairs, discard the pairs for which \(X\neq x\), and average the \(Y\) values for the pairs that remain.