# Binomial VS Bernoulli Distribution

## This blog aims to explain the difference between one of the most encountered distributions in the Data Science World, i.e., Binomial Distribution & Bernoulli Distributions with real-life examples.

Whether it be probability, statistics, Data Science, Machine Learning, Deep Learning, or any other likewise field, having the knowledge of the distribution of data is a must or crucial, because it helps in dealing with data.

Since both the distributions (Binomial & Bernoulli) are very confusing at first for most people, they do not try to explore & understand them. Also, one more factor is that, at most of the sources of the content, no real-life examples are given to make the explanation more realistic. That’s why this blog aims to explain the difference between the two distributions with real-life examples.

Now, that being said, let’s proceed by explaining Bernoulli Distribution first.

# Bernoulli Distribution!

**This distribution deals with the data which only has 1 trial & only 2 possible outcomes. Anything other than that will not fall under the Bernoulli Distribution category.**

## Way to represent Bernoulli Trial/Event!

Although anyone can use any symbol to represent the distribution for the sake of simplification, it is been represented as:

In the above image, “p” represents the probability of the event to occur; For example, the probability of getting heads in a coin toss.

## Example of Bernoulli Distribution!

For the real-life example, let’s consider the situation of passing or failing an exam. Let’s assume the probability to pass the exam is 95%, therefore the probability to fail will be 5%.

In this case, if the event to pass the exam is considered, then the Bernoulli event will contain the probability of passing the exam. Similarly, it goes for failing the exam.

# Binomial Distribution!

**It is the collection of Bernoulli trials for the same event, i.e., it contains more than 1 Bernoulli event for the same scenario for which the Bernoulli trial is calculated.**

## Way to represent Binomial Distribution!

It can be represented using two things:

- The number of Bernoulli trials.
- Probability of an event in each trial.

In the image above, “n” corresponds to the number of Bernoulli trials, & “p” corresponds to the probability of the event in each trial.

## Probability Function to calculate Binomial Distribution!

When there is a requirement to calculate the likelihood of the occurrence of some event a specific number of times out of a fixed number of times, the formula listed below is used.

In the above equation:

- “n” is the total number of trials of an event.
- “s” corresponds to the number of times an event should occur.
- “p” is the probability that the event will occur.
- “(1 — p)” is the probability that the event will not occur.
- “C” term is for combinations.

## Example of Binomial Distribution!

Considering the same example of the Bernoulli Distribution, let’s create Binomial Distribution from that example.

Considering 95% & 5% for passing & failing an exam for a student respectively. If we want to calculate the probability of a student to pass exactly 5 exams out of 5 exams in which it appeared, using the above probability formula it can be easily calculated.

`According to the situation:`

n = 5,

s = 5,

p = 0.95,

(1 — p) = 0.05

The number of ways to select 5 out of 5 is 1, so the first term of the formula becomes 1, now we have:

`probability(student pass all 5 exams) = 1 * (0.95)^(5) * (0.05)(0)`

=> 0.774

Therefore, there is approximately a 77.4 % chance, that the student passes all of the 5 exams.

# Binomial VS Bernoulli Keypoints!

- Bernoulli deals with the outcome of the single trial of the event, whereas Binomial deals with the outcome of the multiple trials of the single event.
- Bernoulli is used when the outcome of an event is required for only one time, whereas the Binomial is used when the outcome of an event is required multiple times.

This is all to explain the difference between the Bernoulli & Binomial Distribution with real-life examples.

*I hope my article explains each and everything related to the topic with all the deep concepts and explanations. Thank you so much for investing your time in reading my blog & boosting your knowledge. If you like my work, then I request you to give an applaud to this blog & follow me on **Medium** & **GitHub**!*