Example of 2 random variables s.t. $(X+Y)$ ~ $U(0,2)$
In my book I found:
Can you give an example of 2 random variables $X,Y$ S.T $(X+Y)$ ~ $U(0,2)$ and $X,Y$ are not independent.
Any ideas of how I can find such 2 random variabes?
I would prefer if those random variables tell a story so I can relate to the real world, for example selecting number in $[0,1]$ has uniform disturbution of $(0,1)$.
Set $X \sim U(0,1)$ and let $Y = X$. Then I claim that $X+Y \sim U(0,2)$ and that $X$ and $Y$ are not independent.
If they were independent, $E(XY) = E(X)E(Y)$; instead, we have: $$E(XY) = E(X^2) = \int_0^1 x^2 dx = 1/3 \neq 1/4 = E(X)E(Y)$$
To see that $X+Y \sim U(0,2)$, notice that $$P(X+Y \leq z) = P(2X \leq z) = P(X \leq z/2) = \begin{cases} 0 & z < 0 \\ z/2 & 0 \leq z \leq 2 \\ 1 & z > 2 \end{cases}$$ which is the CDF of a $U(0,2)$ random variable.