Search for probability and statistics terms on Statlect
StatLect

Uniform distribution

by , PhD

A continuous random variable has a uniform distribution if all the values belonging to its support have the same probability density.

Table of Contents

Definition

The uniform distribution is characterized as follows.

Definition Let X be a continuous random variable. Let its support be a closed interval of real numbers:[eq1]We say that X has a uniform distribution on the interval $left[ l,u
ight] $ if and only if its probability density function is[eq2]

A random variable having a uniform distribution is also called a uniform random variable. Sometimes, we also say that it has a rectangular distribution or that it is a rectangular random variable.

To better understand the uniform distribution, you can have a look at its density plots.

Expected value

The expected value of a uniform random variable X is[eq3]

Proof

It can be derived as follows:[eq4]

Variance

The variance of a uniform random variable X is[eq5]

Proof

We can use the variance formula [eq6] as follows:[eq7]

Moment generating function

The moment generating function of a uniform random variable X is defined for any t in R:[eq8]

Proof

Using the definition of moment generating function, we get[eq9]Note that the above derivation is valid only when $t
eq 0$. However, when $t=0$:[eq10]Furthermore, it is easy to verify that[eq11]When $t
eq 0$, the integral above is well-defined and finite for any t in R. Thus, the moment generating function of a uniform random variable exists for any t in R.

Characteristic function

The characteristic function of a uniform random variable X is[eq12]

Proof

Using the definition of characteristic function, we obtain[eq13]Note that the above derivation is valid only when $t
eq 0$. However, when $t=0$:[eq14]Furthermore, it is easy to verify that[eq15]

Distribution function

The distribution function of a uniform random variable X is[eq16]

Proof

If $x<l$, then[eq17]because X can not take on values smaller than $l$. If $lleq xleq u$, then[eq18]If $x>u$, then[eq19]because X can not take on values greater than $u$.

Density plots

This section shows the plots of the densities of some uniform random variables, in order to demonstrate how the uniform density changes by changing its parameters.

Plot 1 - Different supports but same length

The following plot contains the graphs of two uniform probability density functions:

The two random variables have different supports, but their two supports have the same length. Therefore, since the uniform density is constant and inversely proportional to the length of the support, the two random variables have the same constant density over their respective supports.

uniform density plot 1

Plot 2 - Different supports and different lengths

The following plot contains the graphs of two uniform probability density functions:

The two random variables have different supports, and the length of $R_{Y}$ is twice the length of R_X. Therefore, since the uniform density is constant and inversely proportional to the length of the support, the second random variable has a constant density which is half the constant density of the first one.

uniform density plot 2

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

Let X be a uniform random variable with support[eq24] Compute the following probability:[eq25]

Solution

We can compute this probability by using the probability density function or the distribution function of X. Using the probability density function, we obtain[eq26]Using the distribution function, we obtain[eq27]

Exercise 2

Suppose the random variable X has a uniform distribution on the interval [eq28]. Compute the following probability:[eq29]

Solution

This probability can be easily computed by using the distribution function of X:[eq30]

Exercise 3

Suppose the random variable X has a uniform distribution on the interval $left[ 0,1
ight] $. Compute the third moment of X, that is,[eq31]

Solution

We can compute the third moment of X by using the transformation theorem:[eq32]

How to cite

Please cite as:

Taboga, Marco (2021). "Uniform distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/uniform-distribution.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.