🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
💼 Servicesℹ️ About✉️ ContactView Pricing Plansfrom $10

Binomial Distribution — Count of Successes in n Trials

Foundations of StatisticsProbability Distributions🟢 Free Lesson

Binomial Distribution

Probability Distributions

Counting Successes in Fixed Trials

The binomial distribution answers a simple but profound question: if I repeat the same experiment times, how many times will I succeed?

  • Quality control — number of defective items in a batch of 100
  • Medical trials — patients responding to treatment out of 50 enrolled
  • Finance — days the market goes up out of 252 trading days
  • A/B testing — conversions out of 1,000 visitors

The binomial is the bridge between individual probability and aggregate statistics.


The Bernoulli Trial

Definition

A Bernoulli trial is a random experiment with exactly two outcomes: success (with probability ) and failure (with probability ). A random variable representing a single trial has:

This is the Bernoulli distribution: .


From Bernoulli to Binomial

Definition

Let be i.i.d. Bernoulli() random variables. The binomial random variable counts the total number of successes:

We write .


Derivation of Mean and Variance

The variance is maximized when , giving .


Generating Function

The MGF is , from which all moments can be derived.


Normal Approximation to the Binomial

Rule of thumb: The normal approximation is adequate when and .

Continuity correction:


Poisson Approximation

When is large and is small (with fixed):

The Poisson approximation is appropriate when and , or and .


Worked Example: Quality Control


Worked Example: Coin Flipping


Worked Example: A/B Testing


Relationship to Other Distributions

DistributionRelationship to Binomial
BernoulliSpecial case:
PoissonLimit as , ,
NormalLimit as , ,
Negative BinomialCounts trials until successes (different parameterization)
HypergeometricSampling without replacement (vs. with replacement for binomial)

Python Implementation

python
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt

np.random.seed(42)

# Binomial distribution: n=20, p=0.4
n, p = 20, 0.4
x = np.arange(0, n+1)
pmf = stats.binom.pmf(x, n, p)

print(f"Binomial(n={n}, p={p})")
print(f"Mean:     {stats.binom.mean(n, p):.1f}")
print(f"Variance: {stats.binom.var(n, p):.2f}")
print(f"Std Dev:  {stats.binom.std(n, p):.2f}")
print(f"P(X=8):   {stats.binom.pmf(8, n, p):.4f}")
print(f"P(X<=8):  {stats.binom.cdf(8, n, p):.4f}")

# Normal approximation comparison
mu, sigma = n*p, np.sqrt(n*p*(1-p))
x_norm = np.linspace(0, n, 100)
pdf_norm = stats.norm.pdf(x_norm, mu, sigma)

fig, axes = plt.subplots(1, 2, figsize=(12, 5))

# PMF vs normal approximation
axes[0].bar(x, pmf, alpha=0.7, label=f'Binomial({n},{p})')
axes[0].plot(x_norm, pdf_norm, 'r-', lw=2, label=f'Normal({mu:.1f},{sigma:.2f})')
axes[0].set_xlabel('k')
axes[0].set_ylabel('P(X=k)')
axes[0].set_title('Binomial vs Normal Approximation')
axes[0].legend()

# Effect of p
for p_val, color in [(0.2, '#ef4444'), (0.5, '#6366f1'), (0.8, '#22c55e')]:
    pmf_p = stats.binom.pmf(x, n, p_val)
    axes[1].bar(x, pmf_p, alpha=0.6, label=f'p={p_val}', color=color)
axes[1].set_xlabel('k')
axes[1].set_ylabel('P(X=k)')
axes[1].set_title('Effect of Success Probability')
axes[1].legend()

plt.tight_layout()
plt.savefig('binomial_distribution.png', dpi=150)
plt.show()

Key Takeaways

Counts successes in independent Bernoulli trials:

PMF: ,

Mean: ; Variance:

Normal approximation valid when and (with continuity correction)

Poisson approximation valid when is large and is small

The binomial is the foundation of hypothesis testing for proportions and confidence intervals

"The binomial distribution is the discrete analog of the normal distribution — and like the normal, it appears everywhere."


Extended Learning: Beyond the Basics

Key Concepts Summary

This lesson covers fundamental concepts that serve as building blocks for more advanced topics. Master these basics before moving to intermediate and advanced material.

Prerequisite Knowledge

Before studying this topic in depth, ensure you understand:

  • Basic definitions and terminology
  • Core formulas and their derivations
  • Common applications in real-world scenarios
  • Typical pitfalls and misconceptions

Step-by-Step Walkthrough

Let us work through a complete example to solidify understanding:

Step 1: Identify the problem type. Determine which category this problem falls into and which approach is most appropriate.

Step 2: Apply the relevant formula. Substitute known values into the appropriate equation, paying attention to units and constraints.

Step 3: Simplify and solve. Work through the algebra step by step, checking each intermediate result.

Step 4: Verify the answer. Check that the solution satisfies the original conditions and makes logical sense.

Common Mistakes to Avoid

  1. Misidentifying the problem type — Always start by categorizing the problem
  2. Incorrect formula application — Verify the formula applies to your specific case
  3. Unit errors — Always check units are consistent throughout
  4. Sign errors — Pay careful attention to positive and negative values
  5. Rounding too early — Keep full precision until the final answer
  6. Forgetting constraints — Check that solutions satisfy all given conditions

Real-World Applications

Understanding this concept is essential for:

  • Advanced problem solving in examinations
  • Building intuition for more complex topics
  • Developing analytical thinking skills
  • Applying mathematical reasoning to practical situations

Practice Exercises

  1. Basic: Solve 5 problems of increasing difficulty using the core concept.
  2. Intermediate: Apply the concept to word problems with multiple steps.
  3. Advanced: Combine this concept with 2-3 other topics in a comprehensive problem.
  4. Challenge: Create your own problem that requires this concept plus additional knowledge.

Interview and Exam Tips

  • Common question patterns: Identify which exam or interview formats test this topic
  • Time management: Practice completing problems within time constraints
  • Common traps: Know the typical mistakes examiners set as distractors
  • Verification strategy: Develop a quick method to check your answer

Related Topics

Quick Reference Card

ConceptFormula/RuleKey InsightCommon Use
Core DefinitionSee main textUnderstand the intuitionFoundation for all applications
Key FormulaSee main textMemorize the derivationDirect problem solving
Special CaseSee main textRecognize when it appliesSimplifies complex problems
Edge CaseSee main textKnow the limitationsAvoids errors

Further Reading

For students who want to go deeper:

  • Standard textbooks on the subject
  • Research papers applying this concept
  • Online courses with video explanations
  • Practice problem collections with detailed solutions
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-11-14

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert Statistics Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement