Let X be uniform on $[0, 10]$. Let $Y$ be exponential with $E(Y ) = 5$. Find $P(X < Y )$ From the given information above. I'm able to derive that
$f(x) = \cfrac{1}{10}$ from $0\leq x \leq 10$
and
$f(y) = \cfrac{1}{5}e^{\cfrac{-1}{5}y}$ for $0 < y$
I think since they're asking for P(X < Y) it's safe to assume that X and Y are independent (is this a fair assumption?) so $f(x,y) = \cfrac{1}{50}e^{\cfrac{-1}{5}y}$ for $0 \leq x \leq 10$ and $0 < y$
so $P(X < Y) = \int_0^{\infty}\int_0^y\cfrac{1}{50}e^{\cfrac{-1}{5}y}dxdy = \cfrac{1}{2}$
Have I understood and done this problem correctly?
 A: $$P(X<Y)=\int_{[0,10]\times[0,\infty)}1_{x\le y}f_{X,Y}(x,y)d(x,y)$$
Now, since $X$ and $Y$ are independent, the joint density function is the product $f_{X,Y}(x,y)=f_X(x)f_Y(y)$. Using partial integration, one finds
$$\begin{align*}
\int_{[0,10]\times[0,\infty)}1_{x\le y}f_{X,Y}(x,y)d(x,y) &=\int_0^\infty \int_0^{10} 1_{x\le y}\frac{1}{10}\frac{1}{5}e^{-\frac{1}{5}y}dxdy\\
&=\int_0^\infty\int_0^{min(10,y)} \frac{1}{10}\frac{1}{5}e^{-\frac{1}{5}y}dxdy\\
&=\int_0^{10}\frac{y}{10}\frac{1}{5}e^{-\frac{1}{5}y}dy+\int_{10}^\infty\frac{10}{10}\frac{1}{5}e^{-\frac{1}{5}y}dy\\
&=\frac{1}{50}\Big[-5ye^{-\frac{1}{5}y}\Big]_{y=0}^{y=10}-\frac{1}{50}\int_0^{10}-5e^{-\frac{1}{5}y}dy+e^{-2}\\
&=-e^{-2}+-\frac{1}{2}(e^{-2}-1)+e^{-2}\\
&=\frac{1}{2}(1-e^{-2})
\end{align*}$$
A: Simulation. Checking your result with a simulation in R, with a million realizations of each random variable. With a million
iterations, we should approximate $P(X < Y)$ correct to
two or three places.
set.seed(404)
x = runif(10^6, 0, 10)
y = rexp(10^6, 1/5)  # rate 1/5, mean 4
mean(x < y)
[1] 0.432952         # aprx P(X < Y)
2 * sd(x < y)/1000
[1] 0.0009909688     # 95% margin of simulation error

So $P(X < Y) = 0.433 \pm 0.001,$ It is hard to believe
the answer is $1/2.$
Analytic method. In an analytic approach, you might do a bivariate
transformation of $(X,Y)$ to $(V, X)$ and find the
marginal distribution of $V,$ where $V = Y - X,$ and
thus $P(Y > 0).$ Here is a histogram of the simulated
distribution of $V.$ [Because this seems to be a textbook
question, I'll leave the transformation and its Jacobian to you.]
Graphs from simulation. I hope the graphs below will be helpful.
v = y - x
hist(v, prob=T, br=50, col="skyblue2", 
 main="Simulated Dist'n of Y - X")


The scatterplot below suggests the joint distribution
of $(V,X),$ using only 20,000 pairs for clarity.
Perhaps you will want to find the distribution of $V$
using two integrals.
X = x[0:20000]
v = y-x;  V = v[0:20000]
plot(V, X, pch=".")
 abline(v = 0, col="green",lwd=2)


A: $f(x,y)$ is only $\frac1{50} e^{-\frac15 y}$ on the set $[0,10] \times [0,\infty)$: outside that set, it's $0$. Therefore, even though it's true that
$$
   \Pr[\mathbf X < \mathbf Y] = \int_0^\infty \int_0^y f(x,y)\,dx\,dy
$$
you cannot simplify that to the integral you gave! Rather, we should have
$$
   \Pr[\mathbf X < \mathbf Y] = \int_0^\infty \int_0^{\min\{y,10\}} \frac1{50} e^{-\frac15 y}\,dx\,dy
$$
because when $x > 10$, $f(x,y)$ becomes $0$.
