Uniform Distribution Calculator

Uniform Distribution Calculator

For a Uniform distribution on the interval [a,b]:

PDF: $$ f(x)=\frac{1}{b-a} \quad \text{for } a\le x\le b $$

CDF: $$ F(x)=\begin{cases} 0,&xb. \end{cases} $$

Step 1: Enter Parameters

Enter the lower bound (e.g., 0)

Enter the upper bound (e.g., 10), must be greater than a

Enter a value (typically in [a,b])

Uniform Distribution: $$ f(x)=\frac{1}{b-a} \quad \text{for } a\le x\le b $$

Expected Value: $$ \frac{a+b}{2} \quad\text{and}\quad Variance: \frac{(b-a)^2}{12} $$

Use our calculator to quickly and easily compute probabilities, generate samples, and determine various measures related to the uniform distribution.

In statistics, uniform distribution is a probability distribution where all outcomes are equally likely. Discrete uniform distributions have a finite number of outcomes. A continuous uniform distribution is a statistical distribution with an infinite number of equally likely measurable values.

How to calculate Uniform Distribution

To calculate a continuous uniform distribution, you can use the probability density function (PDF) to graph the distribution, then find the area between two points. You can also use formulas for the mean, variance, and standard deviation. 

Steps

  1. Determine the bounds of the distribution, a and b. 
  2. Use the PDF, f(x) = 1/(b-a), to graph a straight line between a and b. 
  3. Find the area between two points within the rectangle formed by the x-axis, a and b, and f(x). 
  4. Calculate the mean, variance, or standard deviation using the formulas below. 

Formulas 

  • Mean: μ = (a + b) / 2
  • Variance: σ^2 = (b - a)^2 / 12
  • Standard deviation: σ = (b - a) / √12

Notes

  • A continuous uniform distribution models the probability that is the same on an interval from a to b. 
  • All possible outcomes in the range have equal probability of occurring. 
  • The terms "average," "mean," and "expected value" are all interchangeable. 

What is the difference between uniform distribution and normal distribution?

The main difference between a normal distribution and a uniform distribution is how they assign probabilities to values

Normal distributionUniform distribution
ShapeBell-shaped curveFlat across the range
ProbabilityMore likely near the meanEqually likely across the range
ExamplesModeling symmetric data with outliersModeling evenly distributed data without outliers

Normal distribution 

  • Also known as the Gaussian distribution
  • The mean, median, and mode are all equal
  • The skewness is zero
  • The probability density function is f(x)=1σ√2πexp(−12((x−μ)σ)2)

Uniform distribution 

  • Has no mode
  • The median is the average of the minimum and maximum values
  • The probability density function is f(x)=1/(b‐a)
  • Examples include flipping a coin, rolling a die, or using a random number generator

Both distributions are symmetric and have the same mean, median, and mode. 

Examples Uniform Distribution

Uniform distribution is a probability distribution where all outcomes are equally likely. Examples of uniform distribution include: 

  • Tossing a coin: The probability of getting heads or tails is equal. 
  • Drawing a card from a deck: The probability of drawing a heart, club, diamond, or spade is equal. 
  • Rolling a die: Each side of the die has an equal chance of showing up. 
  • Waiting for a bus: If you know the bus arrives every hour but don't know when the last one arrived, the time until the next bus arrives is uniformly distributed. 
  • Elevator arrival time: If you assume that an elevator arrives uniformly between 0 and 40 seconds after you press the button, then the time it takes for the elevator to arrive is uniformly distributed. 
  • Population distribution: When organisms are spread out in a fairly regular pattern, such as desert shrubs and redwood trees. 
  • Saguaro cacti: These cacti are evenly spaced in the desert due to limited resources. 

You can visualize a uniform distribution as a straight horizontal line

Related Calculators