Derive the value of this probability analytically Forgive me if this question is very basic but I genuinely tried to search around including this site and could not find anything that I could adapt to my understanding.
X ~ Unif(0, 15)
Y ~ Unif(0, 10)

Let's say we have the above 2 random variables. How can I derive the value P(X > Y) analytically? I can easily show in R / Matlab that this value is $\frac{2}{3}$ simply by sampling millions of times. I can also 'prove' it by hand-waving simply by saying something along the lines of:

There is a $\frac{1}{3}$ chance that X is by default greater than Y (if $X_{sample}$ is (10, 15]). There is then a $\frac{1}{2}$ that X is greater on the remaining $\frac{2}{3}$ giving a total probability of $\frac{1}{3}$ + $\frac{1}{2} * \frac{2}{3}$ = $\frac{2}{3}$.

However when it comes to actually deriving this rigorously, I wouldn't know where to start.
 A: Assuming that $X$ and $Y$ are independent, their joint pdf is $f(x,y)=\frac{1}{150}$ if $0\leq x\leq 15$ and $0\leq y\leq 10$, and $f(x,y)=0$ otherwise.
Therefore
$$ \mathbb{P}(Y<X)=\frac{1}{150}\int_0^{10}\int_0^x\;dydx+\frac{1}{150}\int_{10}^{15}\int_0^{10}\;dydx$$
$$=\frac{1}{150}\int_0^{10}x\;dx+\frac{1}{3}=\frac{x^2}{300}\Big|_0^{10}+\frac{1}{3}=\frac{2}{3}$$
Alternately, the probability can be computed by finding the area of intersection of the rectangle $[0,15]\times[0,10]$ with the half-plane $\{y<x\}$, then dividing by $150$ (the total area of the rectangle).
A: Another answer solves this using calculus. And that would
be the general method for such a problem.
However, it is possible to visualize a solution geometrically,
for a rigourous solution without using calculus, in this particular case. The joint
distribution is uniform over the rectangle with vertices at $(0, 0)$
and $(15, 10).$ [The density function is $f(x,y) = (1/10)(1/15) = 1/150,$
for $(x, y)$ in the support. Thus it integrates to unity.]
Consider a plot of 30,000 realizations from a simulation in R.
The region corresponding to the condition $X > Y$ is plotted
in green. Lines divide the support into three equal areas, and thus three areas of equal probability due to the uniform
distribution. So it is clear that the answer is 2/3. [The
green area is the region of integration in the solution using
calculus.]

Because you indicate you are familiar with R, I include the code.
x = runif(30000, 0, 15)
y = runif(30000, 0, 10)
plot(x, y, pch=".")
cond = x > y
points(x[cond], y[cond], pch=".", col="darkgreen")
abline(a=0, b=1)
abline(v=10, col="orange")
mean(cond)
## 0.6664333

The final statement approximates $P(X > Y).$ This is a 'lucky'
simulation. With only 30,000 iterations the 95% margin of
simulation error is about $\pm 0.005.$
