I am trying to find the moment generating function of a variable with a negative binomial disribution (Counuting the number of trials when the counting stops once $n$ successes, with probability $q$ each, have occurred).
I have come up with:
$$M_{X}(t)=\mathbb{E}(e^{tX})=\sum_{k=n}^{\infty}e^{tk}q^{n}(1-q)^{k-n}\binom{k-1}{n-1}$$
But am not sure how to continue.
Finish off by rearranging and applying the negative binomial theorem: $$\begin{align} M_{X}(t)=\mathbb{E}(e^{tX})&=\sum_{k=n}^{\infty}e^{tk}q^{n}(1-q)^{k-n}\binom{k-1}{n-1} \\ &=\sum_{k=0}^{\infty}e^{t(k+n)}q^{n}(1-q)^{k}\binom{k+n-1}{n-1}\\ &=e^{tn} q^n\sum_{k=0}^{\infty}\left(e^{t}(1-q)\right)^{k}\binom{k+n-1}{k}\\ &=e^{tn} q^n (1+e^t(1-q))^{-n}\\ &=\left(\frac{qe^t}{1+e^t(1-q)}\right)^n \end{align}$$