Percentages and Math

Geometric and Negative Binomial Calculator

Enter the chance of success and how many successes you need to see how the wait for them is spread.

Your numbers

The same on every trial, and each trial independent. Example value.

1 gives the geometric distribution: the wait for the first success.

The trial on which the last needed success arrives.

Result

Chance the first success is on trial 5

8.1920%

Success chance 20% on each trial.

Chance it takes exactly 5 trials
0.08192
Chance it takes 5 trials or fewer
0.67232
Chance it takes more than 5 trials
0.32768
Expected number of trials
5
Standard deviation
4.472136

Chance for each trial number

TrialExactly this trialThis trial or fewer
120.0000%20.0000%
216.0000%36.0000%
312.8000%48.8000%
410.2400%59.0400%
58.1920%67.2320%
66.5536%73.7856%
75.2429%79.0285%
84.1943%83.2228%
93.3554%86.5782%
How this was calculated
  1. P(first success on trial k) = (1 - p)^(k - 1) x p = 0.8^4 x 0.2 = 0.08192.
  2. Adding the chance of each trial number from 1 to 5 gives 0.67232 for "5 trials or fewer".
  3. The expected number of trials is r / p = 5, with variance r (1 - p) / p^2 = 20.
  • Here the variable counts all trials up to and including the last needed success. Some books count only the failures before it, which is the same number minus the successes needed.

Calculated using SumPanda.com · https://sumpanda.com/geometric-and-negative-binomial-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the geometric and negative binomial calculator

  1. Enter the chance of success on each trial as a percent.
  2. Enter the successes needed. Use 1 for the geometric distribution, the wait for the first success, or a larger number for the negative binomial, the wait for the r-th success.
  3. Enter the trial number you want the chance for.
  4. Read the chance of exactly that trial, the chance of that trial or fewer, the chance of more, the expected number of trials and the table by trial.

Formula

geometric: P(first success on trial k) = (1 - p)^(k - 1) p

negative binomial: P(r-th success on trial k) = C(k - 1, r - 1) p^r (1 - p)^(k - r)

mean = r / p variance = r (1 - p) / p^2

The variable counts every trial up to and including the last needed success, so it can never be less than r. The cumulative chance is the sum of the exact probabilities from trial r up to trial k.

Waiting for a 20% chance to come off

With a 20% chance on each try, the chance that the first success comes on exactly the fifth try is 0.8^4 x 0.2 = 8.1920%. The chance it comes on the fifth try or sooner is 0.67232, so there is a 32.768% chance it takes longer. The expected number of tries is 5.

For three successes at 40% each, the chance the third arrives on exactly trial 10 is 6.4497%, and on trial 10 or sooner it is 0.83271. The expected number of trials is 7.5 with a standard deviation of 3.354102. All of these were confirmed by listing the binomial coefficients with exact arithmetic.

Two ways to count

Some textbooks count only the failures before the last success. That number is the one on this page minus r. The two conventions describe the same event, so a table in one book can look shifted compared with another. This page counts the trial number, which matches how most people ask the question: on which try does it happen?

The geometric distribution is the special case of one success needed. It is memoryless, like its continuous cousin the Exponential Distribution: after any number of failures, the chance of success on the next trial has not changed.

Common uses and limits

Use it for repeated independent attempts with the same chance each time: tries until a part passes a test, calls until the third sale, or rolls until a certain number appears twice. It does not fit when the chance changes between trials, as when you draw cards without replacement. In that setting, look at the Hypergeometric Distribution Calculator.

More statistics tools

For streaks, waiting times, agreement and score scales, try the Cohen's Kappa Calculator, Robust Center Calculator and Standard Score Converter.

Assumptions and limits

  • Each trial has the same chance of success and trials are independent.
  • The variable counts trials, including the one with the last needed success.
  • The chance of success must be greater than 0 and at most 100%.
  • The table shows up to fifteen trial numbers ending near the one you asked about.
  • The example values are an illustration. Replace them with your own.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

Can the geometric distribution start at zero?

Some books define it that way by counting failures before the first success. This page counts trials, so the smallest possible value is 1, when the first try succeeds.

Why is the expected number of trials r divided by p?

Each success takes 1 / p trials on average, because a success happens once in every 1 / p tries. Needing r of them multiplies that by r.

What does a chance of 100% do?

Every trial succeeds, so the r-th success is always on trial r. The page handles this case and shows a chance of 100% for trial r and 0% for later trials.

How large can the trial number be?

The page accepts trial numbers up to one million, with up to 100,000 successes needed. Very large values are computed with logarithms so they do not overflow.