Definition:Bernoulli Distribution

Definition
Let $X$ be a discrete random variable on a probability space.

Then $X$ has the Bernoulli distribution with parameter $p$ if:


 * $X$ has exactly two possible values, e.g. $\operatorname{Im} \left({X}\right) = \left\{{a, b}\right\}$


 * $\Pr \left({X = a}\right) = p$


 * $\Pr \left({X = b}\right) = 1 - p$

where $0 \le p \le 1$.

That is, the probability mass function is given by:
 * $p_X \left({x}\right) = \begin{cases}

p & : x = a \\ 1 - p & : x = b \\ 0 & : x \notin \left\{{a, b}\right\} \\ \end{cases}$

If we allow:
 * $\operatorname{Im} \left({X}\right) = \left\{{0, 1}\right\}$

then we can write:
 * $p_X \left({x}\right) = p^x \left({1-p}\right)^{1-x}$

This distribution is sometimes written:
 * $X \sim \operatorname{Bern} \left({p}\right)$

but as, from Bernoulli Process as Binomial Distribution, the Bernoulli distribution is the same as the binomial distribution where $n = 1$, the notation:
 * $X \sim \operatorname{B} \left({1, p}\right)$

is often preferred, for notational economy.

Frequently $q$ is used for $1-p$ in which case the probability mass function is given by:
 * $p_X \left({x}\right) = \begin{cases}

p & : x = a \\ q & : x = b \\ 0 & : x \notin \left\{{a, b}\right\} \\ \end{cases}$ where $p + q = 1$.

Success or Failure
The actual values of $a$ and $b$ depends on the particular experiment in question.

However, it is conventional to consider that the outcome whose probability is $p$ is determined to be a success, while the other outcome is determined to be a failure.