# Bernoulli distribution

In probability theory and statistics, the Bernoulli distribution, named after Swiss mathematician Jacob Bernoulli,[1] is the discrete probability distribution of a random variable which takes the value 1 with probability ${\displaystyle p}$ and the value 0 with probability ${\displaystyle q=1-p}$. Less formally, it can be thought of as a model for the set of possible outcomes of any single experiment that asks a yes–no question. Such questions lead to outcomes that are boolean-valued: a single bit whose value is success/yes/true/one with probability p and failure/no/false/zero with probability q. It can be used to represent a (possibly biased) coin toss where 1 and 0 would represent "heads" and "tails" (or vice versa), respectively, and p would be the probability of the coin landing on heads or tails, respectively. In particular, unfair coins would have ${\displaystyle p\neq 1/2.}$

Parameters Probability mass function Three examples of Bernoulli distribution: .mw-parser-output .legend{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .legend-color{display:inline-block;min-width:1.25em;height:1.25em;line-height:1.25;margin:1px 0;text-align:center;border:1px solid black;transparent;black}.mw-parser-output .legend-text{}  ${\displaystyle P(x=0)=0{.}2}$ and ${\displaystyle P(x=1)=0{.}8}$   ${\displaystyle P(x=0)=0{.}8}$ and ${\displaystyle P(x=1)=0{.}2}$   ${\displaystyle P(x=0)=0{.}5}$ and ${\displaystyle P(x=1)=0{.}5}$ ${\displaystyle 0\leq p\leq 1}$ ${\displaystyle q=1-p}$ ${\displaystyle k\in \{0,1\}}$ ${\displaystyle {\begin{cases}q=1-p&{\text{if }}k=0\\p&{\text{if }}k=1\end{cases}}}$ ${\displaystyle p^{k}(1-p)^{1-k}}$ ${\displaystyle {\begin{cases}0&{\text{if }}k<0\\1-p&{\text{if }}0\leq k<1\\1&{\text{if }}k\geq 1\end{cases}}}$ ${\displaystyle p}$ ${\displaystyle {\begin{cases}0&{\text{if }}p<1/2\\\left[0,1\right]&{\text{if }}p=1/2\\1&{\text{if }}p>1/2\end{cases}}}$ ${\displaystyle {\begin{cases}0&{\text{if }}p<1/2\\0,1&{\text{if }}p=1/2\\1&{\text{if }}p>1/2\end{cases}}}$ ${\displaystyle p(1-p)=pq}$ ${\displaystyle {\frac {1}{2}}}$ ${\displaystyle {\frac {q-p}{\sqrt {pq}}}}$ ${\displaystyle {\frac {1-6pq}{pq}}}$ ${\displaystyle -q\ln q-p\ln p}$ ${\displaystyle q+pe^{t}}$ ${\displaystyle q+pe^{it}}$ ${\displaystyle q+pz}$ ${\displaystyle {\frac {1}{pq}}}$

The Bernoulli distribution is a special case of the binomial distribution where a single trial is conducted (so n would be 1 for such a binomial distribution). It is also a special case of the two-point distribution, for which the possible outcomes need not be 0 and 1.