## Discrete Uniform Distribution

A discrete random variable has a discrete uniform distribution if each value of the random variable is equally likely and the values of the random variable are uniformly distributed throughout some specified interval.

In this article, I will walk you through discrete uniform distribution and proof related to discrete uniform. You can find solved numerical on discrete uniform distribution examples.

## Discrete Uniform Distribution Definition

A discrete random variable $X$ is said to have a uniform distribution if its probability mass function (pmf) is given by

\begin{aligned} P(X=x)&=\frac{1}{N},;; x=1,2, \cdots, N. \end{aligned}

## Discrete Uniform Distribution Graph

Following graph shows the probability mass function of discrete uniform distribution $U(1,6)$.

## Mean of Discrete Uniform Distribution

How do you find mean of discrete uniform distribution? is given below with proof

The expected value of discrete uniform random variable is $E(X) =\dfrac{N+1}{2}$.

### Proof

The expected value of discrete uniform random variable is

\begin{aligned} E(X) &= \sum_{x=1}^N x\cdot P(X=x)\\ &= \frac{1}{N}\sum_{x=1}^N x\\ &= \frac{1}{N}(1+2+\cdots + N)\\ &= \frac{1}{N}\times \frac{N(N+1)}{2}\\ &= \frac{N+1}{2}. \end{aligned}

Hence, the mean of discrete uniform distribution is $E(X) =\dfrac{N+1}{2}$.

## Variance of Discrete Uniform Distribution

The variance of discrete uniform random variable is $V(X) = \dfrac{N^2-1}{12}$.

### Proof

The variance of discrete uniform distribution for random variable $X$ is given by

$$\begin{equation*} V(X) = E(X^2) - [E(X)]^2. \end{equation*}$$

Let us find the expected value of $X^2$.

$$\begin{eqnarray*} E(X^2) &=& \sum_{x=1}^N x^2\cdot P(X=x)\\ &=& \frac{1}{N}\sum_{x=1}^N x^2\\ &=& \frac{1}{N}(1^2+2^2+\cdots + N^2)\\ &=& \frac{1}{N}\times \frac{N(N+1)(2N+1)}{6}\\ &=& \frac{(N+1)(2N+1)}{6}. \end{eqnarray*}$$

Now, the variance of $X$ is

$$\begin{eqnarray*} V(X) & = & E(X^2) - [E(X)]^2\\ &=& \frac{(N+1)(2N+1)}{6}- \bigg(\frac{N+1}{2}\bigg)^2\\ &=& \frac{N+1}{2}\bigg[\frac{2N+1}{3}-\frac{N+1}{2} \bigg]\\ &=& \frac{N+1}{2}\bigg[\frac{4N+2-3N-3}{6}\bigg]\\ &=& \frac{N+1}{2}\bigg[\frac{N-1}{6}\bigg]\\ &=& \frac{N^2-1}{12}. \end{eqnarray*}$$

Thus the variance of discrete uniform distribution is $\sigma^2 =\dfrac{N^2-1}{12}$.

The discrete uniform distribution standard deviation is $\sigma =\sqrt{\dfrac{N^2-1}{12}}$.

## Discrete uniform distribution Moment generating function (MGF)

MGF of discrete uniform distribution is given by The MGF of $X$ is $M_X(t) = \dfrac{e^t (1 - e^{tN})}{N (1 - e^t)}$.

### Proof

Discrete uniform distribution moment generating function proof is given as below

The moment generating function (MGF) of random variable $X$ is

$$\begin{eqnarray*} M(t) &=& E(e^{tx})\\ &=& \sum_{x=1}^N e^{tx} \dfrac{1}{N} \\ &=& \dfrac{1}{N} \sum_{x=1}^N (e^t)^x \\ &=& \dfrac{1}{N} e^t \dfrac{1-e^{tN}}{1-e^t} \\ &=& \dfrac{e^t (1 - e^{tN})}{N (1 - e^t)}. \end{eqnarray*}$$

## General discrete uniform distribution

A general discrete uniform distribution has a probability mass function

\begin{aligned} P(X=x)&=\frac{1}{b-a+1},;; x=a,a+1,a+2, \cdots, b. \end{aligned}

## Mean of General discrete uniform distribution

The expected value of above discrete uniform randome variable is $E(X) =\dfrac{a+b}{2}$.

## Variance of General discrete uniform distribution

The variance of above discrete uniform random variable is $V(X) = \dfrac{(b-a+1)^2-1}{12}$.

## Distribution Function of General discrete uniform distribution

The distribution function of general discrete uniform distribution is

$F(x) = P(X\leq x)=\frac{x-a+1}{b-a+1}; a\leq x\leq b$.

Hope you like article on Discrete Uniform Distribution. You can refer below recommended articles for discrete uniform distribution calculator and step by step guide on discrete uniform distribution examples.