What is the distribution of $X|W=w$? Let $X$ and $Y$ be independent random variables with uniform distribution between $0$ and $1$, that is, have joint density $f_{xy}(x, y) = 1$, if x $\in$ $[0,1]$ and y $\in [0,1]$ and $f_{xy} (x, y) = 0$, cc. Let $W = (X + Y) / 2$:
What is the distribution of $X|W=w$?
I started considering something like this: $X|W = (x +y)/2$
But I stucked. I dont know how to begin.
Any idea? Hint?
 A: The conditional pdf is given by
$$f_{X | W = w}(x) =
\frac {f_{X, W}(x, w)} {f_W(w)}.$$
$f_W$ is the pdf of a sum of two independent uniformly distributed r.v.:
$$f_W(w) = 4 w \left[0 < w \leq \frac 1 2 \right] +
 4 (1 - w) \left[\frac 1 2 < w < 1 \right].$$
The transformation $(x,w) = (x, (x + y)/2)$ maps the square $0 < x < 1 \land 0 < y < 1$ to the parallelogram $0 < x < 1 \land 0 < 2 w - x < 1$ and has the Jacobian $\partial(x, w)/\partial(x, y) = 1/2$. The transformed pdf is
$$f_{X, W}(x, w) = 2 \,[0 < x < 1 \land 0 < 2 w - x < 1] = \\
2 \left[ 0 < w \leq \frac 1 2 \land 0 < x < 2 w \right] +
 2 \left[ \frac 1 2 < w < 1 \land 2 w - 1 < x < 1 \right].$$
Consider what $f_{X | W = w}$ simplifies to when $w < 1/2$ and when $w > 1/2$.
A: $$X = 2W-Y$$
So, 
$$X_c = (X|W=w) = (2w-Y_c) $$
Hence, $X_c$ should also be uniform from $[\max(2w-1,0),\min(2w,1)]$.

EDIT: Here is an argument for why $X_c$ will also be uniform over its domain.
$$P(X=x_1|W=w) = \frac{P(X=x_1 \& W=w)}{P(W=w)} = \frac{P(X=x_1 \& Y=2w-x_1)}{P(W=w)}$$
Since $X$ and $Y$ are independent, this becomes:
$$P(X=x_1|W=w) = \frac{P(X=x_1)P(Y=2w-x_1)}{P(W=w)}$$
If $2w-x_1 <0 $ or $2w-x_1>1$, the density above becomes $0$.
But otherwise, it will stay exactly the same if we replace $x_1$ by $x_2$ (such that both satisfy $0 \leq 2w-x \leq 1$). Hence, $X_c$ and $Y_c$ should remain uniform over their valid domains.
