# Bernoulli distribution

Probability function of the Bernoulli distribution for (blue), (green) and (red)${\ displaystyle p = 0.2}$${\ displaystyle p = 0.5}$${\ displaystyle p = 0.8}$

Random variables with a Bernoulli distribution (also referred to as zero-one distribution , alternative distribution or Boole distribution ) are used to describe random events for which there are only two possible test outcomes. One of the test results is usually referred to as success and the complementary test result as failure . The associated probability of success is called the probability of success and the probability of failure. Examples: ${\ displaystyle p}$${\ displaystyle q = 1-p}$

• Flipping a coin : head (success) , and number (failure) .${\ displaystyle p = 1/2}$${\ displaystyle q = 1/2}$
• Throwing a die, only a “6” counting as a success: , .${\ displaystyle p = 1/6}$${\ displaystyle q = 5/6}$
• Quality inspection (perfect, not perfect).
• System check (works, doesn't work).
• Consider a very small space / time interval: event occurs , does not occur .${\ displaystyle (p \ gtrapprox 0)}$${\ displaystyle (q \ lessapprox 1)}$

The term Bernoulli trial ( Bernoullian trials after Jakob I Bernoulli ) was first used in 1937 in the book Introduction to Mathematical Probability by James Victor Uspensky .

## definition

A discrete random variable with values ​​in the set is subject to the zero-one distribution or Bernoulli distribution with the parameter if it follows the following probability function${\ displaystyle X}$${\ displaystyle \ {0.1 \}}$${\ displaystyle p \ in [0,1]}$

${\ displaystyle f (x \ mid p) = {\ begin {cases} p ^ {x} (1-p) ^ {1-x} & {\ text {if}} \ quad x = 0.1 \\ 0 & {\ text {other}} \ end {cases}}}$.

The distribution function is then

${\ displaystyle F_ {X} (x) = {\ begin {cases} 0 & {\ text {if}} \ quad x <0 \\ 1-p & {\ text {if}} \ quad 0 \ leq x <1 \\ 1 & {\ text {falls}} \ quad x \ geq 1 \ end {cases}}}$.

Then you write or . ${\ displaystyle X \ sim {\ mathcal {B}} (p)}$${\ displaystyle X \ sim Ber_ {p}}$

A series of independent, identical experiments, in which each individual experiment satisfies the Bernoulli distribution, is called the Bernoulli process or Bernoulli experiment scheme.

## properties

### Expected value

The Bernoulli distribution with parameters has the expected value : ${\ displaystyle p}$

${\ displaystyle \ operatorname {E} \ left (X \ right) = p}$

The reason for this is that for a Bernoulli-distributed random variable with and the following applies: ${\ displaystyle X}$${\ displaystyle P (X = 1) = p}$${\ displaystyle P (X = 0) = q}$

${\ displaystyle \ operatorname {E} (X) = P (X = 1) \ cdot 1 + P (X = 0) \ cdot 0 = p \ cdot 1 + q \ cdot 0 = p}$

### Variance and other measures of dispersion

The Bernoulli distribution has the variance

${\ displaystyle \ operatorname {Var} (X) = p \ cdot (1-p) = pq}$

because it is and with it ${\ displaystyle \ operatorname {E} (X ^ {2}) = p \ cdot 1 ^ {2} + q \ cdot 0 ^ {2} = p}$

${\ displaystyle \ operatorname {E} \ left (X ^ {2} \ right) - \ operatorname {E} (X) ^ {2} = pp ^ {2} = p \ cdot (1-p) = pq}$.

So that is the standard deviation

${\ displaystyle \ sigma _ {X} = {\ sqrt {pq}}}$

and the coefficient of variation

${\ displaystyle \ operatorname {VarK} (X) = {\ sqrt {\ frac {q} {p}}}}$.

### symmetry

For the parameter , the Bernoulli distribution is symmetrical about the point . ${\ displaystyle p = {\ tfrac {1} {2}}}$${\ displaystyle a = {\ tfrac {1} {2}}}$

### Crookedness

The skewness of the Bernoulli distribution is

${\ displaystyle \ operatorname {v} (X) = {\ frac {1-2p} {\ sqrt {pq}}}}$.

This can be shown as follows. A standardized random variable with Bernoulli distribution assumes the value with probability and the value with probability . So we get for the skew ${\ displaystyle {\ frac {X- \ operatorname {E} (X)} {\ sqrt {\ operatorname {Var} (X)}}}}$${\ displaystyle X}$${\ displaystyle {\ frac {q} {\ sqrt {pq}}}}$${\ displaystyle p}$${\ displaystyle - {\ frac {p} {\ sqrt {pq}}}}$${\ displaystyle q}$

{\ displaystyle {\ begin {aligned} \ operatorname {v} (X) & = \ operatorname {E} \ left [\ left ({\ frac {X- \ operatorname {E} (X)} {\ sqrt {\ operatorname {Var} (X)}}} \ right) ^ {3} \ right] \\ & = p \ cdot \ left ({\ frac {q} {\ sqrt {pq}}} \ right) ^ {3 } + q \ cdot \ left (- {\ frac {p} {\ sqrt {pq}}} \ right) ^ {3} \\ & = {\ frac {1} {{\ sqrt {pq}} ^ { 3}}} \ left (pq ^ {3} -qp ^ {3} \ right) \\ & = {\ frac {pq} {{\ sqrt {pq}} ^ {3}}} (qp) \\ & = {\ frac {qp} {\ sqrt {pq}}} \ end {aligned}}}

### Bulge and excess

The excess of the Bernoulli distribution is

${\ displaystyle \ gamma (X) = {\ frac {1-6pq} {pq}}}$

and with that is the bulge

${\ displaystyle \ beta _ {2} (X) = {\ frac {1-3pq} {pq}}}$.

### Moments

All kth moments are the same and it holds ${\ displaystyle m_ {k}}$

${\ displaystyle m_ {k} = p}$.

Because it is

${\ displaystyle m_ {k} = \ operatorname {E} \ left (X ^ {k} \ right) = p \ cdot 1 ^ {k} + q \ cdot 0 ^ {k} = p}$.

### entropy

The entropy of the Bernoulli distribution is

${\ displaystyle \ mathrm {H} = -q \ log _ {2} (q) -p \ log _ {2} (p)}$

measured in bits .

### mode

The mode of the Bernoulli distribution is

${\ displaystyle x_ {D} = {\ begin {cases} 0 & {\ text {falls}} \ quad q> p \\ 0; 1 & {\ text {falls}} \ quad q = p \\ 1 & {\ text {falls}} \ quad q .

### Median

The median of the Bernoulli distribution is

${\ displaystyle {\ tilde {m}} _ {X} = {\ begin {cases} 0 & {\ text {falls}} \ quad q> p, \\ 1 & {\ text {falls}} \ quad q

if true, each is a median. ${\ displaystyle p = q}$${\ displaystyle {\ tilde {m}} _ {X} \ in [0,1]}$

### Accumulators

${\ displaystyle g_ {X} (t) = \ ln (pe ^ {t} + q)}$.

Therewith the first cumulants are and the recursion equation applies ${\ displaystyle \ kappa _ {1} = p, \ kappa _ {2} = pq}$

${\ displaystyle \ kappa _ {n + 1} = p (1-p) {\ frac {d \ kappa _ {n}} {dp}}.}$

### Probability generating function

${\ displaystyle m_ {X} (t) = 1-p + pt}$.

### Characteristic function

${\ displaystyle \ varphi _ {X} (t) = 1-p + pe ^ {\ mathrm {i} t}}$.

### Moment generating function

${\ displaystyle M_ {X} (t) = 1-p + pe ^ {t}}$.

## Relationship to other distributions

### Relationship to the binomial distribution

The Bernoulli distribution is a special case of the binomial distribution for . In other words, the sum of independent Bernoulli-distributed random variables with identical parameters satisfies the binomial distribution, so the Bernoulli distribution is not reproductive . The binomial distribution is the -fold convolution of the Bernoulli distribution with the same parameters or with equal probability . ${\ displaystyle n = 1}$${\ displaystyle p}$${\ displaystyle n}$${\ displaystyle p}$${\ displaystyle p}$

### Relationship to the generalized binomial distribution

The sum of mutually independent Bernoulli-distributed random variables, which all have a different parameter , is generally binomially distributed . ${\ displaystyle n}$${\ displaystyle p_ {i}}$

### Relationship to the Poisson distribution

The sum of Bernoulli-distributed random quantities is sufficient for , and a Poisson distribution with the parameter . This follows directly from the fact that the sum is binomially distributed and the Poisson approximation applies to the binomial distribution . ${\ displaystyle n \ to \ infty}$${\ displaystyle p_ {n} \ to 0}$${\ displaystyle \ lim \ limits _ {n \ to \ infty} np_ {n} = \ lambda> 0}$${\ displaystyle \ lambda}$

### Relationship to the two-point distribution

The Bernoulli distribution is a special case of the two-point distribution with . Conversely, the two-point distribution is a generalization of the Bernoulli distribution to any two-element point sets. ${\ displaystyle a = 0, b = 1}$

### Relationship to the Rademacher distribution

Both the Bernoulli distribution with and the Rademacher distribution model a fair coin toss (or a fair, random yes / no decision). The only difference is that heads (success) and tails (failure) are coded differently. ${\ displaystyle p = q = 0 {,} 5}$

### Relationship to the geometric distribution

When performing Bernoulli-distributed experiments one after the other, the waiting time for the first success (or last failure, depending on the definition) is geometrically distributed .

### Relationship to discrete equal distribution

The Bernoulli distribution with is a discrete uniform distribution on . ${\ displaystyle p = q = {\ frac {1} {2}}}$${\ displaystyle \ {0.1 \}}$

### Urn model

The Bernoulli distribution can also be generated from the urn model if is. Then this corresponds to the one-time pulling out of an urn with balls, of which exactly are red and all others have a different color. The probability of drawing a red ball is then Bernoulli-distributed. ${\ displaystyle p = {\ frac {p_ {1}} {p_ {2}}} \ in \ mathbb {Q}}$${\ displaystyle p_ {2}}$${\ displaystyle p_ {1}}$

## simulation

The simulation makes use of the fact that if a continuously uniformly distributed random variable is on , the random variable is Bernoulli-distributed with parameters . Since almost any computer can generate standard random numbers, the simulation is as follows: ${\ displaystyle {\ mathcal {U}}}$${\ displaystyle [0,1]}$${\ displaystyle Y = \ mathbf {1} _ {\ {{\ mathcal {U}} \ geq 1-p \}}}$${\ displaystyle p}$

1. Generate a standard random number ${\ displaystyle u_ {i}}$
2. Is , print 0, otherwise print 1.${\ displaystyle u_ {i} \ leq 1-p}$

This corresponds exactly to the inversion method . The simple simulability of Bernoulli-distributed random variables can also be used to simulate binomial distributed or generalized binomial distributed random variables.

## literature

• Hans-Otto Georgii: Stochastics: Introduction to probability theory and statistics. 4th edition, de Gruyter, 2009, ISBN 978-3-11-021526-7 .

## Individual evidence

1. Norbert Kusolitsch: Measure and probability theory . An introduction. 2nd, revised and expanded edition. Springer-Verlag, Berlin Heidelberg 2014, ISBN 978-3-642-45386-1 , p. 63 , doi : 10.1007 / 978-3-642-45387-8 .
2. Klaus D. Schmidt: Measure and probability . 2nd, revised edition. Springer-Verlag, Heidelberg Dordrecht London New York 2011, ISBN 978-3-642-21025-9 , pp. 254 , doi : 10.1007 / 978-3-642-21026-6 .
3. James Victor Uspensky: Introduction to Mathematical Probability , McGraw-Hill, New York 1937, p. 45