# Continuous Uniform Distribution

## Continuous Uniform Distribution

Continuous uniform distribution is the simplest of all the distributions in statistics. The density function of continuous uniform distribution is flat like a rectangle, hence it is often called rectangular distribution. The probability is uniformly distributed in a closed interval $[\alpha,\beta]$.

A continuous random variable $X$ is said to have a continuous uniform distribution with parameters $\alpha$ and $\beta$ if its p.d.f. is given by

 \begin{align*} f(x;\alpha,\beta)&= \begin{cases} \frac{1}{\beta - \alpha}, & \alpha < x< \beta; \\ 0, & Otherwise. \end{cases} \end{align*}

In notation, it can be written as $X\sim U(\alpha, \beta)$. Here $\alpha$ and $\beta$ are the parameters of continuous uniform distributions

It is clear that $f(x)>0$. Also

 $$\begin{eqnarray*} \int_\alpha^\beta f(x) \; dx &=& \int_\alpha^\beta \frac{1}{\beta-\alpha}\;dx\\ &=& \frac{1}{\beta - \alpha}\int_\alpha^\beta \;dx\\ &=& \frac{1}{\beta - \alpha}\big[x\big]_\alpha^\beta \\ &=& \frac{\beta-\alpha}{\beta - \alpha}\\ &=& 1. \end{eqnarray*}$$

Hence $f(x)$ defined above is a legitimate probability density function.

## Graph of continuous uniform distribution

Let $X\sim U(2,10)$ distribution. Then the density function of $X$ is

 \begin{align*} f(x)&= \begin{cases} \frac{1}{10 - 2}, & 2 < x < 10; \\ 0, & Otherwise. \end{cases} \end{align*}

• The density function of $U(\alpha, \beta)$ forms a rectangle with length of the base $\beta-\alpha$ and length of the height $\dfrac{1}{\beta-\alpha}$. And the the area under $f(x)$ and between the endpoints is 1. It is clear from the above graph of continuous uniform distribution with $\alpha =2$ and $\beta=10$.

## Distribution Function of Uniform Distribution

The distribution function of uniform distribution $U(\alpha,\beta)$ is $F(x) = \frac{x-\alpha}{\beta - \alpha}$.

#### Proof

The distribution function of $U(\alpha,\beta)$ distribution is

 $$\begin{eqnarray*} F(x) &=& P(X\leq x) \\ &=& \int_\alpha^x f(x)\;dx\\ &=& \frac{1}{\beta - \alpha}\int_\alpha^x \;dx\\ &=& \frac{1}{\beta - \alpha}[x]_\alpha^x \\ &=& \frac{x-\alpha}{\beta - \alpha}. \end{eqnarray*}$$

The distribution function of uniform distribution $U(\alpha,\beta)$ is $F(x) = \frac{x-\alpha}{\beta - \alpha}$.

The cumulative distribution function of $X$ with $U(2,10)$ distribution is

## Mean and Variance of Uniform Distribution

The mean and variance of Uniform distribution $U(\alpha,\beta)$ are $\mu_1^\prime=\frac{\alpha+\beta}{2}$ and $\mu_2=\frac{(\beta-\alpha)^2}{12}$ respectively.

#### Proof

The mean of Uniform distribution is

 $$\begin{eqnarray*} \text{mean = }\mu_1^\prime &=& E(X) \\ &=& \int_{\alpha}^\beta x\frac{1}{\beta-\alpha}\; dx\\ &=& \frac{1}{\beta-\alpha} \big[\frac{x^2}{2}\big]_\alpha^\beta\\ &=& \frac{1}{\beta-\alpha} \big(\frac{\beta^2}{2}-\frac{\alpha^2}{2}\big)\\ &=& \frac{1}{\beta-\alpha} \cdot\frac{\beta^2-\alpha^2}{2}\\ &=& \frac{\alpha+\beta}{2}. \end{eqnarray*}$$

To find variance of $X$, we need to find $E(X^2)$.

 $$\begin{eqnarray*} \mu_2^\prime&= &E(X^2)\\ &=& \int_{\alpha}^\beta x^2\frac{1}{\beta-\alpha}\; dx\\ &=& \frac{1}{\beta-\alpha} \big[\frac{x^3}{3}\big]_\alpha^\beta\\ &=& \frac{1}{\beta-\alpha} \big(\frac{\beta^3}{3}-\frac{\alpha^3}{3}\big)\\ &=& \frac{1}{\beta-\alpha} \cdot\frac{(\beta-\alpha)(\beta^2+\alpha\beta +\alpha^2)}{3}\\ &=& \frac{\beta^2+\alpha\beta +\alpha^2}{3}. \end{eqnarray*}$$

Hence, the variance of Uniform distribution is

 $$\begin{eqnarray*} \text{Variance = } \mu_2&=&\mu_2^\prime-(\mu_1^\prime)^2\\ &=&\frac{\beta^2+\alpha\beta +\alpha^2}{3}-\bigg(\frac{\alpha+\beta}{2}\bigg)^2\\ &=&\frac{(\beta-\alpha)^2}{12}. \end{eqnarray*}$$

## Raw Moments of Uniform Distribution

The $r^{th}$ raw moment of uniform distribution $U(\alpha,\beta)$ is $\mu_r^\prime =\frac{\beta^{r+1}-\alpha^{r+1}}{(r+1)(\beta-\alpha)}$.

#### Proof

The $r^{th}$ raw moment of uniform distribution $U(\alpha,\beta)$ is

 $$\begin{eqnarray*} \mu_r^\prime &=& E(X^r) \\ &=& \frac{1}{\beta-\alpha}\int_{\alpha}^\beta x^r\; dx\\ &=& \frac{1}{\beta-\alpha}\bigg[\frac{x^{r+1}}{r+1}\bigg]_\alpha^\beta\\ &=& \frac{\beta^{r+1}-\alpha^{r+1}}{(r+1)(\beta-\alpha)} \end{eqnarray*}$$

The $r^{th}$ raw moment of uniform distribution $U(\alpha,\beta)$is $\mu_r^\prime =\frac{\beta^{r+1}-\alpha^{r+1}}{(r+1)(\beta-\alpha)}$.

## Mean deviation about mean of Uniform Distribution

The mean deviation about mean of Uniform distribution $U(\alpha,\beta)$ is $E[|X-\mu_1^\prime|]=\frac{\beta-\alpha}{4}$.

#### Proof

The mean deviation about mean of Uniform distribution $U(\alpha,\beta)$ is

 $$\begin{eqnarray*} E[|X-\mu_1^\prime|] &=& E\big[|X-\frac{\alpha+\beta}{2}|\big] \\ &=& \frac{1}{\beta-\alpha}\int_{\alpha}^\beta \bigg(|x-\frac{\alpha+\beta}{2}|\bigg)\; dx \end{eqnarray*}$$

Let $t=x-\frac{\alpha+\beta}{2}$ $\Rightarrow dt = dx$ and as $x\to \alpha$, $t\to -\frac{\beta-\alpha}{2}$ and as $x\to \beta$, $t\to \frac{\beta-\alpha}{2}$.

Hence,

 $$\begin{eqnarray*} E[|X-\mu_1^\prime|] &=& \frac{1}{\beta-\alpha}\int_{-(\beta-\alpha)/2}^{(\beta-\alpha)/2} |t|\;dt\\ &=& 2\frac{1}{\beta-\alpha}\int_{0}^{(\beta-\alpha)/2} t\;dt\\ &=& 2\frac{1}{\beta-\alpha}\bigg[\frac{t^2}{2}\bigg]_{0}^{(\beta-\alpha)/2}\\ &=& \frac{\beta-\alpha}{4}. \end{eqnarray*}$$

The mean deviation about mean of Uniform distribution $U(\alpha,\beta)$ is $E[|X-\mu_1^\prime|]=\frac{\beta-\alpha}{4}$.

## M.G.F. of Uniform Distribution

The moment generating function of uniform distribution $U(\alpha,\beta)$ is $M_X(t)=\frac{e^{t\beta}-e^{t\alpha}}{t(\beta-\alpha)}$.

#### Proof

The moment generating function of uniform distribution $U(\alpha,\beta)$

 $$\begin{eqnarray*} M_X(t) &=& E(e^{tX}) \\ &=& \frac{1}{\beta-\alpha}\int_\alpha^\beta e^{tx} \; dx\\ &=& \frac{1}{\beta-\alpha}\bigg[\frac{e^{tx}}{t}\bigg]_\alpha^\beta \; dx\\ &=& \frac{1}{\beta-\alpha}\bigg[\frac{e^{t\beta}-e^{t\alpha}}{t}\bigg]\\ &=& \frac{e^{t\beta}-e^{t\alpha}}{t(\beta-\alpha)}. \end{eqnarray*}$$

The moment generating function of uniform distribution $U(\alpha,\beta)$ is $M_X(t)= \frac{e^{t\beta}-e^{t\alpha}}{t(\beta-\alpha)}$.

## Conclusion

In this tutorial, you learned about theory of Continuous Uniform distribution like the probability density function, mean, variance, moment generating function and other properties of Continuous Uniform distribution.

To read more about the step by step examples and calculator for Continuous Uniform distribution refer the link Continuous Uniform Distribution Calculator with Examples. This tutorial will help you to understand how to calculate mean, variance of Continuous Uniform distribution and you will learn how to calculate probabilities and cumulative probabilities for Continuous Uniform distribution with the help of step by step examples. 