Enter values to see results
—
—
—
—
—
—
—
Enter values to see results
—
—
—
—
—
—
—
The Uniform Distribution Calculator computes probability values and statistics for the continuous uniform distribution on the interval $$[a, b]$$. This distribution assigns equal probability to all values within the interval, making it one of the simplest and most commonly used distributions in probability theory and simulation.
A random variable $$X$$ follows a uniform distribution on $$[a, b]$$ if every value in the interval is equally likely. The probability density function is:
$$f(x; a, b) = \begin{cases} \frac{1}{b - a} & \text{if } a \leq x \leq b \\ 0 & \text{otherwise} \end{cases}$$
The cumulative distribution function is:
$$F(x; a, b) = \begin{cases} 0 & \text{if } x < a \\ \frac{x - a}{b - a} & \text{if } a \leq x \leq b \\ 1 & \text{if } x > b \end{cases}$$
The mean and median of the uniform distribution are both equal to the midpoint of the interval: $$E[X] = \frac{a + b}{2}$$. The variance is $$\text{Var}(X) = \frac{(b - a)^2}{12}$$, which depends only on the width of the interval. The distribution has zero skewness (perfectly symmetric) and a kurtosis of $$-\frac{6}{5}$$ (platykurtic, meaning lighter tails than a normal distribution).
Among all continuous distributions supported on a finite interval $$[a, b]$$, the uniform distribution has the maximum entropy $$H = \ln(b - a)$$. This makes it the distribution that encodes the least information beyond knowing the range, which is why it is used as a non-informative prior in Bayesian statistics.
The uniform distribution is widely used in random number generation, Monte Carlo simulation, and as a building block for generating other distributions via inverse transform sampling. It models scenarios where outcomes are equally likely within a known range, such as rounding errors, random arrival times within a fixed window, or selecting a random point on a line segment.
Enter the minimum $$a$$, maximum $$b$$ (where $$b > a$$), and a value $$x$$. The calculator computes the PDF, CDF, mean, variance, standard deviation, median, and differential entropy of the distribution.
The calculator evaluates the uniform PDF as $$1/(b-a)$$ when $$x$$ falls within $$[a, b]$$, and 0 otherwise. The CDF is computed as $$(x - a)/(b - a)$$, clamped to the range $$[0, 1]$$. All statistical measures are derived from the standard formulas for the continuous uniform distribution.
The constant PDF value indicates that all points in $$[a, b]$$ are equally likely. The CDF increases linearly from 0 at $$x = a$$ to 1 at $$x = b$$. If $$x$$ is outside the interval, the PDF is 0 and the CDF is either 0 (below $$a$$) or 1 (above $$b$$). A wider interval produces a smaller PDF value since the total probability of 1 is spread over a larger range.
Inputs
Results
For U(0, 10), the PDF is constant at 0.1 throughout the interval. At x = 5 (the midpoint), the CDF is 0.5, confirming the median equals the mean.
Inputs
Results
For U(2, 8) with range 6, the PDF is 1/6 ≈ 0.167. At x = 6, the CDF is (6−2)/(8−2) = 2/3 ≈ 0.667, meaning 66.7% of the distribution lies below x = 6.
A uniform distribution assigns equal probability to all outcomes in its support. For the continuous uniform distribution on $$[a, b]$$, this means the PDF is constant: $$f(x) = 1/(b-a)$$ for all $$x$$ in the interval.
The discrete uniform distribution assigns equal probability to a finite set of distinct values (e.g., rolling a fair die), while the continuous uniform distribution assigns equal probability density to all points in a continuous interval $$[a, b]$$.
Most random number generators produce uniform random numbers on $$[0, 1]$$. Through inverse transform sampling, these uniform values can be converted to any other distribution, making the uniform distribution the foundation of Monte Carlo simulation.
For a uniform distribution on $$[a, b]$$, the probability $$P(x_1 \leq X \leq x_2) = \frac{x_2 - x_1}{b - a}$$ when both $$x_1$$ and $$x_2$$ are within $$[a, b]$$. Simply compute the CDF difference: $$F(x_2) - F(x_1)$$.
If $$a = b$$, the distribution is degenerate (a single point with probability 1). The PDF becomes a Dirac delta function and the variance is zero. This calculator returns NaN for invalid inputs where $$b \leq a$$.
The differential entropy is $$H = \ln(b - a)$$. Among all continuous distributions on $$[a, b]$$, the uniform distribution has the maximum entropy, making it the "most uncertain" distribution given only the range constraint.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!
Exponential Distribution Calculator
Probability Distributions
Geometric Distribution Calculator
Probability Distributions
Hypergeometric Distribution Calculator
Probability Distributions
Negative Binomial Distribution Calculator
Probability Distributions
Gamma Distribution Calculator
Probability Distributions
Weibull Distribution Calculator
Probability Distributions