Given that $X\sim\exp\left(1\right)$ and $Y\sim\exp\left(1\right)$ independent, find $f_{X|Z}(x|z)$ where $Z=X+Y$.

What I did: if $Z=X+Y$ then $f_{Z,X}(z,x)=f_{X}(x)f_{Y}(z-x)$ so we get: $$ f_{Z,X}(z,x)=f_{X}(x)f_{Y}(z-x)=\left(e^{-x}I_{\left\{ x\geq0\right\} }\right)\left(e^{-(z-x)}I_{\left\{ z-x\geq0\right\} }\right)=e^{-z}I_{\left\{ x\geq0\right\} }I_{\left\{ z\geq x\right\} } $$ Then we can use $f_{X,Z}(x,z)=f_{Z|X}(z|x)f_{X}(x)$ and get: $$ f_{Z|X}(z|x)=\frac{f_{X,Z}(x,z)}{f_{X}(x)}=\frac{e^{-z}I_{\left\{ x\geq0\right\} }I_{\left\{ z\geq x\right\} }}{e^{-x}I_{\left\{ x\geq0\right\} }}=e^{-z}e^{x}I_{\left\{ x\geq0\right\} }I_{\left\{ z\geq x\right\} } $$ But the solution should be $z^{-1}$. What did I do wrong? I used those two formals from: How can I detemine the joint p.d.f. of $(X,Y)$, i.e., $f_{X,Y}(x,y)$? and I think they are valid.

Edit: I didn't use $f_{X,Z}(x,z)=f_{Z|X}(z|x)f_{X}(x)$ right. I need to calculate $f_Z(z)$ instead of $f_X(x)$. I calculated $f_{X,Y}(x,y)$: $$ f_{X,Y}(x,y)=f_{X}(x)\cdot f_{Y}(y)=e^{-x}e^{-y}I_{\left\{ x\geq0\right\} }I_{\left\{ y\geq0\right\} }=e^{-x-y}I_{\left\{ x\geq0\right\} }I_{\left\{ y\geq0\right\} } $$ Then we get: $$ \begin{align*} f_{Z}(z)&=\int_{-\infty}^{\infty}f_{X,Z}(x,z-x)dx=\int_{-\infty}^{\infty}e^{-x-(z-x)}I_{\left\{ x\geq0\right\} }I_{\left\{ z-x\geq0\right\} }dx\\&=\int_{-\infty}^{\infty}e^{-z}I_{\left\{ x\geq0\right\} }I_{\left\{ z\geq x\right\} }dx=\int_{z}^{\infty}e^{-z}dx \end{align*} $$ Which does not converges. What's the issue?


Browse other questions tagged or ask your own question.