What is the continuous uniform distribution?
The continuous uniform distribution U(a, b) describes a random variable that is equally likely to take any value across an interval from a to b. Because the probability is spread evenly, its probability density is a flat constant over the support and zero everywhere else. This calculator is pure mathematics and applies identically everywhere — there is no regional or jurisdictional content.
How to use this calculator
Enter the evaluation point x, the lower boundary a, and the upper boundary b (with a ≤ b). The tool returns three values: the probability density \(f(x)\), the lower cumulative probability \(P(X \le x)\), and the upper (complementary) cumulative probability \(P(X > x) = Q\). The two cumulative probabilities always sum to 1.
The formula explained
Let the width be \(w = b - a\). Inside the interval the density is constant: \(f(x) = 1/w\) for \(a \le x \le b\), and \(f(x) = 0\) outside. The cumulative distribution grows linearly:
$$f(x) = \begin{cases} \dfrac{1}{b - a} & a \le x \le b \\[0.6em] 0 & \text{otherwise} \end{cases}$$$$F(x) = \begin{cases} 0 & x < a \\[0.6em] \dfrac{x - a}{b - a} & a \le x \le b \\[0.6em] 1 & x > b \end{cases}$$ for \(a \le x \le b\), equals 0 below a, and equals 1 above b. The upper tail is simply $$P(X > x) = 1 - \dfrac{x - a}{b - a}.$$ The width must be positive (\(b > a\)); when \(a = b\) the density is undefined because of division by zero, and the distribution degenerates to a single point.
Worked example
Take \(x = 2\), \(a = 1\), \(b = 4\). The width is \(w = 4 - 1 = 3\). Since \(1 \le 2 \le 4\), x is inside the support. The density is \(f(2) = 1/3 \approx 0.3333\). The lower cumulative probability is \(F(2) = (2 - 1)/3 = 1/3 \approx 0.3333\), and the upper is \(Q(2) = (4 - 2)/3 = 2/3 \approx 0.6667\). As a check, \(F + Q = 1/3 + 2/3 = 1\).
FAQ
What happens when x is outside [a, b]? The density is exactly 0. If \(x < a\) then \(F(x) = 0\) and \(Q(x) = 1\); if \(x > b\) then \(F(x) = 1\) and \(Q(x) = 0\).
Why must b be greater than a? The density is \(1/(b - a)\). If \(a = b\) the denominator is zero, so the continuous density is undefined; that case is a degenerate point mass rather than a continuous distribution.
Is the result a percentage? No. All outputs are dimensionless. The cumulative probabilities lie between 0 and 1; multiply by 100 if you want a percentage.