Textbook question:
Find the MGF of the random variable $X$ with PMF $$p_{X}(x) = pe^{-\lambda}\dfrac{\lambda^{x}}{x!}+(1-p)e^{-\mu}\dfrac{\mu^{x}}{x!}\text{, }\quad x = 0, 1, \dots$$ where $\lambda$ and $\mu$ are positive scalars, and $p$ satisfies $0 \leq p \leq 1$.
Hi guys, I'm new to MGFs and such and I need help with this question. I know that we're dealing with Poisson distributions, and we also have $p$, and the compliment $(1-p)$, but I don't know how to put this information together.
I do know that the MGF of a Poisson distribution is given by: $M_x(t) = $ $e^{ \lambda (e^{t} - 1)}$
But I don't know what to do when the distribution has a scalar coefficient.
Would it simply be something like: $M_x(t) = $ $p(e^{ \lambda (e^{t} - 1)}) + (1-p)(e^{ \lambda (e^{t} - 1)}) $?
By definition, $$\begin{align} M_{X}(t) = \mathbb{E}\left[e^{tX}\right] &= \sum\limits_{x=0}^{\infty}e^{tx}p_{X}(x)\\ &= \sum\limits_{x=0}^{\infty}e^{tx}\left[pe^{-\lambda}\dfrac{\lambda^{x}}{x!}+(1-p)e^{-\mu}\dfrac{\mu^{x}}{x!}\right] \\ &= \sum\limits_{x=0}^{\infty}e^{tx}pe^{-\lambda}\dfrac{\lambda^{x}}{x!} + \sum\limits_{x=0}^{\infty}e^{tx}(1-p)e^{-\mu}\dfrac{\mu^{x}}{x!} \\ &= p \underbrace{\sum\limits_{x=0}^{\infty}e^{tx}e^{-\lambda}\dfrac{\lambda^{x}}{x!}}_{A} + (1-p)\underbrace{\sum\limits_{x=0}^{\infty}e^{tx}e^{-\mu}\dfrac{\mu^{x}}{x!}}_{B}\text{.} \end{align}$$ Notice that $A$ is the MGF of a Poisson with mean $\lambda$ and $B$ is the MGF of a Poisson with mean $\mu$. So $$M_{X}(t) = pe^{\lambda(e^{t}-1)}+(1-p)e^{\mu(e^{t}-1)}\text{.}$$