1. Introduction to Bernoulli Trials

Before understanding the Binomial Distribution, we must define its building block: the Bernoulli Trial.

A Bernoulli trial is a random experiment with exactly two possible outcomes: * Success (S): The outcome we are interested in (coded as 1). * Failure (F): The opposite outcome (coded as 0).

Examples: * Tossing a coin (Heads or Tails). * Testing a lightbulb (Working or Defective). * A customer making a purchase (Yes or No).


2. The Binomial Distribution Defined

The Binomial distribution represents the number of “Successes” in a fixed number of independent Bernoulli trials.

The Four Conditions (B.I.N.S.)

To use the Binomial model, four conditions must be met: 1. Binary: There are only two possible outcomes for each trial. 2. Independent: The outcome of one trial does not affect the others. 3. Number: The number of trials (\(n\)) is fixed in advance. 4. Success: The probability of success (\(p\)) is the same for each trial.

Mathematical Formula

The probability of getting exactly \(k\) successes in \(n\) trials is given by the Probability Mass Function (PMF):

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

Where: * \(\binom{n}{k} = \frac{n!}{k!(n-k)!}\) (The number of ways to arrange \(k\) successes) * \(p\) = Probability of success * \(1-p\) = Probability of failure (\(q\)) * \(n\) = Number of trials * \(k\) = Number of observed successes (\(k = 0, 1, 2, ..., n\))


3. Key Properties


4. Real-Life Examples

Example A: Quality Control (Manufacturing)

A factory produces LEDs, and 5% of them are defective. If a random sample of 10 LEDs is chosen, what is the probability that exactly 2 are defective?

  • \(n = 10\)
  • \(p = 0.05\)
  • \(k = 2\)
# Using R to calculate P(X = 2)
dbinom(x = 2, size = 10, prob = 0.05)
## [1] 0.0746348

Example B: Email Marketing (Business)

An e-commerce company finds that 15% of people who receive a promotional email make a purchase. If they send the email to 20 people, what is the probability that at most 3 people make a purchase?

  • \(n = 20\)
  • \(p = 0.15\)
  • \(k \le 3\)
# pbinom calculates cumulative probability P(X <= k)
pbinom(q = 3, size = 20, prob = 0.15)
## [1] 0.6477252

Example C: Healthcare (Clinical Trials)

A new drug has an 80% success rate in treating a specific symptom. If 15 patients are treated, what is the probability that more than 12 patients recover?

  • \(n = 15\)
  • \(p = 0.80\)
  • \(P(X > 12) = 1 - P(X \le 12)\)
# Using lower.tail = FALSE to get P(X > 12)
pbinom(q = 12, size = 15, prob = 0.80, lower.tail = FALSE)
## [1] 0.3980232

5. Visualizing the Distribution in R

As \(n\) increases or \(p\) gets closer to 0.5, the Binomial distribution begins to look more “Normal” (bell-shaped).

# Parameters
n_val <- 50
p_val <- 0.3

# Data frame for plotting
df <- data.frame(
  successes = 0:n_val,
  probability = dbinom(0:n_val, size = n_val, prob = p_val)
)

ggplot(df, aes(x = successes, y = probability)) +
  geom_bar(stat = "identity", fill = "steelblue", color = "white") +
  labs(title = paste("Binomial Distribution (n =", n_val, ", p =", p_val, ")"),
       x = "Number of Successes",
       y = "Probability") +
  theme_minimal()


6. Summary Table of R Functions

Function Purpose Example
dbinom() Probability Mass Function (finds \(P(X = k)\)) dbinom(2, 10, 0.5)
pbinom() Cumulative Distribution (finds \(P(X \le k)\)) pbinom(2, 10, 0.5)
qbinom() Quantile function (finds \(k\) for a given percentile) qbinom(0.95, 10, 0.5)
rbinom() Generate random numbers from a binomial dist. rbinom(5, 10, 0.5)

7. Practice Problems

  1. Sports: A basketball player has a 70% free-throw success rate. If he takes 10 shots, what is the probability he makes at least 8?
  2. IT/Security: A server has a 0.01 probability of failing on any given day. What is the probability that it survives an entire 30-day month without failing?
  3. Human Resources: 10% of applicants for a job are overqualified. If you interview 12 random applicants, what is the expected number (\(\mu\)) of overqualified candidates?

```