Member-only story
Learn whether to use Bernoulli or Binomial distribution to model discrete events, with coding examples in Python.
Bernoulli Distribution
The Bernoulli distribution, named after the Swiss mathematician Jacob Bernoulli, is a discrete probability distribution used to model events with binary outcomes.
Within a Bernoulli distribution, each event is known as a Bernoulli trial, which is a random event that has only two possible outcomes: “Success” or “Failure”. The probability of “Success” is denoted as p, and the probability of “Failure” as 1-p. When both events are equally likely, then p = 1- p = 50%.
We can summarise the probabilities of both outcomes using the following Bernoulli probability mass function (PMF), where p is a parameter representing the probability of a “Success” event:
which can also be written as:
The mean (a.k.a. Expected Value) of Bernoulli distribution is p, and its variance is p*(1-p). Check out this post if you want to learn what variance means in real life examples using cats 😺