The discrete uniform distribution is also known as the "equally likely outcomes" distribution. Letting a set have elements, each of them having the same probability, then
(1)
| |||
(2)
| |||
(3)
| |||
(4)
|
so using gives
(5)
|
Restricting the set to the set of positive integers 1, 2, ..., , the probability distribution function and cumulative distributions function for this discrete uniform distribution are therefore
(6)
| |||
(7)
|
for , ..., .
The discrete uniform distribution is implemented in the Wolfram Language as DiscreteUniformDistribution[n].
Its moment-generating function is
(8)
| |||
(9)
| |||
(10)
| |||
(11)
|
The moments about 0 are
(12)
|
so
(13)
| |||
(14)
| |||
(15)
| |||
(16)
|
and the moments about the mean are
(17)
| |||
(18)
| |||
(19)
|
The mean, variance, skewness, and kurtosis excess are
(20)
| |||
(21)
| |||
(22)
| |||
(23)
|
The mean deviation for a uniform distribution on elements is given by
(24)
|
To do the sum, consider separately the cases of odd and even. For odd,
(25)
| |||
(26)
| |||
(27)
| |||
(28)
|
Similarly, for even,
(29)
| |||
(30)
| |||
(31)
| |||
(32)
|
The complete solution is therefore
(33)
|
For , 2, ..., the first few values are 0, 1/2, 2/3, 1, 6/5, 3/2, 12/7, ... (OEIS A086111 and A086112).