# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/data-analysis-probability/binomial-distribution-function
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/data-analysis-probability/binomial-distribution-function/en.mdx

Learn binomial distribution formula with worked examples. Calculate probability of success in repeated trials with coin flips and practice problems.

---

## Getting to Know Jacob Bernoulli

Jacob Bernoulli, also known as James or Jacques, was one of the prominent mathematicians from the Bernoulli family. He was the first pioneer in Leibnizian analysis and supported Leibniz in the calculus debate against Newton.

Jacob Bernoulli is famous for his many contributions to calculus. He was one of the founders of calculus of variations and proposed the first version of the law of large numbers in his book "Ars Conjectandi" published in $$1713$$. One of the important discussions in that book was about binomial experiments.

Visible text: Jacob Bernoulli is famous for his many contributions to calculus. He was one of the founders of calculus of variations and proposed the first version of the law of large numbers in his book "Ars Conjectandi" published in . One of the important discussions in that book was about binomial experiments.

## Combination and Basic Probability

Before diving into binomial distribution, there are some basic formulas we need to learn first.

First, the combination formula for selecting objects:

```math
C_k^n = \binom{n}{k} = \frac{n!}{k!(n-k)!}
```

Second, factorial (sequential multiplication):

```math
n! = n \times (n-1) \times ... \times 3 \times 2 \times 1
```

And third, the relationship between event probability and its complement:

```math
P(A) + P(A^c) = 1
```

where $$P(A)$$ is the probability of an event occurring and $$P(A^c)$$ is the probability of the event not occurring.

Visible text: where is the probability of an event occurring and is the probability of the event not occurring.

## Binomial Distribution Concept

Binomial distribution is actually a fairly simple concept if we understand it from the basics. Imagine you're conducting an experiment that only has two possible outcomes: success or failure. For example, like flipping a coin that can only result in heads or tails.

Binomial distribution is used when we perform the same experiment repeatedly under the same constant conditions. Importantly, each experiment is independent (they don't influence each other) - meaning the result of previous experiments doesn't affect subsequent experiments.

**Requirements for binomial experiments:**

- There are only two possible outcomes: success or failure

- The number of experiments is predetermined and fixed

- Each experiment is mutually independent

- The probability of success is the same for each experiment

## Binomial Distribution Formula

If there's a binomial experiment with probability of success $$p$$ and probability of failure $$q = 1 - p$$, then the formula to calculate the probability of getting exactly $$x$$ successes in $$n$$ independent experiments is:

Visible text: If there's a binomial experiment with probability of success and probability of failure , then the formula to calculate the probability of getting exactly successes in independent experiments is:

```math
b(x;n,p) = \binom{n}{x} p^x q^{n-x} \text{ for} x = 0{,}1{,}2,...,n
```

Where:

- $$n$$ = number of experiments performed

- $$x$$ = number of successes we want

- $$p$$ = probability of success in one experiment

- $$q = 1-p$$ = probability of failure in one experiment

Visible text: - = number of experiments performed

- = number of successes we want

- = probability of success in one experiment

- = probability of failure in one experiment

So, to use this formula, make sure first that the experiment we're dealing with meets the binomial requirements mentioned earlier.

## Coin Experiment

Let's look at a simple example. Suppose we have a fair coin. We call heads as "H" and tails as "T", so the sample space is $$S = \{H,T\}$$.

Visible text: Let's look at a simple example. Suppose we have a fair coin. We call heads as "H" and tails as "T", so the sample space is .

If we consider getting tails as "success", then the probability of success is $$p = \frac{1}{2}$$. Automatically, the probability of failure (getting heads) is $$q = 1 - \frac{1}{2} = \frac{1}{2}$$.

Visible text: If we consider getting tails as "success", then the probability of success is . Automatically, the probability of failure (getting heads) is .

**Problem:** If we flip this coin $$7\text{ times}$$ in a row, what's the probability of getting tails exactly $$5\text{ times}$$?

Visible text: **Problem:** If we flip this coin in a row, what's the probability of getting tails exactly ?

**Solution:**

First, let's identify the parameters:

- $$n = 7$$ (number of flips)
- $$x = 5$$ (number of tails desired)
- $$p = \frac{1}{2}$$ (probability of getting tails)
- $$q = \frac{1}{2}$$ (probability of getting heads)

Visible text: - (number of flips)
- (number of tails desired)
- (probability of getting tails)
- (probability of getting heads)

Now we use the binomial distribution formula:

Component: MathContainer
Children:

```math
b(5;7,\frac{1}{2}) = \binom{7}{5} \left(\frac{1}{2}\right)^5 \left(\frac{1}{2}\right)^{7-5}
```

```math
= \binom{7}{5} \left(\frac{1}{2}\right)^5 \left(\frac{1}{2}\right)^2
```

```math
= \binom{7}{5} \left(\frac{1}{2}\right)^7
```

Let's calculate $$\binom{7}{5}$$ first:

Visible text: Let's calculate first:

Component: MathContainer
Children:

```math
\binom{7}{5} = \frac{7!}{5!(7-5)!} = \frac{7!}{5! \cdot 2!}
```

```math
= \frac{7 \times 6 \times 5!}{5! \times 2 \times 1} = \frac{7 \times 6}{2} = \frac{42}{2} = 21
```

So the complete calculation is:

Component: MathContainer
Children:

```math
b(5;7,\frac{1}{2}) = 21 \times \frac{1}{2^7} = 21 \times \frac{1}{128} = \frac{21}{128}
```

Therefore, the probability of getting $$5$$ tails in $$7$$ flips is $$\frac{21}{128}$$ or approximately $$16.4\%$$.

Visible text: Therefore, the probability of getting tails in flips is or approximately .

## Practice Problems

1. In a bag there are $$10 \text{ balls}$$ that are exactly the same, except for their color: $$6$$ red balls and $$4$$ blue balls. If we draw $$5 \text{ balls}$$ one by one with replacement (each drawn ball is returned), what's the probability of drawing exactly $$3$$ red balls?

2. An archer has an accuracy rate of $$80\%$$ for hitting targets. If he shoots $$6\text{ times}$$, what's the probability he hits the target exactly $$4\text{ times}$$?

3. There's a multiple choice exam with $$4$$ answer choices for each question. A student guesses all answers randomly for $$8$$ questions. What's the probability he answers exactly $$2$$ questions correctly?

Visible text: 1. In a bag there are that are exactly the same, except for their color: red balls and blue balls. If we draw one by one with replacement (each drawn ball is returned), what's the probability of drawing exactly red balls?

2. An archer has an accuracy rate of for hitting targets. If he shoots , what's the probability he hits the target exactly ?

3. There's a multiple choice exam with answer choices for each question. A student guesses all answers randomly for questions. What's the probability he answers exactly questions correctly?

### Answer Key

1. **Red Ball Problem Answer**

    **Step** $$1$$: Identify parameters.

    - $$n = 5$$ (number of draws)
    - $$x = 3$$ (number of red balls desired)
    - $$p = \frac{6}{10} = 0.6$$ (probability of drawing a red ball)
    - $$q = 1 - 0.6 = 0.4$$ (probability of drawing a blue ball)

    **Step** $$2$$: Calculate using binomial distribution formula.

    <MathContainer>
    
      
      ```math
      b(3;5,0.6) = \binom{5}{3} (0.6)^3 (0.4)^2
      ```

    </MathContainer>

    Let's calculate $$\binom{5}{3}$$ first:

    
      
      ```math
      \binom{5}{3} = \frac{5!}{3! \cdot 2!} = \frac{5 \times 4}{2 \times 1} = 10
      ```

    Then:

    <MathContainer>
    
      
      ```math
      = 10 \times (0.6)^3 \times (0.4)^2
      ```

    
      
      ```math
      = 10 \times 0.216 \times 0.16 = 0.3456
      ```

    </MathContainer>

    Therefore, the probability of drawing exactly $$3$$ red balls is $$0.3456$$ or approximately $$34.6\%$$.

2. **Archer Problem Answer**

    **Step** $$1$$: Identify parameters.

    - $$n = 6$$ (number of shots)
    - $$x = 4$$ (number of targets desired)
    - $$p = 0.8$$ (probability of hitting target)
    - $$q = 0.2$$ (probability of missing)

    **Step** $$2$$: Calculate using binomial distribution formula.

    <MathContainer>
    
      
      ```math
      b(4;6,0.8) = \binom{6}{4} (0.8)^4 (0.2)^2
      ```

    </MathContainer>

    Let's calculate $$\binom{6}{4}$$ first:

    
      
      ```math
      \binom{6}{4} = \frac{6!}{4! \cdot 2!} = \frac{6 \times 5}{2 \times 1} = 15
      ```

    Then:

    <MathContainer>
    
      
      ```math
      = 15 \times (0.8)^4 \times (0.2)^2
      ```

    
      
      ```math
      = 15 \times 0.4096 \times 0.04 = 0.2458
      ```

    </MathContainer>

    Therefore, the probability of the archer hitting the target exactly $$4\text{ times}$$ is $$0.2458$$ or approximately $$24.6\%$$.

3. **Multiple Choice Exam Problem Answer**

    **Step** $$1$$: Identify parameters.

    - $$n = 8$$ (number of questions)
    - $$x = 2$$ (number of correct answers desired)
    - $$p = \frac{1}{4} = 0.25$$ (probability of answering correctly by guessing)
    - $$q = \frac{3}{4} = 0.75$$ (probability of answering incorrectly)

    **Step** $$2$$: Calculate using binomial distribution formula.

    <MathContainer>
    
      
      ```math
      b(2;8,0.25) = \binom{8}{2} (0.25)^2 (0.75)^6
      ```

    </MathContainer>

    Let's calculate $$\binom{8}{2}$$ first:

    
      
      ```math
      \binom{8}{2} = \frac{8!}{2! \cdot 6!} = \frac{8 \times 7}{2 \times 1} = 28
      ```

    Then:

    <MathContainer>
    
      
      ```math
      = 28 \times (0.25)^2 \times (0.75)^6
      ```

    
      
      ```math
      = 28 \times 0.0625 \times 0.178 = 0.3115
      ```

    </MathContainer>

    Therefore, the probability of the student answering exactly $$2$$ questions correctly is $$0.3115$$ or approximately $$31.2\%$$.

Visible text: 1. **Red Ball Problem Answer**

 **Step** : Identify parameters.

 - (number of draws)
 - (number of red balls desired)
 - (probability of drawing a red ball)
 - (probability of drawing a blue ball)

 **Step** : Calculate using binomial distribution formula.

 <MathContainer>
 
 

 </MathContainer>

 Let's calculate first:

 
 

 Then:

 <MathContainer>
 
 

 
 

 </MathContainer>

 Therefore, the probability of drawing exactly red balls is or approximately .

2. **Archer Problem Answer**

 **Step** : Identify parameters.

 - (number of shots)
 - (number of targets desired)
 - (probability of hitting target)
 - (probability of missing)

 **Step** : Calculate using binomial distribution formula.

 <MathContainer>
 
 

 </MathContainer>

 Let's calculate first:

 
 

 Then:

 <MathContainer>
 
 

 
 

 </MathContainer>

 Therefore, the probability of the archer hitting the target exactly is or approximately .

3. **Multiple Choice Exam Problem Answer**

 **Step** : Identify parameters.

 - (number of questions)
 - (number of correct answers desired)
 - (probability of answering correctly by guessing)
 - (probability of answering incorrectly)

 **Step** : Calculate using binomial distribution formula.

 <MathContainer>
 
 

 </MathContainer>

 Let's calculate first:

 
 

 Then:

 <MathContainer>
 
 

 
 

 </MathContainer>

 Therefore, the probability of the student answering exactly questions correctly is or approximately .