# Bernoulli distribution

{{ safesubst:#invoke:Unsubst||$N=Refimprove |date=__DATE__ |$B= {{#invoke:Message box|ambox}} }} Template:Probability distribution

In probability theory and statistics, the Bernoulli distribution, named after Swiss scientist Jacob Bernoulli, is the probability distribution of a random variable which takes value 1 with success probability ${\displaystyle p}$ and value 0 with failure probability ${\displaystyle q=1-p}$. It can be used, for example, to represent the toss of a coin, where "1" is defined to mean "heads" and "0" is defined to mean "tails" (or vice versa).

## Properties

If ${\displaystyle X}$ is a random variable with this distribution, we have:

${\displaystyle Pr(X=1)=1-Pr(X=0)=1-q=p.\!}$

A classical example of a Bernoulli experiment is a single toss of a coin. The coin might come up heads with probability ${\displaystyle p}$ and tails with probability ${\displaystyle 1-p}$. The experiment is called fair if ${\displaystyle p=0.5}$, indicating the origin of the terminology in betting (the bet is fair if both possible outcomes have the same probability).

The probability mass function ${\displaystyle f}$ of this distribution is

${\displaystyle f(k;p)={\begin{cases}p&{\text{if }}k=1,\\[6pt]1-p&{\text{if }}k=0.\end{cases}}}$

This can also be expressed as

${\displaystyle f(k;p)=p^{k}(1-p)^{1-k}\!\quad {\text{for }}k\in \{0,1\}.}$

The expected value of a Bernoulli random variable ${\displaystyle X}$ is ${\displaystyle E\left(X\right)=p}$, and its variance is

${\displaystyle {\textrm {Var}}\left(X\right)=p\left(1-p\right).}$

Bernoulli distribution is a special case of the Binomial distribution with ${\displaystyle n=1}$.[1]

The kurtosis goes to infinity for high and low values of ${\displaystyle p}$, but for ${\displaystyle p=1/2}$ the Bernoulli distribution has a lower excess kurtosis than any other probability distribution, namely −2.

The Bernoulli distributions for ${\displaystyle 0\leq p\leq 1}$ form an exponential family.

The maximum likelihood estimator of ${\displaystyle p}$ based on a random sample is the sample mean.

## Related distributions

${\displaystyle Y=\sum _{k=1}^{n}X_{k}\sim \mathrm {B} (n,p)}$ (binomial distribution).

The Bernoulli distribution is simply ${\displaystyle \mathrm {B} (1,p)}$.