# Uniform Distribution (Rectangular distribution)

uniform distribution U(a, b), also called a rectangular distribution, is defined by two parameters:

• minimum, a.
• maximum, b.

In between the minimum and maximum, the distribution has the same function values (i.e., y-values) for each input of x.

## Continuous vs. discrete uniform distribution

The continuous distribution has an infinite number of values between the minimum a and maximum b. For example, you could have data points of 2.0, 2.001, 2.00001, ….

The above graph is a rectangle, so we can use the simple formula l x w to find the area under the “curve” of a continuous uniform distribution, the area is:
A = l x h = 3 * 0.333… = 1.

While there are an infinite number of continuous uniform distributions, the most commonly used is where a = 0 and b = 1 .

Another way to look at this result mathematically: the length of the rectangle is (b a), while the height of the rectangle is 1/(ba). Multiplying these together will always equal 1.

The continuous uniform distribution is always shaped like a rectangle – like the example above. The discrete uniform distribution is also rectangular shaped, but instead of a continuous line, a series of dots represents a known, finite number of outcomes.

As an example, one roll of a die roll has six possible outcomes: 1,2,3,4,5, or 6. There is an equal probability for each number (1/6). Discrete uniform distributions have little real-life utility and so aren’t as popular.

## Continuous uniform distribution properties

Some general properties:

• Continuity,
• Random variables can take on any value between a and b.
• Any equal size interval X is equally likely. For example, the interval [1, 3] is as equally likely as the interval [2, 4].

The general formula for the probability density function (pdf) for the continuous uniform distribution is:

Where a and b are two constants.

The uniform cumulative distribution function (CDF) is

The CDF adds up all of the probabilities from left (minimum) to right (maximum) and plots a linear graph:

Other properties include:

• Mean = ½(a + b)
• Median = ½(a + b)
• Mode = any value in (a, b)
• Skewness = 0
• Kurtosis = -6/5

## Expected Value & Variance

The expected value (or mean) of a uniform random variable X is:

E(X) = (1/2) (a + b)

or, equivalently:

E(X) = (b + a) / 2.

For example, with a = 2 and b = 4, the expected value is E(X) = (4 + 2) / 2 = 3.

The variance of a uniform random variable is:

Var(x) = (1/12)(b – a)2

For example, with a = 2 and b = 4, the variance is Var(x) = (1/12)(4 – 2)2 = 1/3.

## Joint uniform distribution

A joint uniform distribution can be defined relatively simply as 

For example, if you need to find the probability of a subset B of a uniform region, set up a double integral. As the density is constant, it can be pulled out, which means that the probability of a region is the ratio of its area to the sample space area:

## References

 Penn State Eberly College of Science. Stat 414 Introduction to probability theory. 14.6 Uniform Distributions. Retrieved 4/24/2023 from: https://online.stat.psu.edu/stat414/lesson/14/14.6