# Calculating probability density function

I am having difficulty solving this problem.

Given this distribution \begin{align*} f_X(x) &= \begin{cases}e^{-x} &,& x\geq 0 \\ 0 &,& x<0\end{cases} \\[1ex] f_Y(y) &= \begin{cases}2e^{-2y} &,& y\geq 0 \\ 0 &,& y<0\end{cases} \end{align*} Calculate $\mathsf P(X<3Y)$

I have attempted the following, however I am unsure if my methodology is correct. $$\mathsf P(X<3Y)= \int_0^\infty \left[\int_0^{3y} f_X(x)f_Y(y) dx\right] dy$$

• What difficulty are you having? Can you please share what you've tried and where you got stuck? – barak manos Dec 20 '16 at 10:48
• Yes, that is a correct approach... if the random variables can be assumed independent. – Graham Kemp Dec 20 '16 at 10:55
• I think that you are assuming independence of $X$ and $Y$, are you not? – Cettt Dec 20 '16 at 10:55

Your random variable $X$ has an exponential distribution with rate $\lambda = 1,$ and it has mean $E(X) = 1.$ Your random variable $Y$ has an exponential distribution with rate $\lambda = 2,$ and it has mean $E(Y) = 1/2.$

One approach to finding $P(X < 3Y),$ for $X$ and $Y$ independent, is to write their joint distribution, and then integrate to find the probability.

This specific probability can be approximated very accurately using simulation. That is the approach I show below, using R statistical software to get 100,000 simulated realizations of $(X,Y).$ The result of the simulation is that $P(X < 3Y) = .60,$ correct to about two decimal places.

m = 10^5;  x = rexp(m, 1);  y = rexp(m, 2)
mean(x);  mean(y);  event = (x < 3*y);  mean(event)
## 1.003198   # aprx E(X) = 1
## 0.5021866  # aprx E(Y) = 1/2
## 0.60261    # aprx P(X < 3Y) = .6


The scatterplot below shows the 100,000 simulated points. Almost exactly 60% of the points are green, corresponding to the event $\{X < 3Y\}.$ (If you are solving this by integration, the green region is the region over which you need to integrate the joint density function.)