Suppose that X and Y are random variables on the same probability space,
and that Y is a discrete random variable. If F is any event, if y is in
the range of Y we have defined
. For the moment, let
. It is
easy to check that Qy is another probability measure on
.Therefore, the function
given by
![]()
Observe that if X and Y are independent then
![]()
Also, if F is an event, and X = IF, then FX|Y=y is a discrete distribution, and
![]()
Next, suppose that X also has a discrete distribution. Then the
conditional distribution function FX|Y=y is also discrete with the
obvious mass function,
. We denote this conditional
mass function by pX|Y=y, and we have the following theorem:
Theorem: Suppose that X and Y are discrete random
variables defined on the same probability space, H is a function such
that E[H(X)] is defined, and
. Then
![\begin{displaymath}
E[ H(X) \vert Y = y] = \sum_{x} H(x) p_{X\vert Y=y}(x) = \sum_{x}H(x)
\frac{\Pr(X = x, Y = y)}{\Pr(Y = y)},\end{displaymath}](img11.gif)
![]()
If we think of E[X | Y = y] as a function of y, call it
, then
the second part of the theorem may be written as
![]()
E[H(X)] = E[E[H(X) | Y]].
This formula is usually referred to as the Law of Iterated Expectations. The whole of the modern theory of conditional expectation revolves around trying to define the quantity E[X | Y] for any random variables, rather than the case described above, where X and Y are assumed to be discrete.It is quite typical to be given not the joint distribution of X and Y, but instead the distribution of Y and the conditional distribution of X given Y = y.
For example: Suppose that Y has a geometric distribution
on
, that is
,
, and the distribution of X given Y = y is Poisson with mean y.
Find the expected value of X and the probability that X = 7.
Solution. Since the distribution of X given Y = y is Poisson with mean y, we have E[X | Y = y] = y. Therefore
![\begin{displaymath}
E[X] = \sum_{y=1}^\infty y \Pr(Y = y) = \sum_{y=1}^\infty y (1-p)p^{y-1} =
\frac{1}{1-p}\end{displaymath}](img19.gif)
