Uniform Distribution Calculator
Free uniform distribution calculator. Compute PDF, CDF, mean, variance, P(cā¤Xā¤d) for continuous and
Why This Statistical Analysis Matters
Why: Statistical calculator for analysis.
How: Enter inputs and compute results.
Uniform ā Continuous and Discrete: PDF, CDF, Mean, Variance
Equal probability for all outcomes. Fair die, random numbers, measurement error. P(cā¤Xā¤d), percentiles.
Real-World Scenarios ā Click to Load
Inputs
PDF with P(cā¤Xā¤d) Shaded
Calculation Breakdown
For educational and informational purposes only. Verify with a qualified professional.
Key Takeaways
- ⢠Continuous Uniform(a,b): PDF f(x)=1/(b-a) for aā¤xā¤b; CDF F(x)=(x-a)/(b-a); Mean=(a+b)/2, Variance=(b-a)²/12
- ⢠Discrete Uniform {a,...,b}: P(X=k)=1/(b-a+1); Mean=(a+b)/2, Variance=((b-a+1)²-1)/12
- ⢠P(cā¤Xā¤d) = (d-c)/(b-a) for continuous; (number of integers in [c,d])/(b-a+1) for discrete
- ⢠Percentile q: x_q = a + q(b-a) for continuous
- ⢠All outcomes equally likely ā maximum entropy distribution on a bounded interval
Did You Know?
How It Works
1. Continuous Uniform
PDF is constant on [a,b]; area under curve = 1. CDF increases linearly from 0 to 1.
2. Discrete Uniform
Each integer k in {a,...,b} has probability 1/(b-a+1). CDF is a step function.
3. Mean and Variance
Both types share mean (a+b)/2. Variance differs: continuous (b-a)²/12 vs discrete ((b-a+1)²-1)/12.
4. Probability in Interval
P(cā¤Xā¤d) = length of overlap / total length. For discrete, count integers in [c,d] ā© {a,...,b}.
5. Percentiles
q-th percentile: x_q = a + q(b-a) for continuous. For discrete, use the k-th smallest value where CDF first exceeds q.
Expert Tips
Prior of Ignorance
Use uniform as uninformative prior when you only know bounds. Beta(1,1) is uniform on [0,1].
Rounding
Rounding to nearest unit creates discrete uniform on the error: e ~ U(-0.5, 0.5).
Inverse Transform
To simulate U(a,b): generate U~U(0,1), then X = a + U(b-a).
Fairness
Uniform is the "fair" distribution ā no outcome is favored. Used to model fair coins, dice, lotteries.
Why Use This Calculator vs Other Tools?
| Feature | This Calculator | Excel | R | SciPy |
|---|---|---|---|---|
| Continuous + Discrete | ā | ā ļø UNIFORM only | ā ļø runif/dunif | ā |
| PDF + CDF + P(cā¤Xā¤d) | ā | ā ļø Multiple | ā ļø Multiple | ā |
| 7 real-world presets | ā | ā | ā | ā |
| Shaded probability chart | ā | ā | ā | ā ļø Manual |
| Percentile calculator | ā | ā ļø | ā | ā |
| Educational content | ā | ā | ā | ā |
Frequently Asked Questions
What is the difference between continuous and discrete uniform?
Continuous: X can take any value in [a,b]. Discrete: X takes only integers a, a+1, ..., b. A die is discrete; bus arrival time is often modeled continuous.
When should I use the uniform distribution?
When all outcomes in a range are equally likely: fair dice, random number generation, measurement error with known bounds, prior of ignorance in Bayesian analysis.
What is the variance of Uniform(a,b)?
Continuous: (b-a)²/12. Discrete on {a,...,b}: ((b-a+1)²-1)/12. The continuous formula is simpler.
How do I compute P(c ⤠X ⤠d)?
Continuous: (d-c)/(b-a) if [c,d] ā [a,b], else use the overlap. Discrete: count integers in [c,d] ā© {a,...,b} and divide by (b-a+1).
What is the 50th percentile (median)?
For both: (a+b)/2. The median equals the mean for the uniform distribution.
Can the uniform be used as a prior?
Yes. Uniform is the maximum entropy (least informative) prior when you only know the support. Common in Bayesian inference.
How do I simulate from Uniform(a,b)?
Generate U ~ Uniform(0,1) (e.g., Math.random()), then X = a + U*(b-a).
What is the relationship to the beta distribution?
Beta(1,1) is the uniform distribution on [0,1]. Uniform is a special case of the beta.
Uniform Distribution by the Numbers
Official Data Sources
Disclaimer: This calculator uses exact closed-form formulas for the uniform distribution. Results are mathematically exact. For discrete uniform, a and b are floored to integers. This tool is for educational and professional reference purposes.
Related Calculators
Lognormal Distribution Calculator
Calculate PDF, CDF, mean, mode, variance, and percentiles for the lognormal distribution. If ln(X) ~ N(μ, ϲ), then X is lognormal. Income, house prices...
StatisticsRayleigh Distribution Calculator
Calculate PDF, CDF, mean, mode, variance for the Rayleigh distribution. Models magnitude of 2D Gaussian vectors ā used in wireless communications, wind...
StatisticsExponential Distribution Calculator
Calculate PDF, CDF, mean, variance, and percentiles for the exponential distribution Exp(Ī»). Models time between events in a Poisson process. Memoryless...
StatisticsNegative Binomial Distribution Calculator
Number of trials to achieve r successes. Generalizes geometric (r=1). Calculate P(X=k), P(Xā¤k), P(aā¤Xā¤b) with PMF bar chart, CDF step chart, and normal...
StatisticsBeta Distribution Calculator
Calculate PDF, CDF, mean, mode, and variance for the Beta distribution. Bayesian priors, A/B testing, and project management.
StatisticsPoisson Distribution Calculator
Calculate P(X=k), P(Xā¤k), P(Xā„k), and P(aā¤Xā¤b) for the Poisson distribution with parameter Ī». Models count of events in a fixed interval.
Statistics