Binomial Distribution Solved Examples: LLM & AI Probability

Master the binomial distribution with 12.6 solved examples. Learn to apply the formula in LLM, AI, and machine learning probability problems with step-by-step guides.

12.6 Solved Examples of Binomial Distribution

Understanding how to apply the binomial distribution formula is crucial for effectively solving real-world probability problems. Below are two detailed examples demonstrating step-by-step calculations.

The binomial distribution is used when there are a fixed number of independent trials, each trial has only two possible outcomes (success or failure), and the probability of success remains constant for each trial.

The formula for the binomial probability is:

$P(X = k) = \binom{n}{k} \cdot p^k \cdot (1-p)^{n-k}$

Where:

  • $P(X = k)$: The probability of getting exactly $k$ successes.
  • $n$: The total number of trials.
  • $k$: The number of desired successes.
  • $p$: The probability of success on a single trial.
  • $(1-p)$: The probability of failure on a single trial (often denoted as $q$).
  • $\binom{n}{k}$: The binomial coefficient, which represents the number of ways to choose $k$ successes from $n$ trials. It is calculated as $\frac{n!}{k!(n-k)!}$.

Example 1: Probability of Getting a Specific Number of Successes

Problem: A biased coin lands on heads with a probability of 0.7. If the coin is flipped 5 times, what is the probability of getting exactly 3 heads?

Solution:

First, let's identify the parameters of the binomial distribution for this problem:

  • Number of trials ($n$): The coin is flipped 5 times, so $n = 5$.
  • Probability of success ($p$): The probability of getting heads (our defined "success") is 0.7, so $p = 0.7$.
  • Probability of failure ($q$): The probability of not getting heads (i.e., getting tails) is $1 - p = 1 - 0.7 = 0.3$.
  • Desired number of successes ($k$): We want to find the probability of getting exactly 3 heads, so $k = 3$.

Now, we apply the binomial distribution formula:

$P(X = k) = \binom{n}{k} \cdot p^k \cdot q^{n-k}$

Substitute the values:

$P(X = 3) = \binom{5}{3} \cdot (0.7)^3 \cdot (0.3)^{5-3}$ $P(X = 3) = \binom{5}{3} \cdot (0.7)^3 \cdot (0.3)^2$

Calculate the binomial coefficient $\binom{5}{3}$: $\binom{5}{3} = \frac{5!}{3!(5-3)!} = \frac{5!}{3!2!} = \frac{5 \times 4 \times 3 \times 2 \times 1}{(3 \times 2 \times 1)(2 \times 1)} = \frac{5 \times 4}{2 \times 1} = 10$

Now, calculate the powers: $(0.7)^3 = 0.343$ $(0.3)^2 = 0.09$

Substitute these back into the formula: $P(X = 3) = 10 \cdot 0.343 \cdot 0.09$ $P(X = 3) = 10 \cdot 0.03087$ $P(X = 3) = 0.3087$

Answer: The probability of getting exactly 3 heads in 5 coin tosses is approximately 0.3087.


Example 2: Probability of Getting At Least a Certain Number of Correct Answers

Problem: A student guesses on a multiple-choice test where each question has 5 options. If the student answers 10 questions, what is the probability of getting at least 7 answers correct?

Solution:

Let's identify the parameters for this problem:

  • Number of trials ($n$): The student answers 10 questions, so $n = 10$.
  • Probability of success ($p$): For each question, there is 1 correct option out of 5. So, the probability of a correct guess is $p = \frac{1}{5} = 0.2$.
  • Probability of failure ($q$): The probability of an incorrect guess is $1 - p = 1 - 0.2 = 0.8$.
  • Desired number of successes: We want to find the probability of getting at least 7 correct answers. This means we need to calculate the probability of getting 7, 8, 9, or 10 correct answers.

We need to calculate $P(X \geq 7)$, which is the sum of the probabilities for $k=7, 8, 9,$ and $10$:

$P(X \geq 7) = P(X = 7) + P(X = 8) + P(X = 9) + P(X = 10)$

We will calculate each of these probabilities using the binomial formula $P(X = k) = \binom{n}{k} \cdot p^k \cdot q^{n-k}$.

Step 1: Calculate $P(X = 7)$ $n=10, k=7, p=0.2, q=0.8$

$\binom{10}{7} = \frac{10!}{7!3!} = \frac{10 \times 9 \times 8}{3 \times 2 \times 1} = 10 \times 3 \times 4 = 120$ $P(X = 7) = 120 \cdot (0.2)^7 \cdot (0.8)^3$ $P(X = 7) = 120 \cdot (0.0000128) \cdot (0.512)$ $P(X = 7) = 120 \cdot 0.0000065536 \approx 0.000786432$

Step 2: Calculate $P(X = 8)$ $n=10, k=8, p=0.2, q=0.8$

$\binom{10}{8} = \frac{10!}{8!2!} = \frac{10 \times 9}{2 \times 1} = 45$ $P(X = 8) = 45 \cdot (0.2)^8 \cdot (0.8)^2$ $P(X = 8) = 45 \cdot (0.00000256) \cdot (0.64)$ $P(X = 8) = 45 \cdot 0.0000016384 \approx 0.000073728$

Step 3: Calculate $P(X = 9)$ $n=10, k=9, p=0.2, q=0.8$

$\binom{10}{9} = \frac{10!}{9!1!} = 10$ $P(X = 9) = 10 \cdot (0.2)^9 \cdot (0.8)^1$ $P(X = 9) = 10 \cdot (0.000000512) \cdot (0.8)$ $P(X = 9) = 10 \cdot 0.0000004096 \approx 0.000004096$

Step 4: Calculate $P(X = 10)$ $n=10, k=10, p=0.2, q=0.8$

$\binom{10}{10} = \frac{10!}{10!0!} = 1$ $P(X = 10) = 1 \cdot (0.2)^{10} \cdot (0.8)^0$ $P(X = 10) = 1 \cdot (0.0000001024) \cdot 1$ $P(X = 10) \approx 0.0000001024$

Step 5: Add all probabilities $P(X \geq 7) \approx 0.000786432 + 0.000073728 + 0.000004096 + 0.0000001024$ $P(X \geq 7) \approx 0.0008643584$

Rounding to a more practical number of decimal places: $P(X \geq 7) \approx 0.000864$

Answer: The probability of guessing at least 7 correct answers out of 10 questions is approximately 0.000864. This is a very low probability, indicating that randomly guessing on this test is unlikely to result in a high number of correct answers.


Conclusion

These examples illustrate the practical application of the binomial distribution formula. Whether calculating the probability of a specific outcome in a coin toss experiment or determining the likelihood of achieving a certain number of correct answers on a multiple-choice test, understanding and applying this formula allows for accurate statistical predictions in scenarios involving repeated, independent trials with two possible outcomes.