Today I was challenged with the following advanced statistics problem:

Two variables are exponentially distributed with rate parameters lambda 1 ( λ

_{1}) and lambda 2 ( λ_{2}). What is the probability ( p ) that variable 1 ( X_{1}) is less than variable 2 ( X_{2}) in terms of lambdas?

Being one who is usually up to a good challenge, this sounded like a fun Sunday task, especially as there are many practical applications of this knowledge (see end of post for one example). It sadly took me much longer than I anticipated, but I learned a lot along the way.

Let’s start off with some definitions. First off, we need to brush up a little bit on exponential distribution and we then can see that to get the probability that X_{1} < X_{2} for all possible legal values from zero to infinity, we use the following problem definition:

What it’s essentially saying is that the probability that X_{1} < X_{2} is the combined probability that X_{2} = x AND X_{1} < x. From there, we can do some simple replacements. To find the probability that X_{2} = x we use the Probability density function (PDF). Then to find the probability that X_{1} < x we use the Cumulative distribution function (CDF). Based on the definition that P(A and B) is the same as P(A)P(B), we end up with:

Next up, we need to do some substitutions for PDF and CDF respectively. According to Wikipedia, PDF is defined as:

And CDF is defined as:

So with that in mind, we now arrive at this:

Before solving the integral, we will do some simplification. First up, using the distributive property of subtraction, we can simplify the above into this:

After that, we will use exponential identities to refactor the problem down a bit further to this:

At this point, we can now proceed to solve the integral and using the definition that the integration of e^x = e^x and subsequently e^-x = -e^-x we end up with the following:

After then doing some basic simplification of the fractions, we now end up with this:

Next up, we need to apply the closed interval to the function using the fundamental theorem of calculus. The fundamental theorem states that when integrating f(x) over the interval [a,b] the result is F(b) – F(a) as seen here in this definition:

When we apply the fundamental theorem to our equation it gives us this result:

Next up, we now need to calculate the results of the exponential functions. By definition, with e raised to the power of c as c approaches negative infinity, the result becomes zero. Also by definition, e raised to the zeroth power is one, which when both definitions are applied leaves us with this:

Then with some basic mathematical simplification here:

We then end up with our solution of p = 1 - λ_{2} / (λ_{2} + λ_{1}):

Putting it all together, we get the following:

Now that we worked through that, you might be wondering what’s the practical application of this knowledge? Well, one example where you could use it would be in determining the lifespan of two different light bulbs. Given that one light bulb has a rating of 750 hours and the other has a rating of 1500 hours, what is the probability that the one with 1500 hours will last a less amount of time than the one with the 750 hour rating? I’ll leave the answer up to you to solve now that I have explained the steps above, but it must be said, the result is rather surprising.

Tags: calculus, functions, statistics

nice exposition you should maybe mention that the two variables are independent though to avoid confusion and for P(AB) = P(A).P(B) to be applicable..

Also, another interesting question is – what’s the probability that variable X2 ’survives’ certain x while X1 fails. In this case you will have p = pdfX1 * (1 – CDFX2)

By the way – here’s a link to some statistical simulation code ( written in R ) dealing with the problem for survival and failure and estimation of Distribution parameters from such data. https://github.com/chochkov/mle_estimation. There’s also Latex and Pdf files in case anyone would be interested..

What if there are three exponentially distributed parameters? What is the probability that X_1 is less than both X_2 and X_3?

Jeremy, your derivation is not rigorous. For example, you cannot write P(X_2 = x) since X_2 is a continuous r.v. I am still after a rigorous proof and I cannot find it on the internet. Ross’ popular book abuses notation like you’ve done here.

surely theres a problem with P(X2=x)=0 regardless of x?