Wondering if someone could explain the following solution given by my lecture.
We are given that the probability generating function for a distribution is $e^{\mu(t-1)}$ and now must use this to find the moment generating function and then derive the first two moments $E(X)$ and $E(X^2)$.
So this is the solution:
$M_X(t)=E(e^{tX})=G_X(e^t)=e^{\mu(e^t-1)}$
$E(X)=M'_X(t)|_{t=0}=\mu$
I don't understand this step... if we are differentiating $M_X(t)$ then setting $t=0$ then how is it possible to find $\mu$ as the answer?
My lecturers notes are fairly vague so any help would be greatly appreciated!
Think about expanding the definition of the MGF: $$ E[e^{tX}] = E\left[1+tX+\frac{t^2}{2}X^2+\dotsc\right] = E[1]+tE[X] + \frac{t^2}{2}E[X^2] + \dotsc. $$ The first term is $1$, the second is what we want. We can get that by differentiating and setting $t=0$.
Alternatively, suppose we can pass a derivative with respect to $t$ inside the expectation. Then $$ M_X'(t) = \frac{d}{dt}E[e^{tX}] = E\left[ \frac{d}{dt} e^{tX} \right] = E\left[ X e^{tX} \right]. $$ Putting $t=0$ then gives $$ M_X'(0) = E[Xe^0]=E[X]. $$