Uniform distribution (discrete)

Parameters Probability mass functionDiscrete uniform probability mass function for n=5n=5 where n=b-a+1 Cumulative distribution functionDiscrete uniform cumulative density function for n=5 ${\displaystyle a\in (\dots ,-2,-1,0,1,2,\dots )\,}$${\displaystyle b\in (\dots ,-2,-1,0,1,2,\dots )\,}$${\displaystyle n=b-a+1\,}$ ${\displaystyle k\in \{a,a+1,\dots ,b-1,b\}\,}$ ${\displaystyle {\begin{matrix}{\frac {1}{n}}&{\mbox{for }}a\leq k\leq b\ \\0&{\mbox{otherwise }}\end{matrix}}}$ ${\displaystyle {\begin{matrix}0&{\mbox{for }}kb\end{matrix}}}$ ${\displaystyle {\frac {a+b}{2}}\,}$ ${\displaystyle {\frac {a+b}{2}}\,}$ N/A ${\displaystyle {\frac {n^{2}-1}{12}}\,}$ ${\displaystyle 0\,}$ ${\displaystyle -{\frac {6(n^{2}+1)}{5(n^{2}-1)}}\,}$ ${\displaystyle \ln(n)\,}$ ${\displaystyle {\frac {e^{at}-e^{(b+1)t}}{n(1-e^{t})}}\,}$ ${\displaystyle {\frac {e^{iat}-e^{i(b+1)t}}{n(1-e^{it})}}}$

In probability theory and statistics, the discrete uniform distribution is a discrete probability distribution that can be characterized by saying that all values of a finite set of possible values are equally probable.

If a random variable has any of ${\displaystyle n}$ possible values ${\displaystyle k_{1},k_{2},\dots ,k_{n}}$ that are equally probable, then it has a discrete uniform distribution. The probability of any outcome ${\displaystyle k_{i}}$  is ${\displaystyle 1/n}$. A simple example of the discrete uniform distribution is throwing a fair dice. The possible values of ${\displaystyle k}$ are 1, 2, 3, 4, 5, 6; and each time the dice is thrown, the probability of a given score is 1/6.

In case the values of a random variable with a discrete uniform distribution are real, it is possible to express the cumulative distribution function in terms of the degenerate distribution; thus

${\displaystyle F(k;a,b,n)={1 \over n}\sum _{i=1}^{n}H(k-k_{i})}$

where the Heaviside step function ${\displaystyle H(x-x_{0})}$ is the CDF of the degenerate distribution centered at ${\displaystyle x_{0}}$. This assumes that consistent conventions are used at the transition points.

See rencontres numbers for an account of the probability distribution of the number of fixed points of a uniformly distributed random permutation.