Previously, we covered topics like probability mass function and cumulative mass function. In this topic, we will see how we can apply such concepts to a particular discrete probability distribution, the Bernoulli distribution.
The Bernoulli distribution can be applied when there is a single experiment with only two possible outcomes, such as success/failure, red/blue, heads/tails, or true/false. Such an experiment is called a Bernoulli trial. Researchers will often denote the two possibilities as success vs. failure, with success referring to the expected or desired result. The Bernoulli distribution has applications in medicine, marketing, finance, etc.
As an example, suppose that you are in a group of four friends and you are deciding when to watch a movie together. Three out of four people are free this Saturday, but one person is not.
The "experiment" of randomly discovering whether one of these people is free on a chosen day only has two outcomes: a person will either be free or not free on that day. As "available" and "not available" are the only two outcomes, the Bernoulli distribution can be applied to this scenario.
PMF and CDF of Bernoulli Distribution
In general, Bernoulli trials must follow certain conditions:
- Bernoulli trials must be independent of each other
- Their probabilities must remain the same across the trials
A Bernoulli trial has two possible outcomes: success/failure. For success, the random variable takes value with probability . For failure, it takes value with probability . Note that if the probability of one outcome is , then the opposite is .
Looking back at the example in the introduction, if we consider availability to watch a movie as a success, then and . Since is , the probability of outcome with value is , and the other one is .
The probability mass function (PMF) gives the probability that a discrete random variable equals a specific value. For the Bernoulli distribution, the PMF, denoted , of a discrete random variable with a parameter and evaluated at , is as follows:
This means that will equal with a probability and it will equal with a probability . It is common to use to denote an unfavorable outcome, but strictly speaking, nothing prevents us from doing otherwise.
The histogram below is the PMF based on the example described in the introduction.
As a side note, if we were flipping an ideal coin we would see the bars of the same height since the probability of getting heads and tails is equal to and is still .
The cumulative distribution function (CDF) gives the probability that a real-valued random variable is less than or equal to a specific value. For the Bernoulli distribution, the CDF, , of a random variable with a parameter and evaluated at , is as follows:
This means that there the probability of is , that of is and that of is .
The step function below represents the CDF for the example from the introduction.
Mean and variance
Two important values in the field of probability and statistics are mean and variance. The mean is essentially a weighted average. The variance is a measure of variability in the data; that is, it tells you how spread out the data is.
The mean or expected value of the distribution is calculated as follows:
The variance or the expected squared distance of a value from the mean is calculated as follows:
As you probably noticed, the formulas in the mean and variance calculations are pretty simple. This is due to the fact that one of the outcomes is and so some terms are nixed.
Let's revisit the problem from the introduction. The mean of the experiment is:
Consequently, the variance of the experiment is:
Therefore, the expected value of the experiment amounts to . The variance, , gives an indication of how far the data points are spread out from the expected value.
Symmetry of notation
In the example we used in this topic, we considered success to be when a person is free on a given date, and failure to be when they are not free. It is important to note that success and failure have nothing to do with the actual "SUCCESS, MONEY, AND FAME". 'Success' and 'failure' are just the labels we use.
So, what would happen if we assigned and differently? Let's say that success is now when a person is not free. Now, and .
This is what the PMF would look like.
And this is what the CDF would look like.
The mean:
The variance:
Thus, while the real-life situation and experiment do not change, our model changes slightly. Our diagrams and mean value change, but the variance does not.
In general, noticing symmetry in such problems is a nice skill to have since sometimes such changes might lead to easier calculations.
Conclusion
- The Bernoulli distribution has two possible outcomes:
- Success: value , probability
- Failure: value , probability
- Expected value:
- Variance: