Discrete uniform distribution (from http://www.math.wm.edu/˜ leemis/chart/UDR/UDR.html ) The shorthand X ∼ discrete uniform(a,b) is used to indicate that the random variable X has the discrete uniform distribution with integer parameters a and b, where a < b. A discrete uniform random variable X with parameters a and b has probability mass function

f(x) = \frac{1}{b − a + 1} x = a, a + 1,...,b.

The probability mass function is illustrated below.

PSfrag replacements

a b x

f(x) \frac{1}{b−a+1}

··· ···

The cumulative distribution function is

F (x) = P(X ≤ x) = \frac{x − a + 1}{b − a + 1} x = a, a + 1,...,b.

The survivor function of X is

S(x) = P(X ≥ x) = \frac{b − x + 1}{b − a + 1} x = a, a + 1,...,b.

The hazard function of X is

h(x) = \frac{f(x)}{S(x)} = \frac{1}{b − x + 1} x = a, a + 1,...,b.

The inverse distribution function of X is

F^{−1} (u) = a + ⌊u(b − a + 1)⌋ 0 < u < 1.

The median, m, of X is

m = \frac{a + b}{2} .

The moment generating function of X is

M(t) = E [e^{tX}] = \frac{e^{at}− e^{(b+1)t}}{(b − a + 1)(1 − e^{t})} − ∞ < t < ∞.

The characteristic function of X is

ϕ(t) = E [e^{itX}] = \frac{e^{ait}− e^{(b+1)it}}{(b − a + 1)(1 − e^{it})} − ∞ < t < ∞.

The population mean, variance, skewness, and kurtosis of X are

E[X] = \frac{a + b}{2} V [X] = \frac{(b − a + 1)^{2}− 1}{12}

E [( \frac{X − μ}{σ} ) ^{3}] = 0 E [( \frac{X − μ}{σ} ) ^{4}] = \frac{6((b − a + 1)^{2}+ 1)}{5((b − a + 1)^{2}− 1)} .

APPL verification: The APPL statements

assume(b ¿ a); X:=[[x -¿ 1 / (b - a + 1)], [a .. b], [”Discrete”, ”PDF”]]; CDF(X); SF(X); HF(X); CHF(X); IDF(X); MGF(X); Mean(X); Variance(X); Skewness(X); Kurtosis(X);

verify the cumulative distribution, survivor function, hazard function, cumulative hazard function, inverse distribution function, moment generating function, population mean, variance, skewness, kurtosis.