Geometric Quantile Calculator
The smallest number of trials by which the first success has arrived with at least the probability you set.
What this page computes
Returns the smallest k with P(X ≤ k) ≥ level: how many trials are needed before the first success is that likely.
How to use it
Type the Success probability p, Probability level and press Run. p is the success probability on every trial, 0 < p < 1, and the level is strictly between 0 and 1. The answer is an integer trial number of at least 1. With p = 0.2, a 90% chance of a success, the page prints smallest k with P(X ≤ k) ≥ 0.9 is 11.
Running it
The closed form gives ⌈ln(1 − level)/ln(1 − p)⌉, and the page returns the smallest integer whose CDF actually reaches the level, so rounding cannot understate the answer. Every figure is computed in this browser tab: nothing is uploaded and nothing is stored.
Returns the smallest k with P(X ≤ k) ≥ level: how many trials are needed before the first success is that likely. With p = 0.2, a 90% chance of a success, the page prints smallest k with P(X ≤ k) ≥ 0.9 is 11.
The closed form gives ⌈ln(1 − level)/ln(1 − p)⌉, and the page returns the smallest integer whose CDF actually reaches the level, so rounding cannot understate the answer. The printed result is accurate to exact integer answer, checked against the closed-form CDF; no table is read and nothing is simulated.
How to use this geometric distribution calculator
Type each value below and press Run. The page prints the quantile and the parameter line it used, so the answer can be checked against the formula rather than taken on trust.
The inputs this page reads are Success probability p (strictly between 0 and 1); Probability level (strictly between 0 and 1).
The parameterisation
p is the success probability on every trial, 0 < p < 1, and the level is strictly between 0 and 1. The answer is an integer trial number of at least 1.
The numeric method
The closed form gives ⌈ln(1 − level)/ln(1 − p)⌉, and the page returns the smallest integer whose CDF actually reaches the level, so rounding cannot understate the answer.
The printed value is accurate to exact integer answer, checked against the closed-form CDF. The page returns the quantile only; it does not also print a test statistic, a p-value or a decision.
What to Expect
Best for
- sizing a retry or sampling budget
- the trial by which a success is 90% or 95% likely
Not ideal for
- a guarantee of success, which no finite k gives
- continuous waiting times, which use the exponential distribution
What this tool keeps
- Double-precision arithmetic in your own browser
- The same inputs always produce the same output
Common errors
- p and the level must both be strictly between 0 and 1. A level of 0 needs no trial and a level of 1 can never be guaranteed.
Example use cases
- planning how many attempts to allow
- teaching the difference between a probability and a quantile
Sample input
p = 0.2, a 90% chance of a success.
Sample output
smallest k with P(X ≤ k) ≥ 0.9 is 11.
Who this is for
- students
- planners
Frequently asked questions
Which parameterisation does this page use?
p is the success probability on every trial, 0 < p < 1, and the level is strictly between 0 and 1. The answer is an integer trial number of at least 1.
How is the result computed?
The closed form gives ⌈ln(1 − level)/ln(1 − p)⌉, and the page returns the smallest integer whose CDF actually reaches the level, so rounding cannot understate the answer. The result is accurate to exact integer answer, checked against the closed-form CDF.
What inputs are refused?
p and the level must both be strictly between 0 and 1. A level of 0 needs no trial and a level of 1 can never be guaranteed.
Is anything uploaded?
No. Every number is computed by JavaScript in this page from the values you typed; nothing is posted, stored or logged.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.