106 Chapter 4:Random Variables and Expectation
EXAMPLE 4.3g Suppose thatp(x,y), the joint probability mass function ofXandY,is
given by
p(0, 0)=.4, p(0, 1)=.2, p(1, 0)=.1, p(1, 1)=.3.
Calculate the conditional probability mass function ofXgiven thatY=1.
SOLUTION We first note that
P{Y= 1 }=
∑
x
p(x,1)=p(0, 1)+p(1, 1)=.5
Hence,
P{X= 0 |Y= 1 }=
p(0, 1)
P{Y= 1 }
=2/5
P{X= 1 |Y= 1 }=
p(1, 1)
P{Y= 1 }
=3/5 ■
IfX andY have a joint probability density functionf(x,y), then the conditional
probability density function ofX, given thatY =y, is defined for all values ofysuch
thatfY(y)>0, by
fX|Y(x|y)=
f(x,y)
fY(y)
To motivate this definition, multiply the left-hand side bydxand the right-hand side by
(dx dy)/dyto obtain
fX|Y(x|y)dx=
f(x,y)dx dy
fY(y)dy
≈
P{x≤X≤x+dx,y≤Y≤y+dy}
P{y≤Y≤y+dy}
=P{x≤X≤x+dy|y≤Y≤y+dy}
In other words, for small values ofdxanddy,fX|Y(x|y)dxrepresents the conditional
probability thatXis betweenxandx+dx, given thatYis betweenyandy+dy.
The use of conditional densities allows us to define conditional probabilities of events
associated with one random variable when we are given the value of a second random
variable. That is, ifXandYare jointly continuous, then, for any setA,
P{X∈A|Y=y}=
∫
A
fX|Y(x|y)dx