Probability Distributions › The Binomial Distribution

Michael BrenndoerferMay 13, 20252 min read
Machine Learning from ScratchAll chapters
Part 1 of 9Statistics 101
Chapter 7Probability Distributions › The Binomial Distribution
Reading section 5 of 13 · The Binomial Distribution · 2 minSection 5 of 13 · 2 min

Book contents

Section 5 of 13 · 2 min read

Probability Distributions › The Binomial DistributionOne section · Sections in this chapter5 / 13 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Many practical problems involve counting successes in a fixed number of independent trials, each with the same probability of success. The binomial distribution provides the exact probability model for such scenarios, making it essential for analyzing binary outcomes and discrete event counts.

The probability mass function for the binomial distribution is:

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

Where:

  • XX: The number of successes
  • nn: The number of trials
  • kk: The specific number of successes (0, 1, 2, ..., n)
  • pp: The probability of success on each trial
  • (nk)=n!k!(n−k)!\binom{n}{k} = \frac{n!}{k!(n-k)!}: The binomial coefficient

The binomial distribution applies whenever we can frame a problem as repeated independent Bernoulli trials: experiments with exactly two possible outcomes. Quality control scenarios offer clear examples: if a manufacturing process produces defective items with probability pp, the number of defects in a batch of nn items follows a binomial distribution. Similarly, in A/B testing for web applications, the number of users who click a button out of nn visitors follows a binomial distribution if we assume independence between user actions.

Understanding the binomial distribution enables practitioners to calculate precise probabilities for discrete outcomes. For instance, if a website's conversion rate is 5%, we can determine the probability that exactly 3 out of 20 visitors make a purchase, or the probability that at least 2 visitors convert. These calculations inform decision-making about sample sizes, detection of anomalies, and assessment of whether observed conversion rates differ significantly from historical baselines.

Example: Binomial Distribution Visualization

Out[4]:
Visualization
Bar chart showing binomial distribution with n=20, p=0.3.
Binomial distribution with n=20 trials and success probability p=0.3. This discrete distribution shows the probability of observing exactly k successes out of 20 independent trials. The distribution is slightly right-skewed when p ≠ 0.5, with the most likely outcome around np=6 successes.