Expected time taken for the first event among 2 events belonging to exponential distribution. Let's say I have 2 events denoted by random variables $X_1$ and $X_2$. Also the time until until any of the events happen can be represented as an exponential distribution with a probability density function as $\lambda_1e^{-\lambda_1t}$ and $\lambda_2e^{-\lambda_2t}$ .
If I want to calculate the expected time until the first event happens, one way would be that I can use the fact that the minimum of both the times has an exponential distribution with rate $\lambda=(\lambda_1+\lambda_2)$ and the expected time will be $\frac{1}{\lambda}=\frac{1}{(\lambda_1+\lambda_2)}$.
However, I was trying to do it in another way. I was thinking that the expected time for the first even can be written as $$E[T]=E[X_2]P(X_2<X_1) + E[X_1]P(X_1<X_2)$$
where $P(X_2<X_1)$ is event $X_2$ happening before event $X_1$ and vice versa. $E[X_2]$ is the expected time for even $X_2$ and vice versa.
This evaluates to $E[T]=\frac{1}{\lambda_1}\frac{\lambda_1}{(\lambda_1+\lambda_2)}+ \frac{1}{\lambda_2}\frac{\lambda_2}{(\lambda_1+\lambda_2)}$ which is $\frac{2}{(\lambda_1+\lambda_2)}$.
Can someone please explain why am I getting the second answer different from the first one and what is wrong with my approach?
 A: The correct expression would be
$$E[X_2 \mid X_2 < X_1] P(X_2 < X_1) + E[X_1 \mid X_1 < X_2] P(X_1 < X_2).$$
[In the end, both conditional expectations are actually equal to the final answer $\frac{1}{\lambda_1 + \lambda_2}$.]
This differs from your expression because the distribution of $X_2$ is different from the conditional distribution of $X_2$ given the knowledge that $X_2 < X_1$.

One way to compute the conditional expectation: rather, consider
$$E[X_2 \mid X_2 < X_1] P(X_2 < X_1)
= E[X_2 \mathbf{1}_{X_2 < X_1}]
= \int_0^\infty \int_{x_2}^\infty x_2 f_{X_1}(x_1) f_{X_2}(x_2) \, dx_1 \, dx_2
= \int_0^\infty \lambda_2 x_2 e^{-\lambda_2 x_2} e^{-\lambda_1 x_2}
= \frac{\lambda_2}{(\lambda_1 + \lambda_2)^2}.$$
Similarly, the other term is $$E[X_1 \mid X_1 < X_2]P(X_1 < X_2) = E[X_1 \mathbf{1}_{X_1 < X_2}] =\frac{\lambda_1}{(\lambda_1 + \lambda_2)^2}.$$
Note that although we didn't need to compute it, we ended up with
$$E[X_1 \mid X_1 < X_2] = E[X_2 \mid X_2 < X_1] = \frac{1}{\lambda_1 + \lambda_2}.$$
