Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose that $X$ and $Y$ are independent random variables, $X$ is uniformly distributed on $[0,1]$, and $Y$ is uniformly distributed on $\{ 1,2,3\}$. How to get $E((X+Y)^2 | Y)$?

It seems to me that the conditional density $p_{X|Y}(x|y)$ is equal to $p_X(x)$, so what is the role of $Y$ here?

share|cite|improve this question
Since $Y$ can have only three possible values, you can just treat each of the three cases separately, i.e. $$E[(X+Y)^2\,|\,Y] = \begin{cases} E[(X+1)^2] & \text{if }Y=1 \\ E[(X+2)^2] & \text{if }Y=2 \\ E[(X+3)^2] & \text{if }Y=3 \end{cases}$$ Hopefully this may help you come up with a general rule, but if not, a case-by-case answer is still a valid answer. – Ilmari Karonen Aug 28 '11 at 11:53

Since $Y$ is a discrete random variable, one can rely on the elementary definition of conditional expectations: $E((X+Y)^2\mid Y)=u(Y)$ where the function $u$ is such that, for every $y$ in $\{1,2,3\}$, $u(y)=E((X+Y)^2\mid Y=y)$.

Now, on $[Y=y]$, $(X+Y)^2=(X+y)^2$ almost surely, hence $u(y)=E((X+y)^2\mid Y=y)$. But the random variables $(X+y)^2$ and $Y$ are independent (why?), hence $u(y)=E((X+y)^2)$.

So the question reduces to: What is $E((X+y)^2)$ for each $y$ in $\{1,2,3\}$? I am sure you can answer that.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.