Suppose we have two independent distributions $X \sim U[a,b]$ and $Y \sim [c,d]$, where $a < c < 0$ and $b > d > 0$.
How do you find $P(X > Y)$ ?
I've seen some answers here using the difference between two $U[0,1]$ and managed to think something like this:
First, we let $Z = X - Y$. Since the distributions are independent, we can multiply their densities:
$$f_Z = f_X \cdot f_Y = \frac{1}{(b-a)}\cdot\frac{1}{(d-c)}$$
Then we go on to take the integral:
$$P(Z \leq 0) = \int_a^b\int_c^df_X(c+x)f_Y(x)dxdc $$
But I didn't manage to get much further from this.
I suspect there exists a closed form, like this $P(Z \leq 0) = \frac{(b-a)}{(d-c)}$ (Not this exact format, but something along these lines)
Any tips?
Since both of $X$ and $Y$ are uniformly distributed and they are independent. The joint pdf is $f_{XY}=\frac{1}{(b-a)(d-c)}$. The total $2D$ region is the rectangle region with vertices coordinates $A(b,d),~B(a,d),~C(a,c),~D(b,c)$
Then draw a line $y=x$ to intersect $AB$ with $P$ and intersect $CD$ with $Q$. So the probability $P(X>Y)$ equals the area of the trapezoid $APQD$ multiply the constant pdf $\frac{1}{(b-a)(d-c)}$
$$P(X>Y)=\frac{1}{(b-a)(d-c)}\cdot \frac{(b-d)+(b-c)}{2}\cdot(d-c)=\frac{2b-d-c}{2(b-a)}$$