Negative Binomial & Geometric Distribution (Trials Until r-th Success) Calculator

Calculate expected trials and probability of achieving the r-th success on trial n.

Expected Total Trials for 3 Successes
12 trials
PMF Probability P(r-th Success on Trial 10) 7.509 %
Expected Failures Before r-th Success 9 failures
Standard Deviation of Trials 6 trials
Inputs
⚡ Scenarios:
r successes
Target number of successes r (r = 1 is the Geometric distribution).
p
Probability p of success on each independent trial (0.01 to 0.99).
n trials
Total trial count n at which the r-th success occurs (n ≥ r).
Results & Graph
Expected Total Trials for 3 Successes
12 trials
PMF Probability P(r-th Success on Trial 10)
7.509 %
Expected Failures Before r-th Success
9 failures
Standard Deviation of Trials
6 trials

Expected Total Trials for 3 Successes

Graph 1 • Negative Binomial & Geometric • Domain Architecture & Live Telemetry Maps Required Successes R, Single Trial Success Prob P, Total Trials Evaluated N through Negative Binomial & Geometric Formula.
Expected Total Trials for 3 Su: 12 trials Negative Binomial & Geometric • Invariants & Metrics Expected Total Trials for 3 12 trials PMF Probability P(r-th Succe 7.509 % Expected Failures Before r-t 9 failures Standard Deviation of Trials 6 trials
Graph 2 • Expected Total Trials for 3 Successes Across Required Successes R Sweep (40% → 160%) Evaluates P(Trial = n) = C(n − 1, r − 1) × p^r × (1 − p)^(n − r); ExpectedTrials across 7 operating points (current input highlighted).
0 trials 11 trials 22 trials 4 1.20 8 1.80 8 2.40 12 3 16 3.60 16 4.20 20 4.80
Graph 3 • Joint Sensitivity: Required Successes R × Single Trial Success Prob P Compares Expected Total Trials for 3 Successes when Single Trial Success Prob P is shifted +25% (solid) vs. −25% (dashed).
0 trials 11.73 trials 23.47 trials --- Single Trial Success Prob P @ 75% 6.40 -30% 9.60 -15% 9.60 +0% 9.60 +15% 12.80 +30%
Summary: At p = 0.25, achieving 3 successes requires 12 expected total trials (9 failures, SD = 6), and P(Trial = 10) is 7.508%.
Summary: At p = 0.25, achieving 3 successes requires 12 expected total trials (9 failures, SD = 6), and P(Trial = 10) is 7.508%.
Interactive chart & math engine powered by CalculatorGraph

Formula & Mathematical Methodology: Negative Binomial & Geometric Formula

P(Trial = n) = C(n − 1, r − 1) × pr × (1 − p)n − r
ExpectedTrials = r / p
P(Trial = n) = C(n − 1, r − 1) × p^r × (1 − p)^(n − r); ExpectedTrials = r / p
  • requiredSuccessesR: Required Successes R (r successes)
  • singleTrialSuccessProbP: Single Trial Success Prob P (p)
  • totalTrialsEvaluatedN: Total Trials Evaluated N (n trials)

Rounding: Internal floating-point calculations run in 64-bit IEEE-754 double precision; display values round to 2–4 decimal places.

Worked Example: Worked Mathematical Example: Negative Binomial & Geometric

Calculate expected trials and probability of achieving the r-th success on trial n.

  1. Specify the function parameters, matrix entries, or confusion matrix counts.
  2. Apply the closed-form or iterative formula: P(Trial = n) = C(n − 1, r − 1) × p^r × (1 − p)^(n − r); ExpectedTrials = r / p.
  3. Examine the primary result, error bounds, and 3 interactive SVG plots.
Result: Computes Negative Binomial & Geometric via P(Trial = n) = C(n − 1, r − 1) × p^r × (1 − p)^(n − r); ExpectedTrials = r / p.

Frequently Asked Questions

How does the Negative Binomial & Geometric Distribution (Trials Until r-th Success) Calculator compute the solution?

It evaluates P(Trial = n) = C(n − 1, r − 1) × p^r × (1 − p)^(n − r); ExpectedTrials = r / p directly in your browser and updates three custom SVG visualizations in real time.

Can I solve backwards for an input parameter using Goal Seek?

Yes. Click "🎯 Goal Seek" in the results toolbar to solve backwards for any numeric input field.

Does this calculator run locally offline?

Yes. All calculations run 100% locally in your browser and work offline via the CalculatorGraph PWA.

Mathematics & Statistics · Probability Distributions & Survival Analysis

Negative Binomial & Geometric Distribution (Trials Until r-th Success) Calculator: inputs, method, and how to read the result

Calculate expected trials and probability of achieving the r-th success on trial n.

Choose inputs for the case you are checking

The defaults are illustrative. Replace them with values for your case and keep the units shown beside each field.

  • Required Successes R: Target number of successes r (r = 1 is the Geometric distribution).
  • Single Trial Success Prob P: Probability p of success on each independent trial (0.01 to 0.99).
  • Total Trials Evaluated N: Total trial count n at which the r-th success occurs (n ≥ r).

What the calculation includes

With the default values shown, Expected Total Trials for 3 Successes is 12 trials. The calculation follows Negative Binomial & Geometric Formula; the formula and variable definitions above show how the inputs combine.

One-input check: With the other defaults held constant, changing Required Successes R from 3 r successes to 4 r successes changes Expected Total Trials for 3 Successes (12 trials) to Expected Total Trials for 4 Successes (16 trials). This is a comparison inside the calculator's stated model, not a prediction.

Where to use caution

  • Uses exact analytical or standard numerical analysis formulations from NIST DLMF.
  • Double-precision floating-point arithmetic has ~15–17 significant decimal digits of precision.

Scope: Global Mathematical & Statistical Standard Check the assumptions and limitations against your situation before relying on the estimate.

More in Mathematics & Statistics: Scientific Calculator, Statistics & Standard Deviation Calculator, Permutations, Combinations, Probability, Sample Size & P-Value Calculator.