Uniform Distribution Calculator
Calculate the mean, variance, and range probabilities for a continuous or discrete uniform distribution, with a proportional diagram and step-by-step solution.
a and b define the distribution's range; c and d define the sub-range you want the probability P(c ≤ X ≤ d) for.
Uniform Density Diagram
The highlighted fraction of the shape below is exactly your probability answer.
Step-by-Step Solution
Here's exactly how this answer was calculated, one step at a time.
- 1
Identify the distribution's bounds
a = 0, b = 10
A continuous uniform distribution U(a, b) assigns equal likelihood to every value between a and b.
- 2
Find the constant density
f(x) = 1 / (b − a) = 1 / (10 − 0) = 0.1
Since the density is flat, this same value applies at every point between a and b.
- 3
Calculate the mean
μ = (a + b) / 2 = (0 + 10) / 2 = 5
The mean of a uniform distribution is always exactly the midpoint of its range.
- 4
Calculate the variance and standard deviation
σ² = (b − a)² / 12 = 8.3333 | σ = √8.3333 = 2.8868
The variance measures how spread out the values are across the interval.
- 5
Find P(c ≤ X ≤ d)
P(3 ≤ X ≤ 7) = (d − c) / (b − a) = (7 − 3) / (10 − 0) = 0.4
For a uniform distribution, probability is simply the proportion of the total width covered by [c, d].
✓ Final Answer: P(3 ≤ X ≤ 7) = 0.4 (40%)
Free Online Uniform Distribution Calculator
This uniform distribution calculator finds the density (or probability mass), mean, variance, standard deviation, and range probability for both continuous and discrete uniform distributions. Enter the distribution's bounds and the range you're interested in, and the calculator instantly returns every value, complete with a proportional diagram and a full step-by-step solution.
Whether you're a student solving probability and statistics problems, a teacher preparing worked examples, or an analyst modeling a scenario where every outcome is equally likely, this uniform distribution probability calculator handles both the continuous case (any real number in a range) and the discrete case (whole numbers only) in one tool.
What Is a Uniform Distribution?
A uniform distribution describes a situation where every possible outcome within a given range is equally likely — there's no bias toward any particular value. There are two versions: the continuous uniform distribution, where X can take any real number between a and b (like a random arrival time within an hour), and the discrete uniform distribution, where X can only take whole-number values (like the roll of a fair die, or picking a random integer from a list).
Uniform Distribution Formulas
For a continuous uniform distribution U(a, b):
- Density: f(x) = 1 / (b − a), the same constant value across the whole range
- Mean: μ = (a + b) / 2
- Variance: σ² = (b − a)² / 12
- P(c ≤ X ≤ d) = (d − c) / (b − a)
Discrete Uniform Distribution Formulas
For a discrete uniform distribution over the whole numbers {a, a+1, ..., b}, with n = b − a + 1 possible outcomes:
- Probability mass: P(X = k) = 1 / n for every outcome k
- Mean: μ = (a + b) / 2
- Variance: σ² = (n² − 1) / 12
- P(c ≤ X ≤ d) = (number of whole numbers in [c, d]) / n
How to Use This Uniform Distribution Calculator
Using the calculator takes just a few steps. First, choose continuous or discrete from the dropdown. Second, enter the distribution's lower bound (a) and upper bound (b). Third, enter the range (c to d) you want the probability for. The calculator instantly displays the density (or probability of a single outcome), the mean, variance, standard deviation, and the probability P(c ≤ X ≤ d), along with a proportional diagram.
The diagram is drawn so the highlighted fraction is the literal answer: for the continuous case, the shaded width divided by the total width equals your probability; for the discrete case, the number of highlighted bars divided by the total number of bars equals your probability. There's no separate scale to interpret — what you see is what you get.
Worked Example
Continuous example: A bus arrives at a stop at a uniformly random time between 0 and 10 minutes past the hour (a = 0, b = 10). What's the probability it arrives between minute 3 and minute 7? Using P(c ≤ X ≤ d) = (d − c) / (b − a) = (7 − 3) / (10 − 0) = 4/10 = 0.4, or 40%.
Discrete example: A fair 6-sided die is rolled (a = 1, b = 6, n = 6 outcomes). What's the probability of rolling a 3, 4, or 5? Using P(c ≤ X ≤ d) = count / n = 3 / 6 = 0.5, or 50%, since three of the six equally likely outcomes (3, 4, and 5) fall in that range.
Where Uniform Distributions Are Used
Uniform distributions are one of the simplest but most widely used probability models, appearing in many practical situations:
- Students and teachers use it as an introductory example throughout probability and statistics coursework.
- Random number generators in computer science are built on the continuous uniform distribution over [0, 1].
- Simulation and Monte Carlo methods use uniform distributions to generate random inputs before transforming them into other distributions.
- Quality control and manufacturing sometimes model tolerances or arrival times as uniformly distributed when no value is more likely than another.
- Games of chance — like rolling a fair die or drawing a numbered ball — are classic examples of the discrete uniform distribution.
Frequently Asked Questions
What is the difference between continuous and discrete uniform distributions?
A continuous uniform distribution allows X to be any real number within a range (like 3.7 or 5.2), with density f(x) = 1/(b−a). A discrete uniform distribution only allows whole numbers within a range, each with probability 1/n, where n is the count of possible outcomes.
What is the formula for the mean of a uniform distribution?
For both continuous and discrete uniform distributions, the mean is μ = (a + b) / 2 — simply the midpoint of the distribution's range.
How do I find the probability of a range in a uniform distribution?
For continuous: P(c ≤ X ≤ d) = (d − c) / (b − a). For discrete: P(c ≤ X ≤ d) = (number of whole numbers between c and d) / n, where n is the total number of possible outcomes.
Why is the density constant in a uniform distribution?
By definition, a uniform distribution assigns equal likelihood to every value in its range, so the density (or probability per outcome) doesn't change no matter where you are within [a, b] — it's a flat, rectangular shape.
Can a is uniform distribution have a = b?
No. If a equals b, there's no range of possible values and the distribution isn't defined — this calculator requires the upper bound (b) to be strictly greater than the lower bound (a).