Binomial Distribution, R Syntax, and Applications in Probability
R Functions for Binomial Distribution: dbinom, pbinom, and choose
dbinom(k, n, p): Calculates the exact probability (probability mass function) of obtaining exactly successes in independent trials with individual trial success probability .- Mathematical Representation:
- Parameter Structure: First parameter (or ) represents the target number of successes; second parameter represents total trials; third parameter represents individual success probability.
pbinom(k, n, p): Calculates the cumulative probability (cumulative distribution function) of obtaining or fewer successes () across independent trials with success probability .- Mathematical Representation:
- Relationship to
dbinom:pbinomsums individualdbinomprobabilities from zero up to :
choose(n, k): Computes the binomial coefficient , which counts the number of distinct ways to choose items from a set of items.- Parameter Structure: First parameter is the total set size ; second parameter is the chosen subset size .
- Example: Selecting individuals from a group of people is written as
choose(10, 4).
RStudio Interface Assistance:
- Typing an open parenthesis
(afterdbinom,pbinom, orchoosedisplays a tooltip context menu showing required arguments. - The parameter or represents the changing number of successes.
- Typing an open parenthesis
Mathematical Logic of Binomial CDF and Complementary Probabilities
Lower-End vs. Upper-End Probability Computations:
pbinominherently evaluates the lower tail of the distribution, .- Upper-tail probabilities (e.g., , representing "at least successes") require applying the rule of complementary events.
Mathematical Definition of Complementary Events:
- Two events are complements if they are mutually exclusive (zero overlap) and collectively exhaustive (together encompass all possible outcomes in the sample space).
- If event is "at least successes" (), its complement is "at most successes" ().
- Complement Probability Identity:
Index-Shift Rule for Discrete Complement Calculations:
- To calculate , the lower-end bound in
pbinommust be shifted down by exactly to : - Example 1: For (), the complement is (). The formula is .
- Example 2: For (), the complement is (). The formula is .
- To calculate , the lower-end bound in
Required Conditions for Binomial Experiments:
- A fixed number of repeated trials ().
- Each trial results in one of two binary outcomes: Success or Failure.
- Trials are independent under identical, homogeneous conditions.
- The probability of success () remains constant for every trial.
Binomial Distribution Applications and Case Studies
Case Study 1: Wildlife Disease Tracking (Infected Raccoons)
Experimental Parameters:
- Sample size: raccoons.
- Infection probability per raccoon: ().
- Non-infection probability: ().
Target Calculation: Probability that exactly raccoons out of are infected ().
- Context: Implies infected and uninfected raccoons, where the ordering does not matter (e.g., first two, first and third, last two).
- R Syntax:
dbinom(2, 12, 0.3) - Numerical Result: Approximately or
Case Study 2: Quality Control (Defective Items)
Experimental Parameters:
- Sample size: randomly selected items.
- Defect rate per item: ().
- Trial definition: Finding a defective item is classified as a "success".
Target Calculation: Probability of observing "at least one defective item" ().
- Expanded Summation Approach:
- Complementary CDF Approach:
Case Study 3: Extrasensory Perception (ESP) and Card Guessing
Experimental Setup:
- Total cards tested: cards.
- Card shapes: distinct shapes (star, circle, triangle, square).
- Experimenter views each card while the subject guesses the shape without seeing it.
- Random guessing probability of success: ().
- Random guessing probability of failure: ().
- Cards are shuffled between trials to maintain randomness and trial independence.
- Multiple-choice test analogy: Equivalent to an -question exam with options per question answered by pure random guessing.
Part A: Exactly 4 Correct Guesses:
- Target:
- R Syntax:
dbinom(4, 8, 0.25) - Numerical Result: Approximately (
Part B: 3 or Fewer Correct Guesses:
- Target: , covering outcomes .
- R Syntax:
pbinom(3, 8, 0.25) - Interpretation: Yields a high cumulative probability because getting or fewer correct is common when individual success probability is low ().
Part C: At Least 4 Correct Guesses:
- Target: , covering outcomes .
- R Syntax:
1 - pbinom(3, 8, 0.25)
Airline Flight Overbooking Model
Business Context and Economics of Overbooking
- Definition of Overbooking / Overselling: Selling more confirmed passenger tickets than physical seat capacity on an aircraft.
- Denied Boarding (Bumping): Occurs when actual passenger arrivals exceed physical seat availability. Passengers are bumped either voluntarily (accepting compensation) or involuntarily.
- Airline Incentives Offered: Free hotel accommodations, complimentary dinner vouchers, rebooking on alternative flights the next day, and financial discount vouchers.
- Economic Rationale: Historical flight data indicates that approximately of ticketed passengers fail to show up ("no-shows"). Selling extra tickets ensures maximum capacity utilization and captures revenue from non-refundable no-show tickets.
Operational Airport Interruption
- Public Announcement Event: Passengers Carissa Fortune and Sam Kirkwood requested immediately at Terminal B, Gate 13 for impending flight departure.
- Passenger Statuses:
- Carissa Fortune: Delayed due to a 6-hour highway traffic drive.
- Sam Kirkwood: Slept through alarm / sick in bed.
- Operational Consequence: Both passengers missed the flight. The airline retains ticket revenues and fills physical seats with overbooked ticket holders without incurring net financial penalty.
Overbooking Model Setup and Parameters
- Aircraft Physical Capacity: physical seats.
- Tickets Sold: confirmed tickets ( independent trials).
- Passenger Arrival Probability: ( chance an individual ticket holder shows up).
- Passenger No-Show Probability: ( chance an individual ticket holder misses the flight).
Mathematical Computations for Passenger Bumping
Part A: Flight oversold and exactly 1 passenger bumped:
- Passenger Count Translation: Bumping exactly passenger requires exactly passengers showing up for seats ().
- Target: given and
- R Syntax:
dbinom(151, 152, 0.97) - Numerical Result: Approximately or (about
Part B: Flight oversold and exactly 2 passengers bumped:
- Passenger Count Translation: Bumping exactly passengers requires all ticketed passengers to show up ().
- Target: given and
- R Syntax:
dbinom(152, 152, 0.97) - Parameter Distinction: In
dbinom(152, 152, 0.97), the first represents target successes ; the second represents total trials . - Numerical Result: Less than (specifically or approximately
Part C: Flight oversold and at least 1 passenger bumped:
- Passenger Count Translation: Bumping at least passenger requires or passengers showing up ().
- Summation Syntax:
dbinom(151, 152, 0.97) + dbinom(152, 152, 0.97) - Complementary CDF Formula:
- Index Shift Logic: Shift the threshold down from to . The term
pbinom(150, 152, 0.97)calculates the probability that or fewer passengers show up (no bumping required). - Numerical Result: Approximately to overall probability of bumping at least one passenger.
Part D: Flight is NOT oversold (zero passengers bumped):
- Passenger Count Translation: Zero bumping occurs if or fewer passengers show up ().
- Target:
- R Syntax:
pbinom(150, 152, 0.97) - Numerical Result: Complement of Part C ( or
Homework, Review, and Upcoming Exam Schedule
- Core Practical Skill: Translating real-world operational language (e.g., "bump 1 passenger", "bump at least 1 passenger") into exact numerical parameters (, , ) required for R binomial functions.
- Upcoming Schedule:
- Tomorrow: Exam review and question-answering session.
- Wednesday: Scheduled Quiz.