# Iterative expectation of continuous and discrete distributions

1. Sep 25, 2010

### cielo

1. The problem statement, all variables and given/known data
Suppose X ~ uniform (0,1) and the conditional distribution of Y given X = x is binomial (n, p=x), i.e. P(Y=y|X=x) = nCy x$$^{y}$$ (1-x)$$^{n-y}$$ for y = 0, 1,..., n.

2. Relevant equations
FInd E(y) and the distribution of Y.

3. The attempt at a solution
f(x) = $$\frac{1}{b-a}$$ = $$\frac{1}{1-0}$$ =1

E[Y] = E [E[Y|X=x]
= $$\int$$ E[Y|X=x] f(x) dx where the integral is from o to 1
= $$\int$$ [$$\Sigma$$ y f(y|x)] f(x) dx
= $$\int$$ [$$\Sigma$$ y nCy x$$^{y}$$ (1-x)$$^{n-y}$$] f(x) dx

2. Sep 25, 2010

You know the conditional distribution of Y given X. Use that to find E[Y | X]. The answer is a function of X - find its expectation with respect to X to get E[E[Y |X]] = E[Y]

3. Sep 29, 2010

### cielo

Thank you so much for your very good idea. Because of that, I already got the E[Y].

Can you still help me in finding the distribution of Y?

P[Y] = $$\int^{0}_{1}$$ $$\left[nCy x^{y} (1-x)^{n-y} dx\right]$$