# Let $Y$ a uniform random variable in $[0,1]$, and let $X$ a uniform variable in $[1,e^Y]$

Let $Y$ a uniform random variable in $[0,1]$, and let $X$ a uniform variable in $[1,e^Y]$

Find $E[X]$

My work

As $Y$ is uniform random variable in $[0,1]$ then

$$\Pr[Y \le y] = \begin{cases} 0, & y \le 0 \\ y, & 0 < y \le 1, \\ 1, & 1 < y. \end{cases}$$

As $X$ is a uniform random variable in $[0,e^Y]$ then

$$\Pr[X \le x] = \begin{cases} 0, & x \le 0, \\ x, & 0 < x, \le e^Y \\ 1, & 1 < e^Y. \end{cases}$$

I'm little stuck trying to finding $E[X]$

Can someone help me with this?

• You say $X$ is uniformly distributed on $[1,e^{Y}]$ in the title and $X$ is uniformly distributed on $[0,e^{Y}]$ in your solution. – Kabo Murphy Jul 15 '18 at 0:28

$$\operatorname E(X) = \operatorname E(\operatorname E(X\mid Y)) = \operatorname E\left( \frac{1+e^Y} 2 \right) = \int_0^1 \frac {1+e^y} 2 \cdot (1 \, dy) = \cdots$$
• Thanks Michael. One question, why you say $E(X)=E(E(X|Y))$? i don't see that step. – Bvss12 Jul 14 '18 at 0:59
• Michael sorry for ask, but i'm having serious problem trying to prove $E(X|Y)=\frac{1+e^y}{2}$ can you help me with that? – Bvss12 Jul 16 '18 at 0:19
• @Bvss12 $X\mid Y\sim\mathcal U[1;e^Y]$, so $\mathsf E(X\mid Y) =\tfrac{1}{2}(1+e^Y)$ since the expectation of a random variable uniformly distributed over the interval $[a;b]$ is $\tfrac 12(a+b)$. – Graham Kemp Jul 16 '18 at 3:57
You should write $P\{X \leq x \mid Y\}= 0$ for $x\leq 1$, $x$ for $1<x\leq e^Y$ $1$ for $x>e^Y$ since $X$ is uniform on $[1,Y]$ not $[0,Y]$. Now you have to take expectation to get $P\{X\leq x\}$. You will get $xP\{Y \geq \ln x\}+P\{Y< \ln x\}$. Can you compute this now?