# Nakafa Framework: LLM

URL: /en/subject/high-school/12/mathematics/data-analysis-probability/binomial-distribution-function
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/high-school/12/mathematics/data-analysis-probability/binomial-distribution-function/en.mdx

Output docs content for large language models.

---

export const metadata = {
    title: "Binomial Distribution Function",
    description: "Learn binomial distribution formula with step-by-step examples. Calculate probability of success in repeated trials with coin flips and practice problems.",
    authors: [{ name: "Nabil Akbarazzima Fatih" }],
    date: "05/26/2025",
    subject: "Data Analysis and Probability",
};

## 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.

## Combination and Basic Probability

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

First, the combination formula for selecting objects:

<BlockMath math="C_k^n = \binom{n}{k} = \frac{n!}{k!(n-k)!}" />

Second, factorial (sequential multiplication):

<BlockMath math="n! = n \times (n-1) \times ... \times 3 \times 2 \times 1" />

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

<BlockMath math="P(A) + P(A^c) = 1" />

where <InlineMath math="P(A)" /> is the probability of an event occurring and <InlineMath math="P(A^c)" /> 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 <InlineMath math="p" /> and probability of failure <InlineMath math="q = 1 - p" />, then the formula to calculate the probability of getting exactly <InlineMath math="x" /> successes in <InlineMath math="n" /> independent experiments is:

<BlockMath math="b(x;n,p) = \binom{n}{x} p^x q^{n-x} \text{ for } x = 0,1,2,...,n" />

Where:

- <InlineMath math="n" /> = number of experiments performed

- <InlineMath math="x" /> = number of successes we want

- <InlineMath math="p" /> = probability of success in one experiment

- <InlineMath math="q = 1-p" /> = 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 <InlineMath math="S = \{H,T\}" />. 

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

**Problem:** If we flip this coin <InlineMath math="7" /> times in a row, what's the probability of getting tails exactly <InlineMath math="5" /> times?

**Solution:**

First, let's identify the parameters:
- <InlineMath math="n = 7" /> (number of flips)
- <InlineMath math="x = 5" /> (number of tails desired)  
- <InlineMath math="p = \frac{1}{2}" /> (probability of getting tails)
- <InlineMath math="q = \frac{1}{2}" /> (probability of getting heads)

Now we use the binomial distribution formula:

<div className="flex flex-col gap-4">
<BlockMath math="b(5;7,\frac{1}{2}) = \binom{7}{5} \left(\frac{1}{2}\right)^5 \left(\frac{1}{2}\right)^{7-5}" />

<BlockMath math="= \binom{7}{5} \left(\frac{1}{2}\right)^5 \left(\frac{1}{2}\right)^2" />

<BlockMath math="= \binom{7}{5} \left(\frac{1}{2}\right)^7" />
</div>

Let's calculate <InlineMath math="\binom{7}{5}" /> first:

<div className="flex flex-col gap-4">
<BlockMath math="\binom{7}{5} = \frac{7!}{5!(7-5)!} = \frac{7!}{5! \cdot 2!}" />

<BlockMath math="= \frac{7 \times 6 \times 5!}{5! \times 2 \times 1} = \frac{7 \times 6}{2} = \frac{42}{2} = 21" />
</div>

So the complete calculation is:

<div className="flex flex-col gap-4">
<BlockMath math="b(5;7,\frac{1}{2}) = 21 \times \frac{1}{2^7} = 21 \times \frac{1}{128} = \frac{21}{128}" />
</div>

Therefore, the probability of getting <InlineMath math="5" /> tails in <InlineMath math="7" /> flips is <InlineMath math="\frac{21}{128}" /> or approximately <InlineMath math="16.4\%" />.

## Practice Problems

1. In a bag there are <InlineMath math="10" /> balls that are exactly the same, except for their color: <InlineMath math="6" /> red balls and <InlineMath math="4" /> blue balls. If we draw <InlineMath math="5" /> balls one by one with replacement (each drawn ball is returned), what's the probability of drawing exactly <InlineMath math="3" /> red balls?

2. An archer has an accuracy rate of <InlineMath math="80\%" /> for hitting targets. If he shoots <InlineMath math="6" /> times, what's the probability he hits the target exactly <InlineMath math="4" /> times?

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

### Answer Key

1. **Red Ball Problem Answer**

    **Step 1: Identify parameters.**
    
    - <InlineMath math="n = 5" /> (number of draws)
    - <InlineMath math="x = 3" /> (number of red balls desired)
    - <InlineMath math="p = \frac{6}{10} = 0.6" /> (probability of drawing a red ball)
    - <InlineMath math="q = 1 - 0.6 = 0.4" /> (probability of drawing a blue ball)

    **Step 2: Calculate using binomial distribution formula.**
    
    <div className="flex flex-col gap-4">
    <BlockMath math="b(3;5,0.6) = \binom{5}{3} (0.6)^3 (0.4)^2" />
    </div>
    
    Let's calculate <InlineMath math="\binom{5}{3}" /> first:

    <BlockMath math="\binom{5}{3} = \frac{5!}{3! \cdot 2!} = \frac{5 \times 4}{2 \times 1} = 10" />
    
    Then:
    
    <div className="flex flex-col gap-4">
    <BlockMath math="= 10 \times (0.6)^3 \times (0.4)^2" />
    
    <BlockMath math="= 10 \times 0.216 \times 0.16 = 0.3456" />
    </div>
    
    Therefore, the probability of drawing exactly <InlineMath math="3" /> red balls is <InlineMath math="0.3456" /> or approximately <InlineMath math="34.6\%" />.

2. **Archer Problem Answer**

    **Step 1: Identify parameters.**
    
    - <InlineMath math="n = 6" /> (number of shots)
    - <InlineMath math="x = 4" /> (number of targets desired)
    - <InlineMath math="p = 0.8" /> (probability of hitting target)
    - <InlineMath math="q = 0.2" /> (probability of missing)

    **Step 2: Calculate using binomial distribution formula.**
    
    <div className="flex flex-col gap-4">
    <BlockMath math="b(4;6,0.8) = \binom{6}{4} (0.8)^4 (0.2)^2" />
    </div>
    
    Let's calculate <InlineMath math="\binom{6}{4}" /> first:
    
    <BlockMath math="\binom{6}{4} = \frac{6!}{4! \cdot 2!} = \frac{6 \times 5}{2 \times 1} = 15" />
    
    Then:

    <div className="flex flex-col gap-4">
    <BlockMath math="= 15 \times (0.8)^4 \times (0.2)^2" />
    
    <BlockMath math="= 15 \times 0.4096 \times 0.04 = 0.2458" />
    </div>
    
    Therefore, the probability of the archer hitting the target exactly <InlineMath math="4" /> times is <InlineMath math="0.2458" /> or approximately <InlineMath math="24.6\%" />.

3. **Multiple Choice Exam Problem Answer**

    **Step 1: Identify parameters.**
    
    - <InlineMath math="n = 8" /> (number of questions)
    - <InlineMath math="x = 2" /> (number of correct answers desired)
    - <InlineMath math="p = \frac{1}{4} = 0.25" /> (probability of answering correctly by guessing)
    - <InlineMath math="q = \frac{3}{4} = 0.75" /> (probability of answering incorrectly)

    **Step 2: Calculate using binomial distribution formula.**
    
    <div className="flex flex-col gap-4">
    <BlockMath math="b(2;8,0.25) = \binom{8}{2} (0.25)^2 (0.75)^6" />
    </div>
    
    Let's calculate <InlineMath math="\binom{8}{2}" /> first:

    <BlockMath math="\binom{8}{2} = \frac{8!}{2! \cdot 6!} = \frac{8 \times 7}{2 \times 1} = 28" />
    
    Then:

    <div className="flex flex-col gap-4">
    <BlockMath math="= 28 \times (0.25)^2 \times (0.75)^6" />
    
    <BlockMath math="= 28 \times 0.0625 \times 0.178 = 0.3115" />
    </div>
    
    Therefore, the probability of the student answering exactly <InlineMath math="2" /> questions correctly is <InlineMath math="0.3115" /> or approximately <InlineMath math="31.2\%" />.