Finding conditional distribution

Let $X$ and $Y$ be independent $Exp(1)$-distributed random variables. Find the conditional distribution of $X$ given that $X + Y = c$ ($c$ is a positive constant).

this is my idea:

$$f_{X \mid X+Y}(x\mid c) = \frac{f_{X,X+Y}(x,c)}{f_{X+Y}(c) } $$

if this is the right definition then i might calculate the righthand side to obtain the distribution but Iam unsure


Solution 1:

We have that $X$ and $Y$ are independent $\exp(1)$ random variables. Note that $X$ and $Y$ are non-negative with values in $[0,\infty).$

Use the transformation:

$$U = X\,\,,V = X+Y\\X = U\,\,,Y=V-U$$

The Jacobian is

$$J = \frac{ \partial (x,y)}{\partial (u,v)}= 1$$

The joint density is:

$$ f_{UV}(u,v)=f_{XY}(X(u,v),Y(u,v))|J|= e^{-u}e^{-v}e^{u}=e^{-v}.$$

Since $X=U$ we have for $0 \leq x \leq v$ and $0 \leq v < \infty$

$$ f_{XV}(x,v)=e^{-v}$$

and for $x > v$

$$ f_{XV}(x,v)=0.$$

The marginal distribution of $V$ is

$$f_{V}(v) = \int_{0}^{v}e^{-v}dx=ve^{-v}$$

The conditional density of $X$ given $X+Y= V = c$ is

$$f_{X|V}(x|c) = \frac{f_{XV}(x,c)}{f_V(c)}=\frac{e^{-c}}{ce^{-c}}=\frac1{c}.$$

So the conditional distribution is uniform on the interval $[0,c]$.