\( \newcommand{\matr}[1] {\mathbf{#1}} \newcommand{\vertbar} {\rule[-1ex]{0.5pt}{2.5ex}} \newcommand{\horzbar} {\rule[.5ex]{2.5ex}{0.5pt}} \newcommand{\E} {\mathrm{E}} \)
deepdream of
          a sidewalk
Show Question
Bernoulli Distribution

The bernoulli distribution is a distribution over a single binary random variable.

Suppose you perform an experiment with two possible outcomes: either success or failure. Success happens with probability p, while failure happens with probability 1-p. A random variable that takes value 1 in case of success and 0 in case of failure is called a Bernoulli random variable (alternatively, it is said to have a Bernoulli distribution).

Let \( p \in (0, 1) \). We say that \( X \) has a Bernoulli distribution with parameter p if its probability mass function is:

A random variable having a Bernoulli distribution is also called a Bernoulli random variable.

Expected value

\( \mathrm{E}[X] = p \)

Variance

\( \mathrm{Var}[X] = p(1-p) \).

\[ \begin{align*} \mathrm{Var}[X] &= p*(1-p)^2 + q*(p)^2 \\ &= p*(1-p)^2 + (1-p)p^2 \\ &= p(1-p)( (1-p) + p) \\ &= p(1-p) \end{align*} \]

Binomial random variable

A sum of independent Bernoulli random variables is a binomial random variable.