I am new to stats and I happen to came across this property of MGF
Let X and Y be independent random variables. Let Z be equal to X, with probability p, and equal to Y , with probability 1 − p. Then,
MZ(s)= pMX(s) + (1 − p)MY(s).
The proof is given that
MZ(s)= E[e^(sZ)]= pE[e^(sX)] + (1 − p)E[e^(sY)]= pMX(s) + (1 − p)MY (s).
But I do not understand, can someone show me a full proof as in showing the conditioning on the random choice between X and Y as in why
E[e^(sZ)]= pE[e^(sX)] + (1 − p)E[e^(sY)] ??
Thanks very much