Calculator
Example Data Table
These examples show typical inputs and outputs you can reproduce.
| Uniform(a,b) | x | CDF | P(2≤X≤7) | Mean | |
|---|---|---|---|---|---|
| a=0, b=10 | 3 | 0.1 | 0.3 | 0.5 | 5 |
| Uniform{a..b} | x | PMF | CDF | P(2≤X≤5) | Mean |
|---|---|---|---|---|---|
| a=1, b=6 | 4 | 0.1667 | 0.6667 | 0.6667 | 3.5 |
Formula Used
Continuous Uniform(a, b) (a < b):
- PDF: f(x)=1/(b−a) for a≤x≤b, else 0
- CDF: 0 if x<a; (x−a)/(b−a) if inside; 1 if x>b
- Mean: μ=(a+b)/2
- Variance: σ²=(b−a)²/12, Std: σ=√σ²
- Quantile: Q(p)=a+p(b−a) for 0≤p≤1
Discrete Uniform{a, …, b} (integers, a ≤ b), with k=b−a+1:
- PMF: P(X=x)=1/k for integer x in range, else 0
- CDF: F(x)=(⌊x⌋−a+1)/k, clamped to [0,1]
- Mean: μ=(a+b)/2
- Variance: σ²=(k²−1)/12
- Quantile: smallest integer value with CDF ≥ p
How to Use This Calculator
- Choose continuous or discrete mode.
- Enter bounds a and b (with b greater or equal).
- Select outputs: stats, PDF/PMF, CDF, quantile, interval, sample.
- Fill needed inputs: x, p, x1/x2, and sample size n.
- Press Calculate; results appear above the form.
- Use the download buttons to export CSV or PDF.
FAQs
1) What is a uniform distribution?
It models outcomes where every value in a range is equally likely. Continuous uniform spreads probability evenly over an interval, while discrete uniform assigns equal probability to each integer in a set.
2) When should I use continuous vs discrete?
Use continuous for measurements like time or distance within bounds. Use discrete for integer outcomes like dice, random IDs, or selecting a whole-number value from a range.
3) Why must b be greater than a in continuous mode?
A continuous uniform needs a positive interval width. If b equals or is less than a, the interval has zero or negative length, so the PDF and CDF formulas no longer define a valid distribution.
4) What does PDF/PMF at x mean?
For continuous mode, the PDF is a density, not a direct probability. For discrete mode, the PMF gives the exact probability of that integer value occurring.
5) How is the interval probability computed?
Continuous mode uses the interval length inside [a,b] divided by (b−a). Discrete mode counts integers inside the interval and divides by the total count k = b−a+1.
6) What is the quantile and why is p between 0 and 1?
The quantile returns the value x such that the CDF reaches probability p. Since CDF values range from 0 to 1, p must also lie within that same range.
7) Are the random samples truly random?
They are pseudo-random values generated by the server. They are suitable for simulations and practice, but not recommended for cryptographic or security-sensitive uses.
8) Why might my PMF be zero in discrete mode?
The PMF is nonzero only for integers between a and b. If you enter a non-integer x, or an integer outside the bounds, the calculator returns 0 because that outcome cannot occur.