Home

Uniform Distribution

Uniform distribution calculator. Enter [a,b] and [x₁,x₂] to compute interval probability, mean and variance, with density.

展开更多 ▾
P(x₁
b>a

📖 Tutorial | Uniform Distribution

1. Definition
Uniform U(a,b) assigns constant density f(x)=1/(b−a) over [a,b]; a sub-interval probability is proportional to its length.
2. Symbols
SymbolMeaning
[a,b]support interval
x₁,x₂sub-interval endpoints
(x₂−x₁)/(b−a)sub-interval probability
E(X)=(a+b)/2midpoint
3. How it works
  • Probability = sub-length / total length;
  • Mean is the midpoint (a+b)/2;
  • Variance (b−a)²/12;
  • Parts outside [a,b] are clipped.
4. Steps
  1. Enter a, b, e.g. 0, 10;
  2. Enter x₁, x₂, e.g. 3, 7;
  3. Click Calculate for the probability;
  4. Read the mean and variance.
5. Example
Example: [0,10], find P(3
6. Pitfalls
Require b>a;
Sub-intervals beyond [a,b] are clipped;
The mean is the midpoint, not the raw endpoints.

❓ FAQ | Uniform Distribution

Why is probability a length ratio?
The density is constant 1/(b−a); integrating the sub-interval gives the ratio.
Why is the mean the midpoint?
A symmetric distribution has its mean at the center.
What if x₁,x₂ go outside [a,b]?
They are clipped to [a,b], so no negative probability.
What if b=a?
The interval collapses; require b>a.
Where is it used?
Random number generation, rounding error, equal-likelihood sampling.