Combined law of a continuous and a discrete random variables [duplicate]
Solution 1:
For every nonnegative $z$, $$[Z\gt z,W=1]=[Y\gt X\gt z],\qquad [Z\gt z,W=0]=[X\gt Y\gt z],$$ and the value of the probability of these events, for every $z$, fully determines the joint distribution of $(Z,W)$. For example, $$P(Y\gt X\gt z)=\int_z^\infty\mu\mathrm e^{-\mu y}\int_z^y\lambda\mathrm e^{-\lambda x}\,\mathrm dx\,\mathrm dy=\int_z^\infty\mu\mathrm e^{-\mu y}(\mathrm e^{-\lambda z}-\mathrm e^{-\lambda y})\,\mathrm dy=\color{red}{\frac{\lambda}{\lambda+\mu}}\cdot\color{blue}{\mathrm e^{-(\lambda+\mu)z}}.$$ By symmetry $(\lambda,\mu)\leftrightarrow(\mu,\lambda)$, $$P(X\gt Y\gt z)=\color{red}{\frac{\mu}{\lambda+\mu}}\cdot\color{blue}{\mathrm e^{-(\lambda+\mu)z}}.$$ The product form of these probabilities shows that $(Z,W)$ is independent, with $$P(Z\gt z)=\color{blue}{\mathrm e^{-(\lambda+\mu)z}},$$ for every $z\geqslant0$, which proves that $Z$ is exponential with parameter $\lambda+\mu$, and with $$P(W=1)=\color{red}{\frac{\lambda}{\lambda+\mu}},\qquad P(W=0)=\color{red}{\frac{\mu}{\lambda+\mu}},$$ which proves that $W$ is Bernoulli with parameter $\lambda/(\lambda+\mu)$.