ForHosting KIT · Developer Utilities

Geometric CDF calculator

The geometric cumulative distribution answers a practical deadline question: how likely is the first success to happen within a fixed number of attempts?

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the probability of success on one independent trial, p, and a positive whole-number limit, k. The calculator returns the probability that at least one success occurs from trial one through trial k. It evaluates the exact formula rather than simulating trials, so every identical input produces the same result. Invalid probabilities and trial counts below one are rejected clearly.

What the geometric CDF measures

The geometric distribution models repeated independent trials when every trial has the same success probability and the process is observed until its first success. This calculator uses the trials-until-first-success convention, so the random variable X begins at one. Its cumulative distribution function at k is the probability that X is less than or equal to k. In everyday language, it is the chance that a success happens within the first k attempts. The complement is often easier to see: missing the target within k trials means failing every one of those trials. If one trial succeeds with probability p, it fails with probability one minus p. Independence makes the probability of k consecutive failures equal to (1 minus p) raised to k. Subtracting that result from one gives the requested cumulative probability. The output includes both this CDF and the remaining all-failures probability, which sum to one apart from ordinary floating-point rounding. This interpretation differs from the probability that the first success occurs exactly on trial k, which is a probability mass rather than a cumulative probability.

How to enter p and k and read the result

Provide p as a number greater than zero and no greater than one. Decimal probabilities use the direct scale: enter 0.25 for a twenty-five percent success chance, not 25. A probability of one is valid and means the first trial always succeeds; a probability of zero is rejected because a geometric waiting time to success is not defined when success cannot occur. Provide k as a whole number of trials starting at one. Fractions, zero, and negative trial counts are rejected because the distribution is indexed by discrete attempts. The cdf and probability fields both report the probability of success by the stated limit. The failure_probability field reports the complementary chance that all k attempts fail. The percent field offers a convenient display value, while the numeric fields are better for downstream calculations. For example, when p is 0.25 and k is 4, the result measures the chance of one or more successes across four independent opportunities. It does not assume that you stop and restart the success probability, and it does not count the expected number of total successes.

Assumptions, numerical behavior, and practical use

Use this model only when trials are reasonably independent and the success probability stays constant. If an attempt changes the next attempt, if inventory is removed without replacement, or if p varies over time, the simple geometric CDF may not describe the process. For a fixed number of trials with questions about several successes, a binomial model is usually more appropriate. This implementation computes the complement with logarithm and exponential functions chosen for numerical stability, especially when p is very small. That avoids much of the precision loss caused by directly subtracting a power extremely close to one. It is still standard finite-precision arithmetic, so values extraordinarily close to zero or one may display at the nearest representable number. The calculation is deterministic, has no network calls, and uses no random simulation. Teams can use it to set retry budgets, estimate whether a sales contact will convert within several independent approaches, plan inspection attempts, or explain textbook exercises. Compare alternative values of k to see how additional opportunities improve the cumulative chance, but confirm that the independence and constant-probability assumptions remain defensible before using the result for a consequential decision.

Set a retry limit

Estimate the probability that an independent request succeeds at least once before a retry budget is exhausted.

Plan repeated inspections

Calculate the chance that a target event is detected within a chosen number of independent checks.

Teach cumulative probability

Contrast success by trial k with the different probability that the first success occurs exactly on trial k.

What formula does the calculator use?

It uses P(X <= k) = 1 - (1 - p)^k for independent trials with constant success probability p.

Is p entered as a decimal or percentage?

Enter a decimal probability from greater than zero through one, such as 0.2 for twenty percent.

What does k represent?

k is the inclusive positive whole-number trial limit: the result covers trials one through k.

Does this return the probability of success exactly on trial k?

No. It returns the cumulative probability of the first success occurring on or before trial k.

How much does an API request cost?

A successful API request costs $0.002. The same deterministic calculation is free to run in the browser.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/geometric-cdf

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/geometric-cdf \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"p":0.25,"k":4}'
{
  "p": 0.25,
  "k": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.geometric_cdf",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →