Moment Generating Function of Discrete Uniform Distribution

Theorem
Let $X \sim \DiscreteUniform n$ for some $n \in \N$.

Then the moment generating function $M_X$ of $X$ is given by:


 * $\displaystyle \map {M_X} t = \frac {e^t \paren {1 - e^{n t} } } {n \paren {1 - e^t} }$

Proof
From the definition of the Discrete Uniform distribution, $X$ has probability mass function:


 * $\displaystyle \map \Pr {X = N} = \frac 1 n$

From the definition of a moment generating function:


 * $\displaystyle \map {M_X} t = \expect {e^{t X} } = \sum_{N \mathop = 1}^n \map \Pr {X = N} e^{N t}$

So: