Moment Generating Functions is literally the function that generates the moments i.e. E(X), E(\(X^2\)).. In this case we will find out the first and second derivative to get the expected value and variance.
\[g(t)=\sum _{ j=0 }^{ n }{ { e }^{ tj } } (n!/(n-j)!j!){ p }^{ j }{ q }^{ n-j }\] \[g(t)=\sum _{ j=0 }^{ n }{ (n!/(n-j)!j!) } { { (pe }^{ t }) }^{ j }{ q }^{ n-j }\] \[g(t)={ ({ pe }^{ t }+q) }^{ n }\]
First Derivative:
\[g'(t)=n{ ({ pe }^{ t }+q) }^{ n-1 }{ pe }^{ t }\]
\[g'(0)={ n(p+q) }^{ n-1 }p=np\]
\[\mu ={ \mu }_{ 1 }=g'(0)=np\]
Second Derivative:
\[g''(t)=n(n-1)({ pe }^{ t }+q){ ({ pe }^{ t }) }^{ 2 }+n{ ({ pe }^{ t }+q) }^{ n }{ pe }^{ t } \]
\[g''(0)=\quad { n(n-1)(p+q) }^{ n-1 }{ p }^{ 2 }+{ n(p+q) }^{ n }p\]
\[g''(0)=n(n-1){ p }^{ 2 }+np\]
\[{ \sigma }^{ 2 }={ \mu }_{ 2 }-{ \mu }_{ 1 }^{ 2 }1=g''(0)-{ g'(0) }^{ 2 }\\ { \sigma }^{ 2 }=n(n-1){ p }^{ 2 }+np-{ (np) }^{ 2 }\\ { \sigma }^{ 2 }=np[(n-1)p+1-np]\\ { \sigma }^{ 2 }=np[(np-p)+1-np]\]
\[{ \sigma }^{ 2 }=np[1-p]\]
\[{ \sigma }^{ 2 }=npq\]
The exponential distribution probability density function is:
\[\lambda { e }^{ -\lambda x }\] Moment generating function for the binomial distribution is:
\[g(t)=\frac { \lambda }{ \lambda-t } \quad for\quad t<\lambda\]
First Derivative,
\[g'(t)=\frac {\lambda }{ { (\lambda-t) }^{ 2 } } \] To get mean by evaluating for t=0,
\[g'(0)=\frac { 1 }{\lambda} \]
Second Derivative,
\[g''(t)=\frac { 2 \lambda}{ (\lambda-t)^{ 3 } } \] To get variance, by evaluating for t=0,
\[g''(0)=\frac {2}{\lambda^2} \]
variance is
\[{ \mu }^{ 2 }-{ \mu }_{ 1 }^{ 2 }=\frac { 2 }{ { \lambda }^{ 2 } } -{ (\frac { 1 }{ \lambda } ) }^{ 2 }=\frac { 2 }{ \lambda ^{ 2 } } -\frac { 1 }{ \lambda ^{ 2 } } =\frac { 1 }{ \lambda ^{ 2 } } \]