Calculator
Choose a calculation mode, enter the support values, and submit to see the result above this form.
Example data table
This sample uses X ~ U(2, 10). Inside the support, the density stays constant at 0.125.
| x | PDF f(x) | CDF F(x) | Inside support? |
|---|---|---|---|
| 2 | 0.125 | 0 | Yes |
| 4 | 0.125 | 0.25 | Yes |
| 6 | 0.125 | 0.5 | Yes |
| 8 | 0.125 | 0.75 | Yes |
| 10 | 0.125 | 1 | Yes |
| 12 | 0 | 1 | No |
Formula used
X ~ U(a, b), where a < b
f(x) = 1 / (b - a), for a ≤ x ≤ b
f(x) = 0, otherwise
F(x) = 0, for x < a
F(x) = (x - a) / (b - a), for a ≤ x ≤ b
F(x) = 1, for x > b
P(x1 ≤ X ≤ x2) = max(0, min(x2, b) - max(x1, a)) / (b - a)
P(X < x1 or X > x2) = 1 - P(x1 ≤ X ≤ x2)
Q(p) = a + p(b - a), where 0 ≤ p ≤ 1
Mean = (a + b) / 2
Variance = (b - a)2 / 12
Standard deviation = √Variance
How to use this calculator
- Enter the lower bound a and upper bound b for the uniform support.
- Select the required task: density, cumulative, interval, outside, or quantile.
- Fill only the fields used by that mode. Use x for point values, x1 and x2 for intervals, or p for quantiles.
- Choose the decimal precision to control displayed rounding.
- Press Submit to show the result above the form, review the tables, and inspect the Plotly graph.
- Use the CSV and PDF buttons to export the result summary and documentation.
FAQs
1) What does a uniform distribution mean?
It means every value inside the interval is equally likely over equal-length segments. The density stays constant between a and b.
2) Can the lower bound equal the upper bound?
No. A valid continuous uniform model needs b greater than a, otherwise the interval has zero width and the density is undefined.
3) Why is P(X = x) equal to zero?
Continuous models assign probability to areas over intervals, not single points. One exact value has no width, so its probability is zero.
4) When does interval probability become zero?
It becomes zero when the chosen interval does not overlap the support at all, or when the interval length inside support is zero.
5) What does the quantile result show?
It returns the x-value reached by a chosen cumulative probability p. For example, p = 0.75 gives the seventy-fifth percentile.
6) Why are PDF and CDF different?
The PDF shows density height, while the CDF shows accumulated probability from the left boundary up to x. They answer different questions.
7) Can the support include negative numbers?
Yes. Any real interval works as long as the upper bound remains greater than the lower bound.
8) Is this calculator for continuous or discrete data?
This page is for the continuous uniform distribution. It is not intended for discrete equally likely outcomes such as fair die rolls.