# Conditional density function of a max functiion

Let $$X,Y$$ be exponential random variables with means $$1/\lambda$$ and $$1/\mu$$, respectively. Let $$Z=\max\{X,Y\}$$.

Find the conditional density function of $$Z$$ given that $$Z=X$$.

• Welcome to MSE! What were your attempts so far? – Minus One-Twelfth Feb 28 at 1:43
• Thanks! Well so far, I know that $Z=X$ implies that $X>Y$. I know that $P(Y<X)=\frac{\mu}{\mu+\lambda}$ for exponential random variables. I also believe the following is correct: $$f_{Z|Z=X}(z)=\frac{P(Z=z,Z=X)}{P(Z=X)}$$ Unsure where to go from here. – Cashew Feb 28 at 1:54
• Your approach is rather incorrect , because a density is not a probability. This can be more or less fixed by taking small intervals, assuming the density is "well behaved"... but it's more neat and simple (though perhaps a little less intuitive) to use the cumulative distribution, that is, to use events of positive probability, as in angryavian answer. – leonbloy Feb 28 at 2:21

One approach: compute $$P(Z \le z \mid Z=X) = \frac{P(Z \le z, Z=X)}{P(Z=X)},$$ and take the derivative.
$$P(Z \le z , Z=X) = P(Y \le X \le z) = \int_0^z \int_y^z f_X(x) f_Y(y) \, dx \, dy = \int_0^z f_Y(y) (e^{-\lambda y} - e^{-\lambda z}) \, dy = - e^{-\lambda z}(1 - e^{-\mu z}) + \frac{\mu}{\mu + \lambda}(1 - e^{-(\lambda + \mu)z})$$
$${}$$
Thus $$P(Z \le z \mid Z=X) = \frac{P(Z \le z, Z=X)}{P(X \ge Y)} = - \frac{\mu + \lambda}{\mu} e^{-\lambda z}(1 - e^{-\mu z}) + (1 - e^{-(\lambda + \mu)z})$$
$${}$$
Taking the derivative with respect to $$z$$ yields $$\frac{\mu + \lambda}{\mu} (\lambda e^{- \lambda z} - (\lambda + \mu) e^{-(\lambda + \mu) z}) + (\lambda + \mu) e^{-(\lambda + \mu) z} = \frac{(\mu + \lambda)\lambda}{\mu} (e^{-\lambda z} - e^{-(\lambda + \mu) z}).$$