Factsheet: Discrete uniform distribution
Where to use: The discrete uniform distribution is used when all integer outcomes \(x\) in the interval \(a\) to \(b\) are equally likely. \(X\) is a random variable for integer outcomes \(x\) where for \(a \leq x \leq b\), and the probability of each outcome \(1/n\), where \(n = b - a + 1\).
Notation: \(X \sim \textrm{Uniform}(a,b)\) or \(X \sim U(a,b)\)
Parameters: The numbers \(a,b\) are integers where
- \(a\) is the minimum value of an outcome
- \(b\) is the maximum value of an outcome
There are \(n\) outcomes in total, with \(n = b - a + 1\).
| Quantity | Value | Notes |
|---|---|---|
| Mean | \(\mathbb{E}(X) = \dfrac{a+b}{2}.\) | |
| Variance | \(\mathbb{V}(X) = \dfrac{n^2-1}{12}.\) | |
| PMF | \(\mathbb{P}(X=x)=\frac{1}{n}\) | |
| CDF | \(\mathbb{P}(X\leq x)= \begin{cases} 0 & \textsf{if } x \leq a \\\dfrac{\lfloor x \rfloor - a + 1}{n} & \textsf{if } a< x<b \\1 & \textsf{if } x \geq b \end{cases}\) | \(\lfloor x \rfloor\) is the floor function |
Example: You roll a fair six-sided die, where all outcomes (\(1, 2, 3, 4, 5,\) and \(6\)) are equally likely. This can be expressed as \(X \sim U(1,6)\). It means \(1\) is the minimum value and \(6\) is the maximum value, where all discrete values of \(X\) for \(1 \leq x \leq 6\) are equally likely.
Further reading
This interactive element appears in Overview: Probability distributions.
Version history
v1.0: initial version created 08/25 by tdhc.
- v1.1: deprecated shinylive apps replaced 09/26 by tdhc.