Given two exponentially distributed random variables $ X_1 $ and $X_2$ (assuming rates $\lambda_1$ and $\lambda_2$ respectively), determine the probability that one is smaller than the other.
So basically, I need to find $P(X_1<X_2)$ which is equivalent to $P(X_2 = x)$ AND $P(X_1 < X_2)$ which can be written as $P(X_1 < X_2 | X_2 = x)\times P(X_2 = x)$.
In reality $P(X_1 < X_2 | X_2 = x) = 1 - e^{-\lambda_1x} $ while $P(X_2 = x) = \lambda_2e^{-\lambda_2x}$.
My professor went a step further and said that:
$P(X_1 < X_2) = \int_0^{\infty}P(X_1 < X_2 | X_2 = x)P(X_2 = x)dx = \int_0^{\infty}(1 - e^{-\lambda_1x})\lambda_2e^{-\lambda_2x}dx $
Questions:
- Is writing $P(X_1 < X_2 | X_2 = x)P(X_2 = x)$ instead of $P(X_1 < X_2)P(X_2 = x)$ really necessary when we're assuming that the random variables are independent?
- More importantly, why do we have to integrate the product at all? and why from 0 to $\infty$?
Thanks for your help!