Moment Generating Function of Discrete Uniform Distribution

Theorem
Let $X$ be a discrete random variable with a discrete uniform distribution with parameter $n$ for some $n \in \N$.

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


 * $\map {M_X} t = \dfrac {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:


 * $\map \Pr {X = N} = \dfrac 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: