PLAYGROUND

Discrete distribution

Bernoulli distribution

What it describes

Bernoulli is the model for one trial with two outcomes: success or failure. Coding the result as 1 or 0 leaves the distribution determined by p, the success probability.

Its support is {0,1}. Mean is p and variance is p × [1-p], but the meaning of 1 depends on the event definition.

History and names

Jakob Bernoulli studied binary trials and the law of large numbers in Ars Conjectandi, published posthumously in 1713. The name honours two outcomes rather than one application.

How it connects to other distributions

A sum of independent Bernoulli trials with common p is Binomial. Geometric counts trials to the first success; Negative Binomial extends waiting to several successes.

Where it appears

  • binary responses, quality checks, and presence/absence events
  • classification models and indicator variables in regression

Fitting cautions

Do not confuse p with an observed percentage from one sample: the count is evidence about p, not identical to it.

The small mechanism behind larger models

A single Bernoulli observation looks modest, yet it is a statistical building block. Summing trials produces the Binomial distribution. Allowing the success probability to change with observed features leads to logistic regression. A sequence of indicators can also turn complex questions into counts: each indicator may record whether a machine failed, rain fell, or a person responded.

Coding deserves attention. Swapping zero and one replaces p with 1-p; the evidence is unchanged, but the parameter meaning and the sign of some effects change. A Bernoulli variable should not be confused with a measured probability either. The former takes only two values, while an uncertain probability lies on an interval and is often represented by a Beta distribution.

References

  • Johnson, N. L., Kemp, A. W. & Kotz, S. (2005). Univariate Discrete Distributions, 3rd ed. Wiley.
  • Bernoulli, J. (1713). Ars Conjectandi. Thurneysen.
  • Feller, W. (1968). An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. Wiley.

Bernoulli Distribution: equations and calculator

Distribution defintion

XBernoulli(p)X\sim\mathrm{Bernoulli}\left(p\right)

Distribution domain

x{0,1}x\in\left\{0,1\right\}

Parameters domain and parameters constraints

p(0,1)Rp\in\left(0,1\right)\subseteq\mathbb{R}

Cumulative distribution function

FX(x)={1pif  x=01if  x=1F_{X}\left(x\right)=\left\{\begin{array}{cl} 1-p & \text{if } \ x=0 \\ 1 & \text{if } \ x=1 \end{array} \right.\\

Probability mass function

fX(x)=px(1p)1xf_{X}\left(x\right)=p^x(1-p)^{1-x}

Percent point function/Sample

FX1(u)={1if  up0if  u>pF^{-1}_{X}\left(u\right)=\left\{\begin{array}{cl} 1 & \text{if } \ u \leq p \\ 0 & \text{if } \ u > p \end{array} \right.\\

Parametric centered moments

E[Xk]=μk=x=01xkfX(x)=pE[X^k]=\mu'_{k}=\sum_{x=0}^{1}x^{k}f_{X}\left(x\right)=p

Parametric mean

Mean(X)=μ1=p\mathrm{Mean}(X)=\mu'_{1}=p

Parametric variance

Variance(X)=(μ2μ12)=p(1p)\mathrm{Variance}(X)=(\mu'_{2}-\mu'^{2}_{1})=p(1-p)

Parametric skewness

Skewness(X)=μ33μ2μ1+2μ13(μ2μ12)1.5=12pp(1p)\mathrm{Skewness}(X)=\frac{\mu'_{3}-3\mu'_{2}\mu'_{1}+2\mu'^{3}_{1}}{(\mu'_{2}-\mu'^{2}_{1})^{1.5}}=\frac{1-2p}{\sqrt{p(1-p)}}

Parametric kurtosis

Kurtosis(X)=μ44μ1μ3+6μ12μ23μ14(μ2μ12)2=3+16p(1p)p(1p)\mathrm{Kurtosis}(X)=\frac{\mu'_{4}-4\mu'_{1}\mu'_{3}+6\mu'^{2}_{1}\mu'_{2}-3\mu'^{4}_{1}}{(\mu'_{2}-\mu'^{2}_{1})^{2}}=3+\frac{1 - 6p(1-p)}{p(1-p)}

Parametric median

Median(X)={0if p<1/2[0,1]if p=1/21if p>1/2\mathrm{Median}(X)=\left\{\begin{array}{cl} 0 & \text{if } p < 1/2 \\ \left[0, 1\right] & \text{if } p = 1/2\\ 1 & \text{if } p > 1/2 \end{array} \right.\\

Parametric mode

Mode(X)={0if  p<1/20,1if  p=1/21if  p>1/2\mathrm{Mode}(X)=\left\{\begin{array}{cl} 0 & \text{if } \ p < 1/2 \\ 0, 1 & \text{if } \ p = 1/2\\ 1 & \text{if } \ p > 1/2 \end{array} \right.\\

Additional information and definitions

u:Uniform[0,1] random varibleu:\text{Uniform[0,1] random varible}