ForHosting KIT · Math

Geometric PMF calculator

Find the chance that the first success lands exactly on trial k: with a 0.25 chance per try, a first success on the third try has probability 0.140625, after two failures in a row. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Power (W)
0.25
K
3
You get
Probability
0.140625

The geometric PMF calculator finds the probability that the first success in a sequence of independent trials occurs exactly on trial k. Enter the constant success probability p and a positive trial number k, and the calculator applies P(X = k) = (1 - p)^(k - 1) × p. It is useful for probability coursework, retry analysis, quality inspection, and any process that repeats under the same success chance until the first success. The calculation is deterministic, requires no simulation, and rejects probabilities outside the valid range.

Understand what the geometric PMF measures

A geometric random variable models the number of independent trials required to observe the first success. Every trial has the same success probability p, and its failure probability is one minus p. For the first success to occur on trial k, the process must fail exactly k minus one times and then succeed.

Independence lets us multiply those probabilities, producing the probability mass function P(X = k) = (1 - p)^(k - 1) × p. This calculator uses the convention in which k counts the successful trial itself, so valid trial numbers start at one. Some books instead count the number of failures before the first success, giving support that starts at zero.

If your source uses that alternative convention, add one to its failure count before entering k here. For example, with p equal to 0.25 and k equal to 3, two failures must be followed by a success. The result is 0.75 squared times 0.25, or 0.140625.

This is the probability of success occurring for the first time on exactly the third trial, not the probability of at least one success within three trials. That distinction matters: a PMF describes one exact outcome, while a cumulative probability combines several possible trial numbers.

Enter p and k correctly and interpret the result

Provide p as a finite number greater than zero and less than or equal to one. A decimal such as 0.2 represents a 20 percent chance of success on every trial. Zero is excluded because a process with no chance of success can never have a first successful trial, while values above one or below zero are not probabilities.

Provide k as a positive whole number because trials are counted discretely: trial 1, trial 2, and so forth. Fractions, zero, negative values, infinities, and missing fields return an invalid input error instead of a misleading result. A result of 0.140625 means there is a 14.0625 percent chance that the first success occurs exactly at the requested trial.

When p equals one, success is certain on the first trial, so k equal to one returns one and later trial numbers return zero. For small probabilities or very large k, the mathematical probability may be so tiny that standard floating-point arithmetic displays zero. That is numerical underflow rather than randomness; the underlying event remains conceptually possible when p is between zero and one.

Apply the result without confusing related distributions

Use the geometric PMF when trials are independent, the chance of success stays constant, and the question asks when the first success occurs. A software team can model the exact retry on which a request finally completes, provided each retry has approximately the same success rate and earlier failures do not change later behavior. A quality team can model the item number on which the first defective component is found when inspected items have a stable, independent defect probability.

A teacher can use it to check exercises involving coin flips, free throws, calls, or machine starts. Do not use this PMF when p changes between attempts, trials influence one another, or sampling without replacement materially changes the odds. Also distinguish it from the binomial distribution: binomial probability counts a specified number of successes in a fixed number of trials, whereas geometric probability stops conceptually at the first success and assigns probability to its trial number.

If you need the probability that success occurs by trial k, use the geometric cumulative distribution, which is 1 - (1 - p)^k, rather than summing a single PMF value. If you need the average waiting time, the geometric mean trial count is 1/p. Keeping the exact-trial, by-trial, and average questions separate prevents a plausible-looking number from answering the wrong operational or homework question.

Analyze an exact retry attempt

Estimate the probability that an independent request succeeds for the first time on a particular retry.

Check probability coursework

Verify geometric PMF exercises with a deterministic formula and an explicit trials-until-success convention.

Model first detection in inspection

Find the probability that the first independently occurring defect is discovered on item k.

What range is allowed for p?

p must be greater than 0 and less than or equal to 1.

Can k be zero or a fraction?

No. This convention counts the successful trial, so k must be a positive whole number beginning at 1.

Does this calculate success by trial k?

No. It calculates success for the first time exactly on trial k. Success by trial k requires the cumulative formula 1 - (1 - p)^k.

What if my textbook counts the failures before the first success?

Add one to that failure count before entering k. This calculator counts the successful trial itself, so k starts at 1, while some books start their count at zero failures.

How do I read a result of 0.140625?

It is a 14.0625% chance that the first success happens on exactly the third trial when p is 0.25: two failures, each with probability 0.75, followed by one success.

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-pmf

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-pmf \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"p":0.25,"k":3}'
{
  "p": 0.25,
  "k": 3
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.geometric_pmf",
  "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.

Enter p and k correctly and interpret the result

The response echoes the normalized p and k, returns probability as a numeric value, and includes the formula used. API requests cost $0.002, while the browser calculation uses the same deterministic solving function.

What formula does the calculator use?

It uses P(X = k) = (1 - p)^(k - 1) × p for k = 1, 2, 3, and so on.

How much does an API request cost?

Each successful API request costs $0.002. The browser calculator runs the same deterministic logic locally.

Read the full KIT documentation →