Inputs
Formulas
For a discrete uniform distribution on the integers \( \{a, a+1, \dots, b\} \) with support size \( n = b-a+1 \):
- Mean: \( \displaystyle \mu = \frac{a+b}{2} \)
- Variance: \( \displaystyle \sigma^2 = \frac{n^2 - 1}{12} \)
- Standard deviation: \( \displaystyle \sigma = \sqrt{\frac{n^2 - 1}{12}} \)
- Raw moment of order \(k\): \( \displaystyle \mathbb{E}[X^k] = \frac{1}{n}\sum_{x=a}^{b} x^k \)
- MGF: \( \displaystyle M_X(t) = \begin{cases} \dfrac{e^{ta}\big(1 - e^{tn}\big)}{n \big(1 - e^{t}\big)}, & t \neq 0 \\[6pt] 1, & t = 0 \end{cases} \)
Results
Enter valid inputs and click Calculate to see results here.
Quality checks
- When \( a=b \), the variance should be 0 and the mean equals \( a \).
- For symmetric intervals (e.g., \(-m\) to \(m\)), the mean should be 0.
- The MGF at \( t=0 \) equals 1.
FAQs
expm1
avoids catastrophic cancellation and yields stable results close to \(t=0\).