The Wayback Machine - https://web.archive.org/web/20250512131133/https://www.geeksforgeeks.org/bernoulli-trials-binomial-distribution/
Open In App

Bernoulli Trials and Binomial Distribution

Last Updated : 30 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Bernoulli Trials and Binomial Distribution are the fundamental topics in the study of probability and probability distributions.

  • Bernoulli’s Trials are those trials in probability where only two possible outcomes are Success and Failure, or True and False.
  • Due to this fact of two possible outcomes, it is also called the Binomial Trial.

The binomial distribution, in turn, describes the probability of achieving a specific number of successes in a fixed number of independent Bernoulli trials. In essence, the binomial distribution arises from repeating a Bernoulli trial multiple times and counting the number of successes.

The image illustrates the Binomial Distribution PMF for 10 Bernoulli trials.

Bernoulli-Trials-and-Binomial-Distribution

Bernoulli Trials and Binomial Distribution

  • Assumes a success probability of approximately 0.5.
  • Displays probabilities for getting 0 to 10 successes.
  • The peak occurs around 5 successes, indicating the most likely outcome.
  • The distribution is symmetric, typical of fair coin tosses.

Bernoulli’s Trials

Bernoulli’s trials are a type of experiment where you repeat the same thing over and over again independently. Each time, you’re looking for a specific outcome, which we call event A. The chance of this outcome happening is the same each time you experiment, no matter how many times you repeat it.

Experiment itself only has two possible outcomes either event ‘A’ happens, or it doesn’t. It’s like flipping a coin, where you can either get heads or tails. A Bernoulli trial is a fundamental concept in probability theory, referring to a random experiment with exactly two possible outcomes: “success” and “failure.”

The idea of Bernoulli’s trials comes from Jacob Bernoulli, a famous mathematician from Switzerland who came up with the concept way back in the 17th century. People use Bernoulli’s trials a lot in math and statistics to understand things that happen in the real world.
For example, if you wanted to figure out the odds of getting heads or tails when flipping a coin, you could use Bernoulli’s trials.

Examples of Bernoulli’s Trials

Some of the examples of Bernoulli’s trials are as follows:

  • The most common example of the Bernoulli trials is flipping a coin. Each flip of the coin has only two possible outcomes: Heads and Tails. If we consider the Head to be a success, then automatically the tail becomes a failure, and vice versa is also true.
  • Other than this, rolling a die to get a specific number is also an example of Bernoulli’s Trials. Here if consider getting a desired number to be a success then any other outcome other than the desired number becomes a failure. In this case, each roll of the dice is a Bernoulli Trial.
  • Checking emails: Suppose you have an inbox full of emails, and you want to check whether a particular email has arrived or not. Each time you check your inbox, you’re looking for the same event, which is the arrival of that particular email. Checking your inbox is also an example of a Bernoulli trial.
  • Flipping a light switch: Suppose you have a light switch that may either turn on or off, and you want to see if it works. Each time you flip the switch, you’re conducting a Bernoulli trial, and you’re looking for a particular event, which is whether the light turns on or not.

Bernoulli’s Trials Theorem

The following theorem gives the probability of success r number of times in n number of trials, and its statement is as follows:

Statement: If the probability of occurrence of an event (probability of success) in a single trial of Bernoulli’s experiment is p, then the probability that the event occurs exactly r times out of n independent trials is equal to nCr qn – r pr, where q = 1 – p, the probability of failure of the event.

To summarize the above theorem, 

Probability of r success in n Trials = nCr qn – r pr

where, 

  • p is the Probability of Success,
  • q = 1 – p is the Probability of Failure,
  • n is the Number of Independent trials, and 
  • r is the number of times an event occurred.

Proof:

Getting exactly r successes means getting r successes and (n – r) failures simultaneously.

âˆī P(getting r successes and  n – r failures) = qn – r pr (since the n trials are independent) [By Multiplication Theorem]

The trials, from which the successes are obtained, are not specified. There are  nCr ways of  choosing r trials for successes. Once the r trials are chosen for successes, the remaining  (n – r) trials should result in failures. These  nCr  ways are mutually exclusive. In each of these nCr  ways, P(getting exactly r successes) = qn – r pr

Therefore, by the addition theorem, the required probability = nCr qn – r pr

Example: A coin is tossed 4 times. What is the probability of getting exactly 2 heads?

  • Here, n = 4, r = 2, p = 0.5

Solution:

[Tex]P(X = r) = \binom{n}{r} p^r q^{n-r}[/Tex]
Substituting the given values:
[Tex]P(X = 3) = \binom{5}{3} (0.5)^3 (0.5)^{5-3}[/Tex]
[Tex]= \binom{5}{3} (0.5)^3 (0.5)^2 = 10 \times (0.125) \times (0.25) = 10 \times 0.03125= 0.3125[/Tex]

Binomial Distribution Definition

Binomial Distribution is a probability distribution that describes the number of successes in a fixed number of independent binomial trials i.e., each trial can only result in either a success or a failure. 

Examples of Binomial Distribution

Some examples of Binomial Distribution are as follows:

  • For example, in Binomial Distribution, suppose a company sends out 1000 emails and the probability for a recipient to open that email is 0.2. Then the number of people who open the emails can be modelled by a binomial distribution with n = 1000 and p = 0.2
  • Another example of this distribution includes tossing a coin. Suppose you toss a fair coin 10 times and you want to know the probability of getting exactly 5 heads. This is an example of a binomial distribution with n=10 (number of trials) and p=0.5 (probability of success).
  • Let’s consider one more example of binomial distr,ibution i.e., voting. Suppose you conduct a survey of 1000 people and ask them whether they support a certain candidate. If the probability of someone supporting the candidate is 0.6, you can model the number of people who support the candidate using a binomial distribution with n=1000 and p=0.6.

Formula for Probability in Binomial Distribution

 Let A be some event associated with a random experiment E, such that P(A) = p and P(A’) = q = 1 – p.

Assuming that p remains the same for all repetitions, if we consider n independent repetitions ( or trials ) of E and if the random variable (RV)X denotes the number of times the event A has occurred then X is called a binomial random variable with parameters n and p or we can say that X follows a binomial distribution with parameters n and p, or symbolically BThesly, the possible values that X can take, are 0, 1, 2,…., n. Then the probability mass function of a binomial random variable is given by

P(X = r) = nCr qn – r pr

where,

  • P(X = r) is the probability of getting exactly r successes,
  • n is the number of total trials,
  • r is the number of successes in n Trials,
  • p is the probability of success,
  • q is the probability of failure, and 
  • p + q = 1 and r = 0, 1, 2, …, n

Proof for Binomial Distribution

The binomial distribution counts successes in nn independent Bernoulli trials.

Sequence Probability: For any specific sequence with x successes and n−x failures:
Probability Mass Function (PMF)
[Tex]P(X = k) = \binom{n}{k} p^k (1 – p)^{n – k}[/Tex]
Derivation of the PMF
[Tex] P(\text{Sequence}) = p^k (1 – p)^{n – k}[/Tex]
The number of such sequences is:
[Tex] \binom{n}{k} = \frac{n!}{k!(n – k)!}[/Tex]
Multiply the number of sequences by their probability:
[Tex] P(X = k) = \binom{n}{k} p^k (1 – p)^{n – k}[/Tex]
Mean and Variance
[Tex] X = \sum_{i=1}^n X_i \implies E[X] = \sum_{i=1}^n E[X_i] = n p[/Tex]
[Tex] \text{Var}(X) = \sum_{i=1}^n \text{Var}(X_i) = n p(1 – p)[/Tex]
Probability-Generating Function (PGF)
[Tex]G_X(z) = \sum_{k=0}^n P(X = k) z^k = (1 – p + p z)^n[/Tex]
[Tex]G_X(z) = \sum_{k=0}^n \binom{n}{k} (p z)^k (1 – p)^{n – k} = (1 – p + p z)^n[/Tex]
Normalization Check
[Tex]\sum_{k=0}^n P(X = k) = \sum_{k=0}^n \binom{n}{k} p^k (1 – p)^{n – k} = (p + (1 – p))^n = 1[/Tex]

Example: Calculate the probability of getting exactly five heads when a coin is tossed 10 times.

Solution:

As we know, P(X = k) = nCr × pr × (1-p)n-r

n = 10, r = 5, and p = 0.5

Plugging in the values, you get:

P(X = 5) = 10C5 × (0.5)5 × (1-0.5)10 – 5

⇒ P(X = 5) = 252 × 0.03125 × 0.03125

⇒ P(X = 5) = 0.24609375 ≈ 0.246

So the probability of getting exactly five heads when flipping a fair coin ten times is about 0.246, or 24.6%.

Mean and Variance of Binomial Distribution

Mean or Expected value of a binomial distribution is given by the following formula:

Mean = Ξ = np

and variance or measure of a binomial distribution is given by the following formula:

Variance = σ2 = np(1-p)

where, the  

  • n is Total Number of Trials
  • p is Probability of Success

Important Things to Remember about Binomial Distribution

There are some important things related to the binomial distribution to which we need to pay more attention. Some of those things are as follows:

  • Binomial distribution is a legitimate probability distribution since

[Tex]\bold{\sum_{r=0}^n P(X=r)=\sum_{r=0}^n nCrq^{n-r}p^r=(q+p)^n=1}[/Tex]

  • Mean of the Binomial Distribution is given by: 

[Tex]\bold{E(x)=\sum_{r} x_{r}p_{r}=np}[/Tex]

and

[Tex]\bold{E(x^2)=\sum_{r}x_{r}^2p_{r}}[/Tex]

  • Variance of the Binomial Distribution is given by: 

[Tex]\bold{Var(x)=E(x^2)-{{E(x)}}^2=npq}[/Tex]

Generalization of Bernoulli’s Distribution: Multinomial Distribution

If A1, A2, . . , Ak are exhaustive and mutually exclusive events associated with a random experiment suc that, P(Ai occurs) = pi where, 

p1 + …2 . . + pk = 1, and if the experiment is repeated n times, then the probability A1 occurs r1 times, A2 occurs r2 times, . . . . , Ak occurs rk times is given by:

Pn(r1, r2, . . . , rk) = [Tex]\frac{n!}{r_{1}! r_{2}! . . . r_{k}!} \ p_{1}^{r_{1}}\times p_{2}^{r_{2}}\times. . .\times p_{k}^{r_{k}}[/Tex]

where,

  • r1​ + r2 ​+ …+ rk ​= n    

Proof:

r1 trials in which the event A1 occurs can be chosen from the n trials nCr ways. The remaining (n – r1) trials are left over for the other events. 

r2 trials in which the event A2 occurs can be chosen from the (n – r1) trials in (n – r1)Cr2  ways.

r3 trials in which the event A3 occurs can be chosen from the (n – r1 – r2) trials in (n – r1 – r2)Cr3 ways, and so on.

Therefore, the number of ways in which the events A1​, A2​, …, Ak can happen:

n​Cr1​ ​× (n − r1​)Cr2 ​​× (n −r1 ​− r2​)Cr3​​ × (n−r1​ − r1​ – …− rk ​− 1)Crk​​ =  n!/(r1!r2! . . . r3!)

Consider any one of the above ways in which the events A1, A2, . . ., Ak occurs

Since, n trials are independent, r1 + r2 + . . . +rk trials are also independent.

âˆī P(A1 occurs r1 times, A2 occurs r2 times, . . . , Ak occurs rk times) = p1 r1 × p2r2 × . . . × pk rk 

Since the ways in which the events happen are mutually exclusive, the required probability is given by

Pn (r1 , r2 , . . . , rk ) =[Tex] \frac{n!}{r_{1}! r_{2}! . . . r_{k}!}\times \ p_{1} ^{r_{1}}\times p_{2}^{r_{2}}\times… \times p_{k}^{r_{k}}[/Tex]

Read More,

Solved Question on Bernoulli Trials and Binomial Distribution

Question 1: A coin is tossed an infinite number of times. If the probability of a head in a single toss is p, show that the probability that the kth head is obtained at the nth tossing, but not earlier is (n−1)Ck−1​pkqn−k, where q = 1 – p.

Solution:

K heads should be obtained at the nth tossing, but not earlier.
Therefore, (k – 1) heads must be obtained in the first (n – 1) tosses and 1 head must be obtained at the nth toss.

Required Probability = P[(k – 1) heads in (n – 1) tosses] Ã— P(1 head in 1 toss)]  
= (n−1)Ck−1​pk-1qn−k x p 

Question 2: If at least 1 child in a family with 2 children, is a boy then what is the probability that both children are boys?

Solution:

p = Probability that a child is a boy = 1/2.

âˆī q = 1 – p = 1/2 and n = 2

⇒ P (at least one boy) = p (exactly 1 boy) + p (exactly 2 boys) 
⇒ P (at least one boy) = [Tex]2C_{1}\frac{1}{2}^2 + 2C_{2}\frac{1}{2}^2    [/Tex]
⇒ P (at least one boy) = 3/4

âˆī Required probability = P (both are boys)/P (at least 1 boy)
⇒ Required probability = (1/4)/(3/4) = 1/3

Question 3: Out of 800 families with 4 children each, how many families would be expected to have 

(i) 2 boys and 2 girls,
(ii) at least 1 boy,
(iii) at most 2 girls,
(iv) children of both sexes.

(Assume equal probabilities for boys and girls.)

Solution:

Considering each child as a trial, n = 4. Assuming that birth of a boy is a success, p = 1/2, and q = 1/2. Let X denote the number of successes(boys).

(i) P (2 boys and 2 girls) = P (X = 2)
⇒ P (X = 2) = [Tex]4C_{2} \times (\frac{1}{2})^2 \times (\frac{1}{2})^{4-2}           [/Tex]           
⇒ P (X = 2) [Tex]=6 \times(\frac{1}{2})^4=\frac{3}{8}        [/Tex]

Thus, No. of families having 2 boys and 2 girls = N×P(X = 2)  

[Where, N is the total no. of families considered]

⇒ Required No. of Families = [Tex]800 \times \frac{3}{8}=300           [/Tex]

(ii) P (at least 1 boy) = P (X â‰Ĩ 1)
⇒ P (X â‰Ĩ 1) = P (X = 1) + P ( X = 2) + P (X = 3) + P (X = 4)
⇒ P (X â‰Ĩ 1) = 1 – P (X = 0)
⇒ P (X â‰Ĩ 1) = [Tex]1-4C_{0} \times(\frac{1}{2})^0\times(\frac{1}{2})^4=1-\frac{1}{16}=\frac{15}{16}                  [/Tex] 

Thus, No. of families having at least 1 boy = N×P(X â‰Ĩ 1)

⇒ Required No. of Families = [Tex]800 \times \frac{15}{16}=750                  [/Tex] 

(iii) P (at most 2 girls) = P (exactly 0 girl, 1 girl or 2 girls)
⇒ P (at most 2 girls) = P (X = 4, X = 3 or X = 2)
⇒ P (at most 2 girls) = [Tex]1-(4C_{0} \times (\frac{1}{2})^4+4C_{1} \times(\frac{1}{2})^4)=\frac{11}{16}[/Tex]

Thus, No. of families having at most 2 girls = [Tex]800 \times \frac{11}{16}=550[/Tex]

(iv) P(children of both sexes)
⇒ P (children of both sexes) = 1 – P (children of same sex)
⇒ P (children of both sexes) = 1 – {P (all are boys) + P (all are girls)}
⇒ P (children of both sexes) = 1 – {P (X = 4) + P (X = 0)}
⇒ P (children of both sexes) = [Tex]1-(4C_{4} \times(\frac{1}{2})^4 + 4C_{0}\times(\frac{1}{2})^4)[/Tex]
⇒ P (children of both sexes) = [Tex]1-\frac{1}{8} = \frac{7}{8}[/Tex]

Thus, No. of families having children of both sexes = [Tex]800\times\frac{7}{8} = 700[/Tex]

Question 4: Ten coins are thrown simultaneously. Find the probability of getting at least seven heads?

Solution: 

Given:

  • p = Probability of getting a head = 1/2
  • q = Probability of not getting a head = 1 – p = 1/2

Probability of getting x heads in a random throw of 10 coins is: 

p(x) = [Tex]10C_{x}\times\frac{1}{2}^x\times\frac{1}{2}^{10-x}=10C_{x}\times\frac{1}{2}^{10}[/Tex]; x = 0, 1, 2, . . ., 10

Therefore, probability of getting at least seven heads is given by:

P(X â‰Ĩ 7) = P(7) + P(8) + P(9) + P(10)
⇒ P(X â‰Ĩ 7) = [Tex]\frac{1}{2}^{10}( 10C_{7} + 10C_{8} + 10C_{9} + 10C_{10})[/Tex]
⇒ P(X â‰Ĩ 7) = 176/1024 = 11/64



Next Article

Similar Reads