1. Introduction to Binomial Distribution

The Binomial distribution is one of the most frequently used discrete probability distributions. It describes the number of “successes” in a fixed number of independent trials, where each trial has the same probability of success.

1.1 Bernoulli Trials

To understand the Binomial distribution, we must first define a Bernoulli Trial. A Bernoulli trial is a random experiment with exactly two possible outcomes: 1. Success (S): Usually denoted by 1. 2. Failure (F): Usually denoted by 0.

Examples: * Tossing a coin (Heads or Tails). * Testing a product (Defective or Non-defective). * A medical treatment (Patient recovers or does not recover).

1.2 Criteria for a Binomial Experiment

A random experiment is considered Binomial if it satisfies the following four conditions (BINS): 1. Binary: Outcomes are either success or failure. 2. Independent: The outcome of one trial does not affect another. 3. Number: There is a fixed number of trials (\(n\)). 4. Success: The probability of success (\(p\)) is the same for each trial.


2. The Probability Mass Function (PMF)

If \(X\) is a random variable following a Binomial distribution, we denote it as: \[X \sim B(n, p)\]

The probability of getting exactly \(k\) successes in \(n\) trials is given by the formula:

\[P(X = k) = \binom{n}{k} p^k (1-p)^{n-k}\]

Where: * \(n\): Total number of trials. * \(k\): Number of successes (\(k = 0, 1, 2, ..., n\)). * \(p\): Probability of success on a single trial. * \((1-p) = q\): Probability of failure. * \(\binom{n}{k} = \frac{n!}{k!(n-k)!}\): The binomial coefficient (“n choose k”).


3. Key Properties

For a Binomial distribution \(X \sim B(n, p)\):


4. Visualizing the Distribution

The shape of the Binomial distribution depends on the values of \(n\) and \(p\).

Observations: * When p < 0.5, the distribution is skewed to the right. * When p = 0.5, the distribution is perfectly symmetric. * When p > 0.5, the distribution is skewed to the left.


5. Using R for Binomial Calculations

R provides four essential functions for the Binomial distribution:

  1. dbinom(k, n, p): Probability Mass Function \(P(X = k)\).
  2. pbinom(k, n, p): Cumulative Distribution Function \(P(X \le k)\).
  3. qbinom(q, n, p): Quantile function (finds \(k\) such that \(P(X \le k) = q\)).
  4. rbinom(m, n, p): Generates \(m\) random variables from the distribution.

Example Code:

n_val <- 10
p_val <- 0.3

# Probability of exactly 3 successes
dbinom(3, size = n_val, prob = p_val)
## [1] 0.2668279
# Probability of 3 or fewer successes P(X <= 3)
pbinom(3, size = n_val, prob = p_val)
## [1] 0.6496107

6. Real-Life Examples

Example 1: Quality Control

A factory produces light bulbs with a 5% defect rate (\(p = 0.05\)). If a sample of 10 bulbs is chosen at random, what is the probability that exactly 2 are defective?

Calculation: \(n = 10, k = 2, p = 0.05\)

dbinom(2, 10, 0.05)
## [1] 0.0746348

Example 2: Digital Marketing

An email marketing campaign has a click-through rate (CTR) of 10%. If you send the email to 50 leads, what is the probability that more than 10 people click the link?

Calculation: We need \(P(X > 10)\), which is \(1 - P(X \le 10)\).

1 - pbinom(10, 50, 0.10)
## [1] 0.009354602

Example 3: Healthcare

A new drug has an 80% success rate in treating a specific condition. If 15 patients are treated, what is the expected number of recoveries?

Calculation: \(\mu = np = 15 \times 0.8 = 12\) The expected number of recoveries is 12.


7. Practice Problems

  1. A fair die is rolled 12 times. What is the probability of rolling exactly four 6s?
  2. Suppose a multiple-choice test has 20 questions. Each question has 4 options (only one correct). If a student guesses randomly, what is the probability of passing (scoring 10 or more)?
  3. Calculate the variance of a Binomial distribution where \(n=100\) and \(p=0.25\).

8. Summary Table

Feature Description
Parameters \(n\) (trials), \(p\) (probability of success)
Support \(k \in \{0, 1, 2, ..., n\}\)
Symmetry Symmetric if \(p=0.5\)
R Function (PMF) dbinom()
R Function (CDF) pbinom()

```

How to use this:

  1. Install RStudio.
  2. Create a new file: File -> New File -> R Markdown...
  3. Delete the default content and paste the code above.
  4. Click the Knit button in the toolbar.

Why this is effective:

  • Dynamic Graphics: The R code automatically generates the plots explaining the influence of \(p\).
  • Mathematical Notation: Uses LaTeX for clear formulas.
  • Reproducibility: Students can run the R code snippets themselves to verify the examples.