📘 Session 3.6 - Geometric & Negative Binomial Distributions

🎯 Geometric Distribution

Definition: Number of trials until the first success in independent, identical trials with constant success probability p.

Why the PMF? To get the first success on trial k: fail the first k−1 trials, then succeed → (1-p)^(k-1) · p.

Examples: Electronics QA (first part that meets spec), Mechanical testing (first bearing passing stress), Student life (first successful Wi-Fi login).

🧮 Interactive Calculator — Geometric

🔎 Standard geometric (constant p): The graph depends only on p, not on k. The k box is for computing P(X=k) and P(X≤k) and for marking k on the charts.

Optional: Learning mode — let success probability rise with experience (not a geometric model)

When learning mode is on, we compute P(X=k)=product(1-p_i) · p_k and approximate mean/variance from the plotted distribution.

🎯 Negative Binomial Distribution

Definition: Number of trials until the r-th success in independent, identical trials with constant success probability p. (Geometric is the special case r = 1.)

Interpretation tip: First decide what counts as a success — a pass, a good unit, or a defect (if you are counting defects). X is the number of trials; it tells you how many trials it takes to reach r successes.

Example sequence (r = 3): F, S, F, S, S → the 3rd success is on trial 5, so X = 5. Here k is the trial where the r-th success occurs (so k ≥ r).

🔌 Electrical / Computer Engineering examples

⚙️ Mechanical / Manufacturing examples

🧮 Interactive Calculator — Negative Binomial

NB shape depends on r and p. The k box computes P(X=k), P(X≤k), and marks k.

📎 Excel Cheat Sheet

DistributionPMFCDF
Geometric
Modern (if available): =GEOM.DIST(k, p, FALSE)
Legacy: =GEOMDIST(k, p, FALSE)
Always works (via NegBin, r=1): =NEGBINOM.DIST(k-1, 1, p, FALSE)
Modern (if available): =GEOM.DIST(k, p, TRUE)
Legacy: =GEOMDIST(k, p, TRUE)
Always works (via NegBin, r=1): =NEGBINOM.DIST(k-1, 1, p, TRUE)
Negative Binomial =NEGBINOM.DIST(k - r, r, p, FALSE) =NEGBINOM.DIST(k - r, r, p, TRUE)