Q:

How to find the conditional distribution

Let X and Y be independent random variable each having exponential distribution with parameter lambda. Then the conditional distribution X given X+Y=1 is??
How I proceeded was: X=r ,Y=1-r And accordingly I wrote the exponential distribution.
But I am doubtful about how to write the denominator. P(X+Y=1)=?

A:

For this type of question, the strategy is to find the joint distribution first, namely the joint density of $(X,Z)$ when $Z=X+Y$

The joint density of $(X,Z)$ is given by $$f_X(x)f_Y(z-x)=\lambda^2\exp\{-\lambda(x+z-x)\}\mathbb{I}_{x\ge 0}\mathbb{I}_{z\ge x}=\lambda^2\exp\{-\lambda z)\}\mathbb{I}_{z\ge x\ge 0}$$since the change of variables has a Jacobian $\partial (x,z)\big/\partial (x,y)$ equal to 1

From this joint distribution, the conditional density of $X$ given $Z$ is given by the formula

$$f_{X|Z}(x|z)=f_{X,Z}(x,z)\big/ f_Z(z)$$

and the marginal density of $Z$ is

$$f_Z(z)=\int_0^z \lambda^2 e^{-\lambda z} \mathbb{I}_{z>0} \text{d}z=\lambda^2 z e^{-\lambda z}$$which is a Gamma$(2,\lambda)$ density.

In conclusion,

$$f_X|Z(x|z)=\frac{1}{z}\,\mathbb{I}(0\le x\le z)$$

