The problem can be specified as follows

Imagine there are two random variable, X and Y, both of which follow a continuous uniform distribution. Random variable X is defined fully in the interval [a,b] and random variable y is defined fully in the interval [c,d] where the parameters a, b, c and d are all non-negative.

A value of X is chosen at random and a value of Y is chosen at random. What is the probability that X>Y?

I am looking for a general expression to answer the above question.

I was thinking that perhaps the answer might involve having to integrate a joint probability distribution, but I'm not sure.

If it helps, one could think about a numerical example of the above where X lies in the interval [0,25] and Y lies in the interval [0,10]. If X and Y are selected at random, what is the probability that X>Y? If it might be possible to work through this example numerically, I was thinking it might help me understand how it would work in the general case where one does not know the numerical value of parameters a, b, c and d.

Many thanks in advance.