Probability
2. Discrete Distributions
Binomial Distribution

Binomial Distribution

🎲

The Binomial distribution models the total number of "Successes" in a fixed number of independent Bernoulli trials.

If you take a Bernoulli experiment (like flipping a coin) and repeat it nn times, and count up the total number of successes, you get a Binomial distribution.

Core Concepts

If a random variable XX follows a Binomial distribution, we write:

X∼Binomial(n,p)X \sim \text{Binomial}(n, p)

Where:

  • nn is the total number of identical, independent trials.
  • pp is the probability of success on any single trial.

Probability Mass Function (PMF)

The probability of observing exactly kk successes out of nn trials is given by:

P(X=k)=(nk)pk(1−p)n−kP(X = k) = \binom{n}{k} p^k (1 - p)^{n - k}

Let's break down this formula:

  • (nk)\binom{n}{k}: The "Binomial Coefficient" (read as "nn choose kk"). It calculates the number of different ways you can arrange kk successes within nn trials.
  • pkp^k: The probability of getting exactly kk successes.
  • (1−p)n−k(1 - p)^{n - k}: The probability of getting n−kn - k failures.

Key Metrics

  • Expected Value (Mean): E[X]=npE[X] = np
    • (Intuition: If you flip a coin 100 times, and the chance of heads is 0.5, you expect 100×0.5=50100 \times 0.5 = 50 heads).
  • Variance: Var(X)=np(1−p)\text{Var}(X) = np(1 - p)

Real-World Examples

  1. E-commerce Conversion: Out of 500 visitors to a website (n=500n=500), if the conversion rate is 2% (p=0.02p=0.02), what is the probability that exactly 15 people buy something?
  2. Manufacturing: In a batch of 1000 computer chips, where the defect rate is 0.1%, how many defects do we expect to find?

Interactive Visualization

👀

Watch the magic happen! Use the sliders below to explore how the shape of the Binomial distribution changes.

  • Notice the Central Limit Theorem: If you keep p=0.5p = 0.5 and slide nn all the way up to 100100, watch the discrete bars perfectly form the shape of a continuous Normal bell curve!
  • Notice Skewness: Set n=20n = 20 and p=0.1p = 0.1. The distribution is heavily right-skewed. But as you increase nn, it will slowly become symmetrical again.

Binomial Distribution

Number of successes in n independent trials (each success with probability p).

Number of Trials (n)
20
Probability of Success (p)
0.50

Test Your Knowledge

Example: Binomial Probabilities

A manufacturing process produces defective parts 10% of the time (p=0.1p=0.1). If you randomly inspect 5 parts (n=5n=5), what is the probability of finding exactly 2 defective parts?

View Step-by-Step Solution

This is a Binomial setting. We use the formula: P(X=k)=(nk)pk(1−p)n−kP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}

  • n=5n = 5
  • k=2k = 2
  • p=0.1p = 0.1
  • 1−p=0.91-p = 0.9

(52)=5!2!(3!)=10\binom{5}{2} = \frac{5!}{2!(3!)} = 10

P(X=2)=10×(0.1)2×(0.9)3P(X=2) = 10 \times (0.1)^2 \times (0.9)^3 P(X=2)=10×0.01×0.729=0.0729P(X=2) = 10 \times 0.01 \times 0.729 = 0.0729

There is a 7.29% chance of finding exactly 2 defective parts.