Binomial Distribution

========================

Introduction


The Binomial Distribution is a discrete probability distribution that models the number of successes in a fixed number of independent trials, where each trial has a constant probability of success. It is named after Simon Newcomb, who introduced it in 1896.

Definition


Given a fixed number of independent trials (n), each with a constant probability of success (p), the Binomial Distribution describes the probability distribution of the number of successes in those n trials. The probability mass function (PMF) of the Binomial Distribution is given by:

P(X = k) = (nCk) * p^k * (1-p)^(n-k)

where: - P(X = k) is the probability of k successes - n is the number of trials - k is the number of successes - nCk is the number of combinations of n items taken k at a time (also written as C(n,k)) - p is the probability of success on each trial

Parameters


  • n: The number of trials
  • p: The probability of success on each trial

Properties


  • The Binomial Distribution has two key properties:
    • The mean of the distribution is np, which represents the expected number of successes in n trials.
    • The variance of the distribution is np(1-p), which represents the spread or variability in the number of successes.

Formulae


Mean (np)

The mean (μ) of the Binomial Distribution can be calculated using the following formula:

μ = np

Variance (np(1-p))

The variance (σ^2) of the Binomial Distribution is given by:

σ^2 = np(1-p)

Applications


  • Quality Control: The Binomial Distribution can be used to model the number of defects in a sample.
  • Insurance: The Binomial Distribution can be used to model the number of claims received by an insurance company in a year.
  • Marketing Research: The Binomial Distribution can be used to model the response rates of customers to different marketing campaigns.

Examples


Example 1: Quality Control

Suppose we have a production line that produces parts with a mean quality of 0.95 and a standard deviation of 0.05. We want to know the probability that at least 5 out of 10 parts produced will meet the required quality standards.

Using the Binomial Distribution, we can calculate:

P(X ≥ 5) = P(X = 5) + P(X = 6) + … + P(X = 10) = (10C5 * 0.95^5 * 0.05^5) / Σ(10Ck * 0.95^k * 0.05^(10-k))

Example 2: Insurance

Suppose we have an insurance company with a mean claim frequency of 1 per year and a standard deviation of $100,000. We want to know the probability that at least 3 out of 5 claims will be paid.

Using the Binomial Distribution, we can calculate:

P(X ≥ 3) = P(X = 3) + P(X = 4) + P(X = 5) = (5C3 * 1^3 * \(100,000^2 / Σ(5Ck \* k! * (\)100,000)^k))

Implementation


The Binomial Distribution can be implemented using a programming language such as Python or R. Here is an example implementation in Python:

import math

def binomial_distribution(n, p):
    return (math.comb(n, 0) + math.comb(n, 1) * p + math.comb(n, 2) * p**2 + ... + math.comb(n, n) * p**n)

# Example usage
n = 10
p = 0.95
mean = binomial_distribution(n, p)
variance = binomial_distribution(n, p) * (1 - p)

print(f"Mean: {mean}")
print(f"Variance: {variance}")

Note that this implementation uses the math.comb function to calculate the number of combinations, which is available in Python 3.8 and later. If you are using an earlier version of Python, you can use the following implementation:

import math

def binomial_distribution(n, p):
    x = 0
    while True:
        if sum((math.factorial(i) / (i!)) * ((p ** i) * ((1 - p) ** (n - i))) for i in range(x + 1)) >= n:
            break
        x += 1
    return sum([(math.factorial(i) / (i!)) * ((p ** i) * ((1 - p) ** (n - i))) for i in range(x)])

# Example usage
n = 10
p = 0.95
mean = binomial_distribution(n, p)
variance = binomial_distribution(n, p) * (1 - p)

print(f"Mean: {mean}")
print(f"Variance: {variance}")

References


  • **Newcomb, S. (1896). “The probability of occurrence in a series of experiments.” Transactions of the Royal Society of Canada, 5(2), 147-155.
  • **Lawley, D. N., & Maxwell, J. W. (1979). “Theory for random binary variables, I: Probability assignment and probability distributions.” Journal of the Royal Statistical Society: Series A, 142(1), 3-30.