Let's say we have two independent exponential random variables A and B with parameters $\mu$ and $\lambda$ such that:
$$f(a|\mu) = \mu e^{-\mu a} $$ $$f(b|\lambda) = \lambda e^{-\lambda b}$$
Now we don't observe these two variables but instead, observe T and Z with:
$$T = \min(A,B)$$ $$Z = \begin{cases} 1 & \text{if $T = A$}, \\ 0 & \text{if $T = B$}. \end{cases} $$
what is the joint distribution of T and Z?
this is how I have approached the problem so far, but I couldn't reach a result and need guidance to see if I am on the right track.
$$ \begin{equation} \begin{aligned} F_{T,Z}(t,z) &= P(T \leq t, Z \leq z)\\ &= P(T \leq t | Z \leq z) P(Z\leq z) \end{aligned} \end{equation}$$
we know that for $ z < 0, F_Z(z) = 0$; for $z \geq 1, F_Z(z) = 1$ and for $0 \leq z < 1, F_Z(z) = P(B < A)$.
we also know that given $ 0 \leq z < 1, t = B $ and given $z = 1, t = A$.
so I thought I can rewrite $F_{T,Z}(t,z)$ as:
$$F_{T,Z}(t,z) \begin{cases} 0 & \text{if $Z < 0$}, \\ \lambda e^{-\lambda b} P(\lambda e^{-\lambda b} < \mu e^{-\mu a}) & \text{if $0 \leq Z < 1$}, \\ \mu e^{-\mu a} & \text{if Z > 1}. \end{cases} $$
But I can't tell if this is a good approach or how to calculate $P(\lambda e^{-\lambda b} < \mu e^{-\mu a})$ if it is. Can anyone help?
Marginal of $Z$:
\begin{align} P(B < A) &= \iint_{b<a} f_A(a) f_B(b) \, da \, db \\ &= \int_0^\infty \lambda e^{-\lambda b} \int_b^\infty \mu e^{-\mu a} \, da \, db \\ &= \int_0^\infty \lambda e^{-\lambda b} e^{-\mu b} \, db \\ &= \frac{\lambda}{\lambda + \mu}. \end{align}
So $P(Z=0)=\frac{\lambda}{\lambda + \mu}$ and $P(Z=1)=\frac{\mu}{\lambda + \mu}$.
Marginal of $T$:
\begin{align} P(T > t) &= P(A>t) P(B>t) \\ &= \int_t^\infty \mu e^{-\mu a} \, da \int_t^\infty \lambda e^{-\lambda b} \, db \\ &= e^{-(\lambda + \mu)t}. \end{align}
Joint distribution:
\begin{align} P(T > t, Z = 0) &= P(t < B < A) \\ &= \iint_{t < b < a} f_A(a) f_B(b) \, da \, db \\ &= \int_t^\infty \lambda e^{-\lambda b} \int_b^\infty \mu e^{-\mu a} \, da \, db \\ &= \int_t^\infty \lambda e^{-\lambda b} e^{-\mu b} \, db \\ &= \frac{\lambda}{\lambda + \mu} e^{-(\lambda + \mu) t}. \end{align}
By a similar computation, $P(T>t, Z=1) = \frac{\mu}{\lambda + \mu} e^{-(\lambda+\mu)t}$.
Sanity checks for the joint distribution:
If you need to put things in the form $P(T \le t, Z=z)$, note that this equals $P(Z=z) - P(T > t, Z=z)$.