Rectangular distribution (from http://www.math.wm.edu/˜ leemis/chart/UDR/UDR.html ) The shorthand X ∼ rectangular(n) is used to indicate that the random variable X has the rectangular distribution with positive parameter n. A rectangular random variable X for some positive integer n has probability mass function

f(x) = \frac{1}{n + 1} x = 0, 1, 2,..., n.

The probability mass function with n = 5 is illustrated below.

PSfrag replacements

x
f(x)
1/6

The cumulative distribution function on the support of X is

F (x) = \frac{x + 1}{n + 1} x = 0, 1, 2,..., n.

The survivor function on the support of X is

S(x) = P(X ≥ x) = \frac{n + 1 − x}{n + 1} x = 0, 1, 2,..., n.

The hazard function on the support of X is

h(x) = \frac{f(x)}{S(x)} = \frac{1}{n + 1 − x} x = 0, 1, 2,..., n.

The cumulative hazard function on the support of X is

H(x) = −lnS(x) = −ln( \frac{n + 1 − x}{n + 1} ) x = 0, 1, 2,..., n.

The inverse distribution function of X is

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

The median of X is

\frac{n − 1}{2} ,

when n is even.

The moment generating function of X is

M(t) = E [e^{tx}] = \{ \begin{matrix}1 & t = 0 \\ \frac{e^{t(n+1)}−1}{(e^{t}−1) (n+1)} & t ≠ 0. \end{matrix}

The characteristic function of X is

ϕ(t) = E [e^{itx}] = \{ \begin{matrix}1 & t = 0 \\ \frac{e^{it(n+1)}−1}{(e^{it}−1) (n+1)} & t ≠ 0. \end{matrix}

The population mean and variance of X are

E[X] = \frac{n}{2} V [X] = \frac{n(n + 2)}{12} .

The skewness and kurtosis of X are

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

APPL verification: The APPL statements

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

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