Definition: Number of trials until the first success in independent, identical trials with constant success probability p.
P(X = k) = (1 - p)^(k - 1) · p, for k = 1,2,...P(X ≤ k) = 1 - (1 - p)^kμ = 1/pσ² = (1 - p)/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).
    🔎 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.
  
When learning mode is on, we compute P(X=k)=product(1-p_i) · p_k and approximate mean/variance from the plotted 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.)
P(X = k) = C(k-1, r-1) · (1 - p)^(k - r) · p^r, for k = r, r+1,...μ = r / pσ² = r * (1 - p) / p^2Interpretation 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).
NB shape depends on r and p. The k box computes P(X=k), P(X≤k), and marks k.
| Distribution | PMF | CDF | 
|---|---|---|
| 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) |