My question is related to my job and asking to learn.

Simplified case is:

Event A and Event B failure rates are exponentially distributed.

Event A (failure of item A) => failure rate (lambda): 0,0002

Event B (failure of item A) => failure rate (lambda): 0,0008

for a duration of 500.

I want to understand the probability that both events occurs but event A occurs before event B.

Event A and B are independent. One does not trigger (not change the prob.) the other.

I made 200,000 trials monte carlo sim. and get 0,01533 for probability that both events occurs but event A occurs before event B.

Q1) But where is this coming from? What is the analytical solution for this case?

Q2) Which specific statistics topic should I read on web if the number of sequential items increases and the problem gets more complex?


  • $\begingroup$ Do you know how to apply conditioning? $\endgroup$
    – soakley
    Feb 28, 2017 at 18:17
  • $\begingroup$ Hi Soakley, thanks for dealing. If you mean conditional prob., yes I'm aware of it but here I think Prob B given that A already occured which is P(B) because of independence won't help me. I can understand the answer (if provided) but I'm stucked to create mine since I'm an engineer (not a statistician) and it's been 15-16 years since I got 2 semester of statistics courses. Can you please lead me? Thanks again. $\endgroup$ Mar 1, 2017 at 4:53

1 Answer 1


If we let $X$ be the time until event A and $Y$ be the time until event B, then both $X$ and $Y$ have exponential distributions (let's call their rates $\lambda_1$ and $\lambda_2,$ respectively) and it appears you want to find $P[X < Y, X<500,Y<500]$

We know by independence that the probability that both $X$ and $Y$ are less than 500 is given by $T=\left( 1-e^{-500 \lambda_1} \right) \left( 1-e^{-500 \lambda_2} \right)$

I'm not sure why I did it this way, but within the domain (a square) of both variables being less than 500 I found the complementary area $U=P[X>Y, X<500, Y<500]$ to what you are interested in by using a double integration.

Then your desired quantity is $T-U.$

I found that to be

$$T-U =\frac{1}{\lambda_1+\lambda_2} \left[ \lambda_1 + \lambda_2 e^{-500 \left( \lambda_1 + \lambda_2 \right) } \right]-e^{-500 \lambda_2} $$

For your rates this evaluates to $0.0149045,$ in good agreement with your simulation result.

Now let's set up the direct approach. We want to evaluate the probability that $X<Y$ constrained by both variables being no more than 500. Call the answer $Q.$

$$Q=\int_0^{500}\int_x^{500}\lambda_1 e^{-\lambda_1x} \lambda_2e^{-\lambda_2y} \ dy \ dx$$

If you solve this, you will get the same answer as above. Can you take it from here?

  • $\begingroup$ I think the event of interest is not $X<Y$ but $X<Y<500$ $\endgroup$ Mar 1, 2017 at 18:35
  • $\begingroup$ Ah, I couldn't figure what the "duration of 500" meant. $\endgroup$
    – soakley
    Mar 1, 2017 at 18:41
  • $\begingroup$ @soakley It's good to see that my simulation result is acceptable and the solution has a closed form. However what I couldn't understand was how to deal with P(X<Y) and I didn't understand the U. I suppose integrals are using the PDF function so I also couldn't get the idea of double integral because in my mind a double integral of a line will give a volume and I couldn't match a volume with my question logically. (I drawed the PDFs and tried to see the geometry but...) Sorry for bothering and taking your time. $\endgroup$ Mar 2, 2017 at 5:30
  • $\begingroup$ @soakley Can you please give the integrals or describe the geometry in your mind for U or for P(X<Y). I can get it in that way. As I've said I want to understand the logic, not only got the answer in numbers. Thanks for your efforts. $\endgroup$ Mar 2, 2017 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.