# Thread: Conditional expectation where I need to find E[X^2|Y=0.7]

1. ## Conditional expectation where I need to find E[X^2|Y=0.7]

The function is x+y where both x and y are between 0 and 1.

Am I correct in saying if E[X|Y] = f(x,y)/h(y)

where h(y) is the marginal probability density of Y that:

E[X^2|Y]= [f(x,y)]^2/h(y)

Sorry if this is a stupid question but I don't want to try and solve it in different ways and there still be some ambiguity as to what the correct way to tackle the question is.

Thanks.

2. ## Re: Conditional expectation where I need to find E[X^2|Y=0.7]

no i dont think so. As your wrote it, your E(X|Y) would almost certainly be a function of X, so you know that it is incorrect. E(X|Y) should be a function of Y only (or a constant).

Lets start from the definition of expectation for any random variable, x: $\displaystyle E(X) = \int x f_x(x) dx$

Similarly for the conditional variable "X|Y"

$\displaystyle E(X|Y) = \int x f_{x|y}(x) dx$

You can make this substitution $\displaystyle f_{x|y}(x) = \frac{f_{xy}(x,y)}{f_y(y)}$

to get:
$\displaystyle E(X|Y) = \int x \frac{f_{xy}(x,y)}{f_y(y)} dx = \frac{1}{f_y(y)}\int x {f_{xy}(x,y) dx$

is this what you meant?

$\displaystyle E(X^2)$ is similar except the starting definition is $\displaystyle E(X^2) = \int x^2 f(x) dx$

You try and finish. If you need further help, be sure to post the density functions you are supposed to be manipulating.

3. ## Re: Conditional expectation where I need to find E[X^2|Y=0.7]

If it was E[x|y] I would find the marginal density of y and then take the orginal function and put it over the marginal density of y right?

I'm still a little perplexed as to how to do it for E[X^2|Y].

So for f(x,y)= x+y if I needed to get the conditional expectation E[X|Y] it would be (x+y)/(xy)+(y^2/2)? So how does that change when it becomes E[X^2|y].

4. ## Re: Conditional expectation where I need to find E[X^2|Y=0.7]

1) havn't told me the densities of X and Y, or their joint density
2) dont put any integral signs in what you write.

E[X|Y] = (x+y)/(xy)+(y^2/2)
i dont see where this could have come from, i dont think its right. If this is supposed to be the final answer, it should not be a function of X. If you think otherwise, you are fundamentally misunderstanding what an expectation is and you may want to review your notes.

The integral you need to do is:
$\displaystyle E(X^2|Y) = \int x^2 f_{x|y}(x,y) dx$

this can be re-written as (same method as post #2)

$\displaystyle E(X^2|Y) = \frac{1}{f_y(y)}\int x^2 f_{x,y}(x,y) dx$

IF you need further help then post the the density functions of X and Y, or the joint density function

5. ## Re: Conditional expectation where I need to find E[X^2|Y=0.7]

The function is x+y where both x and y are between 0 and 1.
Just noticed this in post #1. if "the function" means "the joint density function" then:

step 1: find the marginal density of y

Spoiler:

$\displaystyle f_y = \int_0^1 (x+y) dy = y + 0.5$

step 2: find the conditional density x|y
Spoiler:

$\displaystyle f_{x|y} = \frac{f_{x,y}(x,y)}{f_y(y)} =\frac{x+y}{y+0.5}$

step 3: evaluate the integral:

$\displaystyle E(X^2|Y) = \int_0^1 x^2 f_{x|y} dx$

Spoiler:

Hint: you will get a fraction inside the integral. The denominator doesn't depend on X so can be taken outside the integral

6. ## Re: Conditional expectation where I need to find E[X^2|Y=0.7]

Apologies for being so vague, here is the question I need to solve, perhaps this would make it clearer.

EDIT: I have re-read my notes and I think I understand how to do this now, thank you for your help and the solution.

7. ## Re: Conditional expectation where I need to find E[X^2|Y=0.7]

sorry, i saw the the density you put in post #1 while you were typing that. Try and follow the instructions in post #5.

8. ## Re: Conditional expectation where I need to find E[X^2|Y=0.7]

Originally Posted by SpringFan25
sorry, i saw the the density you put in post #1 while you were typing that. Try and follow the instructions in post #5.
I think I have solved this question correctly, thank you for your help.