This uniform distribution calculator gives the mean, variance and probabilities for a continuous uniform distribution on [a, b] — where every value in the interval is equally likely and probability is just a ratio of lengths: P(x₁ < X < x₂) = (x₂ − x₁)/(b − a).
The Rectangle: Probability as Pure Length
The continuous uniform distribution is probability stripped to its skeleton: a value lands somewhere on [a, b], every position equally likely, density a flat 1/(b − a). Everything about it is one line of arithmetic — mean at the midpoint (a + b)/2, variance (b − a)²/12, and the probability of any sub-interval equal to its share of the whole length. The defaults ([0, 10], asking about [2, 7]) give the cleanest numbers in the subject: mean 5, SD 2.887, and P(2 < X < 7) = 50% — half the interval, half the probability, no tables, no z-scores. Real phenomena that genuinely behave this way include arrival phases (a bus that comes every 20 minutes, your arrival uniform over the cycle → wait U(0,20), mean wait 10), rounding errors (uniform on [−0.5, +0.5] of the last digit), spinner and roulette positions, and the phase of a sampled periodic signal.
The uniform's second life is more important than its first: it is the universal raw material of simulation and the null shape of randomness testing. Every pseudorandom generator outputs U(0,1); every other distribution is manufactured from it (inverse-CDF transforms, rejection sampling); and uniformity is the hypothesis behind randomness audits from lottery machines to clinical-trial allocation. Two structural notes complete the picture: the DISCRETE uniform (a fair die: each of n faces 1/n, mean (n+1)/2) is this page's cousin with counting instead of length; and sums of uniforms rapidly stop being uniform — two dice already make a triangle, a few more make a bell (Irwin–Hall distribution), which is the central limit theorem visible in its simplest clothing.
Worked Examples (Verified)
- Defaults: [0,10]: mean 5, SD 2.887, P(2–7) = 50.00%.
- Bus wait: U(0,20) minutes: mean wait 10 min; P(wait > 15) = 5/20 = 25%.
- Rounding error: U(−0.5, 0.5): mean 0, SD = 1/√12 = 0.289.
- Percent spinner: U(0,100): P(land 40–55) = 15% — the interval share is the answer, always.
Uniform Distribution Discipline
- Probabilities are length ratios — endpoints are measure-zero, so P(X = exactly 5) = 0 on a continuous uniform (a truth, not a bug).
- Clamp honestly: intervals poking outside [a, b] contribute only their overlap — the calculator clips x₁, x₂ to the support.
- Don't confuse range with SD: for uniform data SD ≈ 0.289 × range, much wider relative to range than a bell curve's (where range ≈ 6σ) — mixing the two inflates or deflates risk estimates badly.
- Sums and averages of uniforms aren't uniform (Irwin–Hall → normal); a process described as "uniform each day" aggregates toward bell-shaped weekly.
- Maximum entropy on a bounded interval: with only endpoints known, the uniform is the assumption-free choice — modelers reach for it when nothing justifies a peak.
Related Tools
- Geometric Distribution Calculator — waiting for the first success
- Statistics Calculators — the full collection
Frequently Asked Questions
How do you calculate probabilities for a uniform distribution?
As a ratio of lengths: P(x₁ < X < x₂) = (x₂ − x₁)/(b − a) for X uniform on [a, b]. The density is constant at 1/(b − a), so probability is the width of your interval times that height. Between 2 and 7 on [0, 10]: (7−2)/10 = 50%. This calculator also returns the mean (a+b)/2 and standard deviation (b−a)/√12 for your interval.
What are the mean and standard deviation of a uniform distribution?
Mean μ = (a + b)/2 — the midpoint, by symmetry. Variance σ² = (b − a)²/12, so SD = (b − a)/√12 ≈ 0.2887 × the range. For [0, 10]: μ = 5, σ = 2.887. The /12 factor falls out of integrating x² against the flat density; it's the same 12 that appears in the variance of rounding errors and in the Irwin–Hall sum distribution's early terms.
What is the probability density of a uniform distribution?
A constant: f(x) = 1/(b − a) everywhere inside [a, b] and 0 outside. The height is forced by the requirement that the total area equals 1 — width (b − a) × height must be 1. On [0, 10] the height is 0.1, which is why each single unit of length carries exactly 10% probability and any 5-unit window carries 50%. The graph is a rectangle — the only distribution whose "curve" has no curve.
What real things are uniformly distributed?
Arrival phases against a fixed schedule (your wait for a 20-minute-cycle bus is U(0,20)); rounding errors in reported measurements (uniform over half a unit); the position of a fair spinner or a dropped pointer; lottery-style random draws by design; and — most consequentially — the output of random number generators, U(0,1), from which simulations manufacture every other distribution. Natural quantities are rarely exactly uniform; the distribution's kingdom is phases, errors, mechanisms and models where "anywhere in this range, no favorites" is the truth or the honest assumption.
What is the difference between discrete and continuous uniform?
Counting vs length. A discrete uniform assigns equal probability 1/n to each of n outcomes (a fair die: mean (n+1)/2 = 3.5, each face 1/6); a continuous uniform assigns equal DENSITY across an interval, where single points have probability zero and only intervals carry mass. Both share the defining flatness and the maximum-entropy property on their support. This calculator is the continuous version; dice and their sums belong to discrete probability tools — where two dice already break uniformity into the famous triangular sum distribution.
Why is U(0,1) so important in simulation?
Because it's the universal input: the inverse-CDF theorem says that applying any distribution's inverse CDF to a U(0,1) draw produces a draw from that distribution — normals, exponentials, everything is downstream of uniform randomness. It's also the test target: a generator whose output fails uniformity tests (clumps, gaps, serial patterns) contaminates every simulation built on it. When a Monte Carlo looks wrong, the uniform layer is the first suspect — the flattest distribution is the foundation of the whole building.
What is the probability that a uniform variable equals a specific value?
Zero — and it's a feature of all continuous distributions, not a malfunction. A single point has zero width, and probability is width × density. The useful questions are intervals ("between 2 and 7") or tolerance bands ("within 0.1 of 5"), which carry positive probability. This is also why continuous models report densities rather than probabilities for points: f(5) = 0.1 on [0,10] is a rate per unit length, meaningful comparatively (this point's neighborhood is as likely as any other's), not a chance of hitting 5.000… exactly.
Is this uniform distribution calculator free?
Yes — free, instant, no sign-up. Enter the interval [a, b] and any sub-range for its probability, plus the distribution's mean, SD and density height.