How to verify the formula for the moment generating function of a uniform random variable?
Also, how to differentiate to verify the formulas for the mean and variance?
I started from $M_X(t)=E[\exp(t^TX)]$ but not sure how to actually verify it.
Also, how to differentiate to verify the formulas for the mean and variance?
I started from $M_X(t)=E[\exp(t^TX)]$ but not sure how to actually verify it.
On
Expanding the inner term, \begin{align*} E[e^{t X}] &= E\Big( \frac{(tX)^0}{0!} + \frac{(tX)^1}{1!} + \frac{(tX)^2}{2!} + \dots \Big) \\ &= E\Big( 1 + tX + \frac{t^2 X^2}{2} + \dots\Big) \\ &= 1 + tEX + \frac{t^2EX^2}{2} + \dots \end{align*} It is easy to verify that evaluating the $k^{th}$ derivative of this function at $t = 0$ gives the $k^{th}$ moment of $X$.
On
$X$ follows $U(a,b)$. Then pdf of X is $f(x)=\frac{1}{b-a}$, ${-\infty}<a<b<\infty$. For $|t|\leq t^*<\infty$,
$$M_X(t)=E(e^{tX})=\int_{a}^{b} \frac{e^{tx}}{b-a}dx=\frac{1}{b-a}\big{[}\frac{e^{tx}}{t}\big{]}_{a}^{b} =\frac{e^{bt}-e^{at}}{b-a}$$
$E(X^k)=\frac{d^kM_X(t)}{dt^k}\big{|}_{t=0}$
So, $E(X)=\frac{dM_X(t)}{dt}\big{|}_{t=0}$ and $Var(X)=E(X^2)-E^2(X)=\frac{d^2M_X(t)}{dt^2}\big{|}_{t=0} -E^2(X)$
I think you can complete the last two part!
You should write out the series expansion of the exponential function and then you can differentiate this expansion $k$ times and set $t=0$ to obtain the $k$-th moment.