# Uniform and exponential distribution

Consider an experiment. The duration of the experiment has uniform distribution on $$[2,6]$$h. When the experiment starts, the device A turns on. This device will turn off after time,which has exponential distribution with $$\lambda=1/4$$. Calculate the probability, that experiment will end, before the device A is turned off.

Let: $$Y$$- when the device A turns off. Do we have to calculate $$P(0 \le Y \le 6)$$ or $$P(2 \le Y \le 6)$$? My idea is to count the integral : $$\int_{?}^{6} \int_{0}^{\frac{e^{-x/4}}{4}}1 \,dx\,dy$$.

I suppose that the exponential distribution is independent of the end of the experiment. Let $$X$$ be the end of the experiment and $$Y$$ be the time at which the device turns of. You are looking at the probability of the event $$X\leq Y$$, that is \begin{align*} \mathbb P[X\leq Y] &= \int_2^6 \int_x^\infty f_{X,Y}(x,y) dy dx\\ &= \int_2^6 \int_x^\infty \frac{1}{4}\cdot \frac{1}{4}e^{-\frac{1}{4}y} dy dx\\ &= \frac{1}{4}\int_2^6 e^{-\frac{1}{4} x} dx\\ &= e^{-\frac{1}{2}} - e^{-\frac{3}{2}} \end{align*}