# Math Help - Uniform

1. ## Uniform

Let X have the uniform distribution (0,2) and let the conditional distribution of Y given X=x be uniform on (0,x^2).

a) Find the condition expectation and variance of Y given X=x. USe these to find the marginal expectation and variance of Y...

Many thanks

2. Originally Posted by brd_7
Let X have the uniform distribution (0,2) and let the conditional distribution of Y given X=x be uniform on (0,x^2).

a) Find the condition expectation and variance of Y given X=x. USe these to find the marginal expectation and variance of Y...

Many thanks
The pdf of X is $f_X(x) = \frac{1}{2}$ for $0 \leq x \leq 2$ and zero elsewhere.

The conditional distribution of Y given X = x is $f_Y(y | x) = \frac{1}{x^2}$ for $0 \leq y \leq x^2$ and zero elsewhere.

Now apply the standard definitions and do the necessary calculations:

$E(Y | X = x) = \int_0^{x^2} y \, f_Y(y | x) \, dy$.

$E(Y^2 | X = x) = \int_0^{x^2} y^2 \, f_Y(y | x) \, dy$.

$Var(Y | X = x) = E(Y^2 | X = x) - [E(Y | X = x)]^2$.

$E(Y) = E[E(Y | X = x)] = \int_{-\infty}^{+\infty} E(Y | X = x) \, f_X(x) \, dx = \int_0^2 E(Y | X = x) \, \frac{1}{2} \, dx$.

To get Var(Y), read this: Law of total variance - Wikipedia, the free encyclopedia and do the necessary computation.

3. Ive got it all upto the Variance of Y.. Ive got an example thats with numbers, but i cant seem to figure out what to do, and its especially confusing because of it being a uniform distribution.. Any ideas?

And i just need to do the Var(Y) now..

4. Originally Posted by brd_7
Ive got it all upto the Variance of Y.. Ive got an example thats with numbers, but i cant seem to figure out what to do, and its especially confusing because of it being a uniform distribution.. Any ideas?

And i just need to do the Var(Y) now..
To save the wheel getting re-invented, if you give all your answers (with working would be ideal) it will be easier to show how to get the variance.

5. Sorry, i did write down the answers, but realised they were wrong, made a careless mistake. Anyway.. I got the following..

x^2/2

x^4/3

x^4/12

1/3

With just Var(Y) to work out..

Many Thanks

6. Originally Posted by brd_7
Sorry, i did write down the answers, but realised they were wrong, made a careless mistake. Anyway.. I got the following..

x^2/2

x^4/3

x^4/12

1/3

With just Var(Y) to work out..

Many Thanks
So you need to calculate $E[Var(Y | X)] = E\left[\frac{X^4}{12}\right]$ and $Var[E(Y | X)] = Var\left[ \frac{X^2}{2}\right]$.

$E\left[\frac{X^4}{12}\right] = \int_0^2 \left( \frac{x^4}{12}\right) \left(\frac{1}{2} \right) \, dx$.

$Var\left[ \frac{X^2}{2}\right]$:

You need the pdf of $U = \frac{X^2}{2}$. This can be got by calculating G(u), the cdf of U. Then $g(u) = \frac{dG}{du}$, where g(u) is the pdf of U.

Then $Var \left[ \frac{X^2}{2}\right] = Var (U) = E(U^2) - [E(U)]^2$.

$G(u) = \Pr(U < u) = \Pr\left( \frac{X^2}{2} < u\right) = \Pr( -\sqrt{2u} < X < \sqrt{2u}) = \Pr(0 < X < \sqrt{2u})$ since $0 \leq x \leq 2$

$= \int_0^{\sqrt{2u}} \frac{1}{2} \, dx = \, ....$ for $0 \leq u \leq 2$.

Therefore $g(u) = \frac{dG}{du} = \, .....$ for $0 \leq u \leq 2$ and zero elsewhere.