Bernoulli distribution (from http://www.math.wm.edu/˜ leemis/chart/UDR/UDR.html ) The shorthand X ∼ Bernoulli(p) is used to indicate that the random variable X has the Bernoulli distribution with parameter p, where 0 < p < 1. A Bernoulli random variable X with success probability p has probability mass function

f(x) = p^{x}(1 − p)^{1−x} x = 0,1

for 0 < p < 1. The Bernoulli distribution is associated with the notion of a Bernoulli trial, which is an experiment with two outcomes, generically referred to as success (x = 1) and failure (x = 0). The cumulative distribution function of X ∼ Bernoulli(p) is

F (x) = P(X ≤ x) = \{ \begin{matrix}0 & x < 0 \\ 1 − p & 0 ≤ x < 1 \\ 1 & x ≥ 1. \end{matrix}

The survivor function of X is

S(x) = P(X ≥ x) = \{ \begin{matrix}1 & x ≤ 0 \\ p & 0 < x ≤ 1 \\ 0 & x > 1. \end{matrix}

The hazard function of X on the support is

h(x) = \frac{f(x)}{S(x)} = \{ \begin{matrix}1 − p & x = 0 \\ 1 & x = 1. \end{matrix}

The cumulative hazard function of X on x ≤ 1 is

H(x) = −lnS(x) = \{ \begin{matrix}0 & x ≤ 0 \\ −lnp & 0 < x ≤ 1. \end{matrix}

The inverse distribution function of X is

F^{−1} (u) = \{ \begin{matrix}0 & 0 < u < 1 − p \\ 1 & 1 − p ≤ u < 1. \end{matrix}

The median of X is 0 if 0 < p ≤ 1/2 and 1 if 1/2 < p < 1. The mode of X, denoted by m, is

m = \{ \begin{matrix}0 & 0 < p < 1/2 \\ 1 & 1/2 < p < 1. \end{matrix}

The moment generating function of X is

M(t) = E [e^{tX}] = (1 − p) + pe^{t} − ∞ < t < ∞.

The characteristic function of X is

ϕ(t) = E [e^{itX}] = (1 − p) + pe^{it} − ∞ < t < ∞.

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

E[X] = p V [X] = p(1 − p)

E [( \frac{X − μ}{σ} ) ^{3}] = \frac{1 − 2p}{\sqrt{p(1 − p)}} E [( \frac{X − μ}{σ} ) ^{4}] = \frac{3p^{2}− 3p + 1}{p(1 − p)} .

APPL verification: The APPL statements

X := BernoulliRV(p); CDF(X); SF(X); HF(X); CHF(X); IDF(X); Mean(X); Variance(X); Skewness(X); Kurtosis(X); MGF(X);

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