TOPICS
Search

Discrete Uniform Distribution


The discrete uniform distribution is also known as the "equally likely outcomes" distribution. Letting a set S have N elements, each of them having the same probability, then

P(S)=P( union _(i=1)^NE_i)
(1)
=sum_(i=1)^(N)P(E_i)
(2)
=P(E_i)sum_(i=1)^(N)1
(3)
=NP(E_i),
(4)

so using P(S)=1 gives

 P(E_i)=1/N.
(5)

Restricting the set S to the set of positive integers 1, 2, ..., N, the probability distribution function and cumulative distributions function for this discrete uniform distribution are therefore

P(n)=1/N
(6)
D(n)=n/N
(7)

for n=1, ..., N.

The discrete uniform distribution is implemented in the Wolfram Language as DiscreteUniformDistribution[n].

Its moment-generating function is

M(t)=<e^(nt)>
(8)
=sum_(n=1)^(N)1/Ne^(nt)
(9)
=1/N(e^t-e^(t(N+1)))/(1-e^t)
(10)
=(e^t(1-e^(Nt)))/(N(1-e^t)).
(11)

The moments about 0 are

 mu_m^'=1/Nsum_(n=1)^Nn^m,
(12)

so

mu_1^'=1/2(N+1)
(13)
mu_2^'=1/6(N+1)(2N+1)
(14)
mu_3^'=1/4N(N+1)^2
(15)
mu_4^'=1/(30)(N+1)(2N+1)(3N^2+3N-1),
(16)

and the moments about the mean are

mu_2=1/(12)(N-1)(N+1)
(17)
mu_3=0
(18)
mu_4=1/(240)(N-1)(N+1)(3N^2-7).
(19)

The mean, variance, skewness, and kurtosis excess are

mu=1/2(N+1)
(20)
sigma^2=1/(12)(N-1)(N+1)
(21)
gamma_1=0
(22)
gamma_2=-(6(N^2+1))/(5(N-1)(N+1)).
(23)
UniformDistributionMeanDeviation

The mean deviation for a uniform distribution on N elements is given by

 MD=1/Nsum_(k=1)|k-1/2(N+1)|.
(24)

To do the sum, consider separately the cases of N odd and N even. For N=2m-1 odd,

MD=1/Nsum_(k=1)^(N)|k-m|
(25)
=1/N[sum_(k=1)^(m-1)m-k+sum_(k=m+1)^(N)k-m]
(26)
=(2m^2-2m(N+1)+N^2+N)/(2N)
(27)
=(N^2-1)/(4N).
(28)

Similarly, for N=2m even,

MD=1/Nsum_(k=1)^(N)|k-(m+1/2)|
(29)
=1/N[sum_(k=1)^(m)(m+1/2)-k+sum_(k=m+1)^(N)k-(m+1/2)]
(30)
=N/2+(m^2)/N-m
(31)
=1/4N.
(32)

The complete solution is therefore

 MD={(N^2-1)/(4N)   for N odd; 1/4N   for N even.
(33)

For N=1, 2, ..., the first few values are 0, 1/2, 2/3, 1, 6/5, 3/2, 12/7, ... (OEIS A086111 and A086112).


See also

Discrete Distribution, Uniform Distribution

Explore with Wolfram|Alpha

References

Sloane, N. J. A. Sequences A086111 and A086112 in "The On-Line Encyclopedia of Integer Sequences."

Referenced on Wolfram|Alpha

Discrete Uniform Distribution

Cite this as:

Weisstein, Eric W. "Discrete Uniform Distribution." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/DiscreteUniformDistribution.html

Subject classifications