The discrete uniform distribution
Every whole number from a to b is equally likely, so each has probability 1/(b − a + 1). Move the ends a and b, then ask a question: the bars it counts are shaded.
Parameters
Ask a question
Compare with
P(X ≥ 5) = 0.3333
P(X ≥ 5) = 1 − F(4) = 1 − 0.6667 = 0.3333
Summary
| Measure | U{1, …, 6} |
|---|---|
| mean | 3.5000 |
| variance | 2.9167 |
| standard deviation | 1.7078 |
| skewness | 0.0000 |
The same in code
- Python (scipy.stats)
randint.sf(4, 1, 7)- Excel
=1-(4-1+1)/6
Formulas
Try this
Fewer than, or at most?
Switch the question between P(X < 96) and P(X ≤ 96) for the bookseller.
Look for: The answers differ by one bar, P(X = 96) = 1/11. For a count the boundary value itself carries probability, so read "fewer than" and "at most" carefully.
Widen the range
Keep a at 1 and move b from 6 up to 20.
Look for: Every bar gets shorter: the same total probability of 1 is shared among more values. The mean moves to (a + b)/2 and the ±1σ band widens.
No skew
Move a and b anywhere and watch the skewness.
Look for: It stays at 0. The bars are symmetric about the mean, which sits halfway between a and b even when that is not a possible value, as 3.5 is for a die.
Bars and a flat density
Turn on the comparison with the continuous uniform.
Look for: The flat density lies exactly on top of the bars. Spread each bar over a width of 1 and the discrete uniform becomes the continuous one from a − ½ to b + ½.