The question is to find the MGF of $U = XY + (1-X)Z$, where:
$X \sim \operatorname{Bernoulli} (p = \frac{1}{3})$
$Y \sim \operatorname{EXP} (\theta = 2)$ (Note that the notation is $\theta = \operatorname{E} (Y)$ for this distribution)
$Z \sim \operatorname{POI} (\lambda = 3)$
My (intuitive...?) thought process is that:
$$\operatorname{P} (X = x) = \begin{cases} \frac{1}{3}, & x = 1 \\ \frac{2}{3}, & x = 0 \\ \end{cases}$$
So
$$ U = XY + (1 - X)Z = \begin{cases} Y & \text{with probability } \frac{1}{3} \\ Z & \text{with probability } \frac{2}{3} \\ \end{cases}$$
Then:
$$\operatorname{M}_U(t) = \operatorname{E} (e^{tU}) = \operatorname{E} (e^{t(XY + (1 - X)Z}) = \operatorname{P} (e^{tU} = e^{tY}) \operatorname{E}(e^{tY}) + \operatorname{P} (e^{tU} = e^{tZ}) \operatorname{E}(e^{tZ})$$
I don't really know how to explain this simplification: it's kind of intuitive. Can someone please explain if it is correct, and if so, why?
This is pretty much my question. Here's the rest of the derivation:
$$\begin{align} \operatorname{M}_U(t) & = \cdots = \operatorname{P} (e^{tU} = e^{tY}) \operatorname{E}(e^{tY}) + \operatorname{P} (e^{tU} = e^{tZ}) \operatorname{E}(e^{tZ}) \\ & = \operatorname{P} (X = 1) \operatorname{E}(e^{tY}) + \operatorname{P} (X = 0) \operatorname{E}(e^{tZ}) \\ & = \frac{1}{3} \operatorname{E}(e^{tY}) + \frac{2}{3} \operatorname{E}(e^{tZ}) \\ & = \frac{1}{3} \operatorname{M}_Y(t) + \frac{2}{3} \operatorname{M}_Z(t) \\ & = \frac{1}{3} \frac{1}{1 - 2t} + \frac{2}{3} e^{3(e^t-1)} \\ \end{align}$$
According to the law of total probability:$$\mathsf Ee^{tU}=\mathsf E[e^{tU}\mid X=1]\mathsf P(X=1)+\mathsf E[e^{tU}\mid X=0]\mathsf P(X=0)=$$$$\frac13\mathsf E[e^{tU}\mid X=1]+\frac23\mathsf E[e^{tU}\mid X=0]=\frac13\mathsf E[e^{tY}\mid X=1]+\frac23\mathsf E[e^{tZ}\mid X=0]$$
This because $\mathsf E[e^{tU}\mid X=1]=\mathsf E[e^{tY}\mid X=1]$ and $\mathsf E[e^{tU}\mid X=0]=\mathsf E[e^{tZ}\mid X=0]$
If $X$ and $Y$ are independent then $\mathsf E[e^{tY}\mid X=1]=\mathsf Ee^{tY}$.
If $X$ and $Z$ are independent then $\mathsf E[e^{tZ}\mid X=0]=\mathsf Ee^{tZ}$.
So under these conditions (they are not mentioned in your question) you end up with:$$M_U(t)=\mathsf Ee^{tU}=\frac13\mathsf Ee^{tY}+\frac23\mathsf Ee^{tZ}=\frac13M_Y(t)+\frac23M_Z(t)$$