Uniform Distribution Calculator
Find probabilities, mean, variance, and standard deviation for any continuous uniform distribution U(a, b).
📊 What is the Uniform Distribution Calculator?
The continuous uniform distribution U(a, b) is a probability model in which every value in the interval [a, b] is equally likely. The probability of landing in any sub-interval is directly proportional to the length of that sub-interval, divided by the total width of the distribution. This simplicity makes the uniform distribution one of the most important building blocks in probability and statistics.
This calculator handles two common tasks. In Probability mode, you enter the distribution bounds (a and b) plus the query limits (x1 and x2), and the calculator returns P(x1 to x2), P(X below x2), and P(X above x1). In Distribution Stats mode, you enter only a and b to see the full parameter set: mean, median, variance, standard deviation, interquartile range, PDF height, range, skewness, and kurtosis.
Real-world applications of the uniform distribution are wide-ranging. In transportation, a bus that arrives at random within a 20-minute window follows U(0, 20). In computing, pseudorandom number generators produce U(0, 1) values that seed simulations and cryptographic functions. In manufacturing and metrology, rounding errors in analog-to-digital conversion are well modeled by U(-0.5, 0.5). In Monte Carlo simulation, uniform draws are transformed into any desired distribution via the inverse-CDF method. In statistics education, the uniform distribution demonstrates core concepts such as CDF, PDF, and percentiles in the simplest possible setting before students tackle the normal or exponential distributions.
A common misconception is that "uniform" means all outcomes are equally probable in the discrete sense. For the continuous uniform distribution, individual point probabilities are zero. Only intervals have positive probability. This is why the PDF height 1/(b-a) is a density, not a direct probability. Another distinction worth noting: this calculator covers the continuous case. The discrete uniform distribution, where X takes only integer values from a to b, uses slightly different formulas, particularly for variance.
📐 Formulas
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 - Bus Arrival Time
A city bus arrives uniformly at random between 0 and 10 minutes. What is the probability of waiting between 2 and 5 minutes?
Example 2 - Standard Uniform U(0, 1)
A standard uniform random number U(0, 1) is generated. What is the probability it falls below 0.75? What are the mean and variance?
Example 3 - Manufacturing Measurement Error
A sensor reading has a uniform measurement error on [-0.5, 0.5] mm. Find the variance, SD, and probability the error exceeds 0.3 mm in magnitude.
❓ Frequently Asked Questions
🔗 Related Calculators
What is a uniform distribution and when is it used?
A continuous uniform distribution U(a, b) assigns equal probability density to every point in the interval [a, b]. It is used whenever outcomes are equally likely across a range, such as random number generation, arrival-time modeling, rounding errors in digital signals, and Monte Carlo simulation inputs.
What is the PDF formula for U(a, b)?
The probability density function is f(x) = 1 / (b - a) for a <= x <= b, and 0 elsewhere. Because the total area under f(x) must equal 1, the constant height 1/(b-a) stretches over the interval of length (b-a). For U(0, 10) the PDF height is 0.1; for U(0, 1) it is 1.
How do I calculate P(x1 <= X <= x2) for a uniform distribution?
P(x1 <= X <= x2) = (x2 - x1) / (b - a), provided both limits lie within [a, b]. If x1 or x2 fall outside the interval, clamp them to the nearest boundary first. For U(0, 10), P(3 <= X <= 7) = 4/10 = 40%.
What is the mean of U(a, b)?
The mean is (a + b) / 2, the midpoint of the interval. For U(2, 8) the mean is 5. For U(0, 1) the mean is 0.5. This is also equal to the median because the uniform distribution is perfectly symmetric.
What is the variance of a uniform distribution?
The variance is (b - a)^2 / 12. For U(0, 1) this is 1/12 ≈ 0.0833. For U(0, 10) it is 100/12 ≈ 8.333. The denominator 12 arises from integrating (x - mean)^2 times the constant PDF over [a, b].
What is the standard deviation of U(a, b)?
The standard deviation is (b - a) / sqrt(12), or equivalently (b - a) / (2 * sqrt(3)). For U(0, 10) the SD is 10 / sqrt(12) ≈ 2.887. For U(0, 1) the SD is approximately 0.2887.
What is the IQR of a uniform distribution?
The interquartile range (IQR) is (b - a) / 2. The 25th percentile is a + (b-a)/4 and the 75th percentile is a + 3(b-a)/4, so their difference is (b-a)/2. For U(0, 10) the IQR is 5.
What is the skewness of U(a, b)?
The skewness is exactly 0. The uniform distribution is perfectly symmetric about its mean (a+b)/2. There is no tail on either side, so neither left nor right skew applies.
What is the kurtosis of a uniform distribution?
The excess kurtosis is -6/5 = -1.2. Negative kurtosis means the distribution is platykurtic: flatter and lighter-tailed than a normal distribution. The uniform distribution is the extreme case of equal weighting across the entire support.
Is the uniform distribution discrete or continuous?
This calculator covers the continuous uniform distribution U(a, b), where X can take any real value in [a, b]. There is also a discrete uniform distribution, where X takes integer values from a to b with equal probability 1/(b-a+1). The formulas differ between the two.
How is the uniform distribution used in random number generation?
Most programming languages and statistical software generate pseudorandom numbers drawn from U(0, 1) as their base distribution. Any other distribution can then be derived via the inverse-CDF method: if U is U(0, 1), then F^(-1)(U) follows the target distribution F.
What is the CDF of U(a, b) and how does this calculator compute it?
The cumulative distribution function is F(x) = (x - a) / (b - a) for a <= x <= b, 0 for x < a, and 1 for x > b. This calculator uses F(x2) for P(X <= x2) and 1 - F(x1) for P(X >= x1). The between probability equals F(x2) - F(x1).