# Given two different ranges, probability of a number in one range being greater than the other

It has been a long time since I last studied probability and statistics but I am trying to solve a tricky (for me) problem.

If I have any two number ranges, what is the calculation for the probability of a random value in one range being higher than the other?

Simple example...

Range 1: 10-19

Range 2: 20-39

Result: 0% probability that a number in Range 1 is greater than Range 2.

Trickier example...

Range 1: 10-20

Range 2: 15-24

What is the probability that a random value in Range 1 is greater than a random value in Range 2?

-

You can count all possible variations, and the ones that answer the actual question and divide them (good/all) to get the probability.

Now we are dealing with ordered pairs of numbers, call Range 1 $X$ and Range 2 $Y$. We want $P(X>Y)$. Now the good pairs are $$(16,15),\ (17,15),\ .., (20,15);\ (17,16),\ .. (20,16); ...; (20,19).$$ We can count these for example according to the possible $Y$'s: the minimal possible $Y$ such that $X>Y$ is $Y=15$, then $X$ can be $16..20$, that is $5$ possibilities. If $Y=16$, we have $4$ possibilities, and so on. So it is $5+ 4+ 3+ 2+ 1=15$ possibilities altogether.

And the number of all possible pairs is now $11\cdot 10$.

-
So let me get this right.... in the example I gave the probability of X being greater is 15 out of 110. But the probability of Y being greater is not 95 out of 110 due to tied pairs? (15, 15), (16, 16), (17, 17), (18, 18), (19, 19), (20, 20) so, X > Y = 15/110 X = Y = 6/110 X < Y = 89/110 I think I now understand the theory but how can this be expressed as a formula for any range? –  berko Feb 15 '13 at 6:15