# Finding P(X<Y) for exponential Random Variable

Assume X and Y are independent exponential random variables with parameters $\lambda_1$ and $\lambda_2$ respectively. Compute $P(X<Y)$.

I have alot of trouble solving questions like these. Is there a general way to tackle problems like these? Here's my approach

\begin{align} P(X<Y) &= \int_{-\infty}^{\infty} P(X<Y|Y=y) ~\ f_Y(y) dy\\ &= \int_{-\infty}^{\infty} P(X<y|Y=y) ~\ f_Y(y) dy\\ &= \int_{-\infty}^{\infty} P(X<y) ~\ f_Y(y) dy ~~~~~~~~~~~~\ \text{by independence}\\ &= \int_{-\infty}^{\infty} F_X(y) \cdot f_Y(y) dy ~~~~~~~~~~~~\ \text{not sure what to do after this}\\ &= \int_{-\infty}^{\infty} \int_\infty^y f_X(x) \cdot f_Y(y) ~\ dxdy ~~~~~~~~~~~~\ \text{yes?}\\ &= \int_{-\infty}^{\infty} \int_\infty^y \lambda_1 e^{-\lambda_1 y} \cdot \lambda_2 e^{-\lambda_2 y} ~\ dxdy \\ &= \int_{-\infty}^{\infty} \int_\infty^y \lambda_1 \lambda_2 e^{-(\lambda_1 + \lambda_2) y} ~\ dxdy \\ ... \end{align}

Would like any feedback + if u know any good links, let me know!

• It doesn´t make sense to have two integral signs and only one dy. And y starts at y=0. – callculus Apr 15 '16 at 21:25
• Thanks for the feedback, I noticed I made an error. Would my range be from 0 to y then? – misheekoh Apr 15 '16 at 21:37
• @callculus What I was doing when I switched from 1 integral to 2 integral is that I'm taking for $F_X(y) = \int_{\infty}^y f_X(y)$ – misheekoh Apr 15 '16 at 21:38
• Without defining $Z=X-Y$ it is hard to derive the CDF. I posted a answer using this relation. – callculus Apr 15 '16 at 22:00
• @callculus The CDF of X-Y is offtopic here (and frankly I do not see what "defining Z=X-Y" brings). – Did Sep 2 '17 at 10:03

You're on the right track, but it should be $f_X(x)$ rather than $f_X(y)$ in the third-to-last line. Also, the lower bound for the integrals should be $0$ since an exponential random variable is always positive.
It might be simpler to just use the fact that $$F_X(y)=1-e^{-\lambda_1y}$$ if $y>0$, then compute the $y$ integral.
First I would define $Z=Y-X$. Thus $Y=Z+X$. Therefore $y$ goes from $0$ to $z+x$ and $x$ goes from $0$ to $\infty$. Thus the integral is
$$P(Z\le z)=\int_0^\infty \int_{0}^{x+z} \lambda_1 e^{-\lambda_1 x} \lambda_2 e^{-\lambda_2 y}\,dy \ \ dx$$
• Assuming $z\geqslant0$, I suppose? Anyway, this is not needed to solve the question. – Did Sep 2 '17 at 10:05
• @JoeyDoey First you should calculate the inner integral. $$\int_{0}^{x+z} \lambda_2 e^{-\lambda_2 y}\,dy$$ – callculus Sep 23 '18 at 21:33