![]() |
VOOZH | about |
Binomial Distribution is used to calculate the probability of a specific number of successes in a fixed number of independent trials where each trial results in one of two outcomes: success or failure. It is used in various fields such as quality control, election predictions and medical tests to make decisions based on probability. In this article, we’ll see the more about Binomial Distribution and its core concepts.
1. Bernoulli Trial: A Bernoulli trial is an experiment that results in one of two outcomes: success or failure. The trials are independent means the outcome of one trial does not affect the others. Example: Tossing a coin where heads = success and tails = failure.
2. Number of Trials (n): This refers to the fixed number of trials performed in the experiment. For example if we flip a coin 5 times, n = 5.
3. Success Probability (p): The probability of success in each trial is denoted by p. This probability is constant across all trials. Example: For a fair coin the probability of heads (success) on each flip is p = 0.5.
4. Failure Probability (q): The probability of failure is denoted by q and it is calculated as q = 1− p. Since each trial results in either success or failure, we always have p + q =1. Example: For a fair coin, p=0.5 for heads so q = 1−0.5 = 0.5 for tails.
Binomial Distribution calculates the probability of getting exactly successes in independent trials. The formula for the Probability Mass Function (PMF) is:
Where:
The Probability Mass Function defines the probability of a specific number of successes occurring in the Binomial Distribution. It provides the likelihood of getting exactly x successes out of n trials. The formula for the PMF is as follows:
This formula tells us the probability of achieving exactly x successes in n trials. The binomial coefficient accounts for all the different ways in which x successes can occur in n trials.
Example: Tossing a Coin
Let’s say we flip a coin 4 times (n= 4) and want to know the probability of getting exactly 2 heads (successes). Since the probability of heads is p= 0.5 for a fair coin, the probability of tails (failure) is q = 1−p = 0.5.
The Cumulative Distribution Function (CDF) of the Binomial Distribution gives the probability of obtaining at most x successes in n trials. It’s the sum of the probabilities from
The CDF is defined as:
In simpler terms, the CDF tells us the cumulative probability of getting zero, one, two or more successes in n trials. It is helpful when we want to know the probability of getting a certain number of successes or fewer.
Example:
If we want to know the probability of getting 3 or fewer heads in 5 coin tosses (n=5) we would calculate by summing the probabilities:
The expected value (mean) of a Binomial Distribution represents the average number of successes we expect after performing n trials. The expected value is calculated as:
For example if we flip a fair coin 5 times, the expected number of heads would be:
So we would expect to get 2.5 heads on average after 5 flips of the coin.
1. Variance: The variance of a Binomial Distribution measures how much the number of successes varies from the expected value. It is given by:
2. Standard Deviation: The standard deviation is the square root of the variance which gives us a measure of how much the number of successes is likely to differ from the expected value on average:
Let’s apply the Binomial Distribution in a real-life scenario. Consider an airline that sells 65 tickets for a flight with a capacity of 60 passengers. The probability that a passenger does not show up for the flight is q=0.1 means the probability that a passenger shows up is p=0.9. The airline wants to know the probability that 60 or fewer passengers will show up so they don’t need to reschedule tickets.
Step 1: Define Random Variable
Here the random variable X represents the number of passengers who show up. We need to calculate the probability that 60 or fewer passengers show up.
Step 2: Calculate Probability of More Than 60 Passengers
We first calculate the probability that more than 60 passengers show up which is:
Step 3: Using Binomial Formula
Here we calculate the probabilities for X=61,62,…,65. We then subtract this from 1 to find :
Step 4: Result
After performing the calculation we find:
After performing the calculation we find that the probability of 60 or fewer passengers showing up is approximately 79.09%. This means there is a 79.09% chance that the airline will not need to rebook any passengers.
Now let's implement the Binomial Distribution in Python to find the probabilities, visualize outcomes and calculate both the PMF and CDF. We’ll be using Numpy, SciPy and Matplotlib libraries for this.
Output:
Probability of exactly 3 heads: 0.1172
Binomial Distribution has numerous applications in real-life scenarios:
Mastering the Binomial Distribution helps us with the tools to calculate probabilities in binary outcome scenarios helps in making it invaluable for decision-making across various fields.