23  Conditional Distributions

23.1 Discrete random variables: Conditional probability mass functions

Example 23.1 Roll a fair four-sided die once and let X be the number rolled. Then flip a fair coin X times and let Y be the number of heads.

  1. Identify the possible values of X.




  2. Identify the possible values of Y.




  3. Find the conditional distribution of Y given X=4.




  4. Find the conditional distribution of Y given X=3.




  5. Find the probability that X=3 and Y=2.




  6. Find the probability that X=3 and Y=y for y=0,1,2,3,4.




  7. Find the joint distribution of X and Y.




  8. Find the marginal distribution of Y.




  9. Find the conditional distribution of X given Y=2.




  • Let X and Y be two discrete random variables defined on a probability space with probability measure P. For any fixed x with P(X=x)>0, the conditional probability mass function (pmf) of Y given X=x is a function pY|X defined by pY|X(y|x)=P(Y=y|X=x). pY|X(y|x)=P(Y=y|X=x)=P(X=x,Y=y)P(X=x)=pX,Y(x,y)pX(x)a function of y for fixed x
  • To emphasize, the notation pY|X(|x) represents the distribution of the random variable Y given a fixed value x of the random variable X. In the expression pY|X(y|x), y is treated as the variable and x is treated like a fixed constant.
  • Notice that the pmfs satisfy conditional=jointmarginal
  • Conditional distributions can be obtained from a joint distribution by slicing and renormalizing. The conditional pmf of Y given X=x can be thought of as:
    • the slice of the joint pmf pX,Y(x,y) of (X,Y) corresponding to X=x, a function of y alone,
    • renormalized — by dividing by pX(x) — so that the probabilitiess, corresponding to different y values, for the slice sum to 1.
  • For a fixed x, the shape of the conditional pmf of Y given X=x is determined by the shape of the x-slice of the joint pmf, pX,Y(x,y). That is, As a function of values of Y,pY|X(y|x)pX,Y(x,y)
  • For each fixed x, the conditional pmf pY|X(|x) is a different distribution on values of the random variable Y. There is not one “conditional distribution of Y given X”, but rather a family of conditional distributions of Y given different values of X.
  • Rearranging the definition of a conditional pmf yields the multiplication rule for pmfs of discrete random variables pX,Y(x,y)=pY|X(y|x)pX(x)=pX|Y(x|y)pY(y)joint=conditional×marginal
  • Marginal distributions can be obtained from the joint distribution by collapsing/stacking using the law of total probability. The law of total probability for pmfs is pY(y)=xpX,Y(x,y)=xpY|X(y|x)pX(x)

23.2 Continuous random variables: Conditional probability density functions

  • Let X and Y be two continuous random variables with joint pdf fX,Y and marginal pdfs fX,fY. For any fixed x with fX(x)>0, the conditional probability density function (pdf) of Y given X=x is a function fY|X defined by fY|X(y|x)=fX,Y(x,y)fX(x)a function of y for fixed x
  • To emphasize, the notation fY|X(y|x) represents a conditional distribution of the random variable Y for a fixed value x of the random variable X. In the expression fY|X(y|x), x is treated like a constant and y is treated as the variable.
  • Notice that the pdfs satisfy conditional=jointmarginal
  • Conditional distributions can be obtained from a joint distribution by slicing and renormalizing. The conditional pdf of Y given X=x can be thought of as:
    • the slice of the joint pdf fX,Y(x,y) of (X,Y) corresponding to X=x, a function of y alone,
    • renormalized — by dividing by fX(x) — so that the density heights, corresponding to different y values, for the slice are such that the total area under the density slice is 1.
  • For a fixed x, the shape of the conditional pdf of Y given X=x is determined by the shape of the x-slice of the joint pdf, fX,Y(x,y). That is, As a function of values of Y,fY|X(y|x)fX,Y(x,y)
  • For each fixed x, the conditional pdf fY|X(|x) is a different distribution on values of the random variable Y. There is not one “conditional distribution of Y given X”, but rather a family of conditional distributions of Y given different values of X.
  • Rearranging the definition of a conditional pdf yields the multiplication rule for pdfs of continuous random variables fX,Y(x,y)=fY|X(y|x)fX(x)=fX|Y(x|y)fY(y)joint=conditional×marginal
  • Marginal distributions can be obtained from the joint distribution by collapsing/stacking using the law of total probability. The law of total probability for pmfs is fY(y)=fX,Y(x,y)dx=fY|X(y|x)fX(x)dx
  • Remember that the probability that a continuous random variable is equal to a particular value is 0; that is, for continuous X, P(X=x)=0. When we condition on {X=x} we are really conditioning on {|Xx|<ϵ} and seeing what happens in the idealized limit when ϵ0.
  • When simulating, never condition on {X=x}; rather, condition on {|Xx|<ϵ} where ϵ represents some suitable degree of precision (e.g. ϵ=0.005 if rounding to two decimal places).
  • Remember pdfs do not return probabilities directly; fY|X(y|x) is not a probability of anything. But fY|X(y|x) is related to the probability that Y is “close to” y given that X is “close to” x: P(yϵ/2<Y<y+ϵ/2|xϵ/2<X<x+ϵ/2)ϵfY|X(y|x)

Example 23.2 Recall the continuous analog of the four-sided die problem. Spin the Uniform(1, 4) spinner twice and let X be the sum of the two spins and Y the larger to the two spins (or the common value if a tie). Recall that the joint pdf is

fX,Y(x,y)={2/9,2<x<8,1<y<4,x/2<y<x1,0,otherwise, the marginal pdf of Y is fY(y)={(2/9)(y1),1<y<4,0,otherwise, and the marginal pdf of X is fX(x)={(1/9)(x2),2<x<5,(1/9)(8x),5<x<8,0,otherwise.

  1. Find fX|Y(|3), the conditional pdf of X given Y=3.




  2. Find P(X>5.5|Y=3).




  3. Find fX|Y(|4), the conditional pdf of X given Y=4.




  4. Find P(X>5.5|Y=4).




  5. Find fX|Y(|y), the conditional pdf of X given Y=y, for 1<y<4.




  6. Find fY|X(|3.5), the conditional pdf of Y given x=3.5.




  7. Find fY|X(|6), the conditional pdf of Y given x=6.




  8. Find fY|X(|x), the conditional pdf of Y given x.




Example 23.3 Suppose X and Y are continuous RVs with joint pdf

fX,Y(x,y)=1xex,x>0,0<y<x.

  1. Identify by name the one-way conditional distributions that you can obtain from the joint pdf, without doing any calculus or computation.




  2. Identify by name the marginal distribution you can obtain without doing any calculus or computation.




  3. Describe how could you use the Exponential(1) spinner and the Uniform(0, 1) spinner to generate an (X,Y) pair.




  4. Sketch a plot of the joint pdf.




  5. Sketch a plot of the marginal pdf of Y.




  6. Set up the calculation you would perform to find the marginal pdf of Y.