Free Uniform Distribution Calculator

Enter a, b, x

What Is a Uniform Distribution?

The Uniform Distribution Calculator is a free online tool that simplifies working with the uniform distribution, making it easy to compute probabilities, generate random samples, and obtain key descriptive statistics such as the mean, variance, and standard deviation. This distribution is fundamental in probability theory and appears frequently in simulations and random number generation.

A uniform distribution describes a scenario where every outcome in a given interval is equally likely. For a continuous uniform distribution defined on the interval [a,b][a, b], denoted U(a,b)U(a, b), the probability density function (pdf) is constant over the entire range. The standard uniform distribution, U(0,1)U(0,1), is a special case where the interval shrinks to [0,1][0,1]. Notably, U(0,1)U(0,1) coincides with a beta distribution with parameters (1,1)(1,1), i.e., U(0,1)=B(1,1)U(0,1) = B(1,1).

While continuous uniform distributions model situations where probabilities are spread evenly across a continuum, the discrete uniform distribution applies when there is a finite set of equally probable outcomes. This calculator handles both types, but the main focus is on the continuous case.

Probability Density and Cumulative Distribution Functions

The pdf of the uniform distribution U(a,b)U(a,b) is expressed as:

f(x)=1b−a,a≤x≤b.f(x) = \frac{1}{b - a},\quad a \le x \le b.

For the standard uniform distribution U(0,1)U(0,1), the pdf simplifies to f(x)=1f(x) = 1 for 0≤x≤10 \le x \le 1. Outside the interval the pdf is zero. Graphically, the pdf forms a horizontal line, giving the distribution its alternative name—rectangular distribution.

The cumulative distribution function (cdf) for U(a,b)U(a,b) is:

F(x)=x−ab−a,a≤x≤b.F(x) = \frac{x - a}{b - a},\quad a \le x \le b.

For the standard uniform, this becomes F(x)=xF(x) = x for 0≤x≤10 \le x \le 1. The cdf is zero for x<ax < a and one for x>bx > b.

The quantile function, which is the inverse of the cdf, has the simple linear form:

Q(p)=(b−a)p+a,0≤p≤1.Q(p) = (b - a)p + a,\quad 0 \le p \le 1.

Using the Uniform Distribution Calculator

The calculator offers several modes to address different needs. You can select a probability calculator to find the likelihood of an event, a sample generator to produce random numbers from the distribution, or direct access to the pdf, cdf, and quantile function. Additionally, a common measures mode instantly computes the mean, median, variance, standard deviation, and skewness.

To use it, simply input the parameters aa and bb (the lower and upper bounds of the interval). Depending on the mode, you may also enter the argument (e.g., the value xx for the pdf) or the desired sample size. The tool then returns the result, often accompanied by a visual graph of the distribution.

Calculating Probabilities with Uniform Distribution

For a uniform distribution U(a,b)U(a,b), the probability that a random variable falls within a sub-interval [c,d][c,d] (fully contained in [a,b][a,b]) is proportional to the length of that sub-interval. The formula is:

P(c≤X≤d)=d−cb−a.P(c \le X \le d) = \frac{d - c}{b - a}.

Geometrically, this probability equals the area of a rectangle under the pdf curve. The rectangle’s height is 1/(b−a)1/(b-a) (the constant pdf value) and its width is (d−c)(d - c), so area = height × width = (d−c)/(b−a)(d - c)/(b - a), matching the formula.

Mean, Variance, and Other Measures

The uniform distribution is symmetric, so its mean and median are the same—the midpoint of the interval. The mean (expected value) is:

μ=a+b2.\mu = \frac{a + b}{2}.

The variance measures the spread and is given by:

σ2=(b−a)212.\sigma^{2} = \frac{(b - a)^{2}}{12}.

The standard deviation is simply the square root of the variance:

σ=b−a12.\sigma = \frac{b - a}{\sqrt{12}}.

Because the distribution is perfectly symmetric, its skewness equals zero. These formulas allow you to quickly characterize any uniform distribution without needing a calculator, though the online tool automates the process.

Discrete Uniform Distribution

When there are only finitely many equally likely outcomes, we have a discrete uniform distribution. For nn possible outcomes, each has probability P(x)=1/nP(x) = 1/n. Common examples include:

  • Tossing a fair coin: two outcomes, each with probability 1/21/2.
  • Drawing a specific suit from a standard deck: four suits, each with probability 1/41/4.
  • Rolling a fair six‑sided die: six outcomes, each with probability 1/61/6.

The discrete uniform distribution shares the core idea of equal likelihood with its continuous counterpart, but it deals with countable events rather than an continuum of values.

FAQ

1. How do you calculate the mean of a uniform distribution?

The mean (expected value) of a uniform distribution U(a,b) is the midpoint of the interval: μ = (a + b) / 2. Because the distribution is symmetric, the median is the same value.

2. What is the difference between discrete and continuous uniform distribution?

A continuous uniform distribution has infinitely many outcomes over an interval [a,b], and the probability density is constant. A discrete uniform distribution has a finite set of equally likely outcomes, each with probability 1/n. The continuous case deals with intervals, while the discrete case deals with countable events.

3. How can I use the Uniform Distribution Calculator to find probabilities?

Select the 'Probability calculator' mode, enter the lower bound a and upper bound b of the distribution, then specify the sub‑interval [c,d] for which you want the probability. The calculator will apply the formula P(c ≤ X ≤ d) = (d - c) / (b - a) and display the result.

4. What is the formula for the cumulative distribution function of a uniform distribution?

For U(a,b), the cdf is F(x) = (x - a) / (b - a) for a ≤ x ≤ b. For the standard uniform distribution U(0,1), it simplifies to F(x) = x for 0 ≤ x ≤ 1.

5. What is the standard deviation of a uniform distribution?

The standard deviation of U(a,b) is σ = (b - a) / √12. It is the square root of the variance, which is (b - a)² / 12.

How to Use

  1. Enter your values.
  2. The result updates automatically.
  3. Use the result for your needs.