Home › Statistics & Probability › Geometric Distribution Calculator
Geometric Distribution Calculator
Computes, for independent trials with success probability p, the probability that the first success occurs exactly on trial k, within the first k trials or later than trial k, plus the mean, variance, standard deviation and expected number of failures before the first success.
When to use
You repeat independent attempts with the same success chance and ask how many attempts it takes until the first success (first six on a die, first defective item, first sale).
Do not use when: The number of trials is fixed and you count successes (use binomial-distribution), or the waiting time is continuous (use exponential-distribution).
Formula
P(X = k) = (1 − p)^(k − 1) · p; P(X ≤ k) = 1 − (1 − p)^k; mean = 1/p; variance = (1 − p)/p²
Uses the 'number of trials' convention (support k = 1, 2, …). The alternative convention counts failures before the first success (support 0, 1, …); its mean is (1 − p)/p, reported as expected_failures.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
probability_of_success | number | yes | Success probability on each trial, as a fraction between 0 and 1 (not a percentage). Range: > 0, ≤ 1 | |
trial | integer | yes | The trial on which the first success is of interest (k = 1 is the first attempt). Range: ≥ 1, ≤ 1000000 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
probability_exact | number | First success exactly on trial k: (1 − p)^(k−1) · p. | |
probability_at_most | number | First success within the first k trials: 1 − (1 − p)^k. | |
probability_more_than | number | No success in the first k trials: (1 − p)^k. | |
mean | number | Expected trials until the first success: 1/p. | |
variance | number | (1 − p)/p². | |
std_dev | number | √(1 − p) / p. | |
expected_failures | number | (1 − p)/p: mean of the alternative 'number of failures' form of the distribution. |
Example
First six on the 3rd roll of a die (p = 1/6): {"probability_of_success":0.1666667,"trial":3} → {"probability_exact":0.115741,"probability_at_most":0.421296,"probability_more_than":0.578704,"mean":6,"variance":30,"std_dev":5.4772,"expected_failures":5}
p = 0.2, first success on trial 5: {"probability_of_success":0.2,"trial":5} → {"probability_exact":0.08192,"probability_at_most":0.67232,"probability_more_than":0.32768,"mean":5,"variance":20,"std_dev":4.4721}
GET https://tttkmbb.com/api/v1/calculate/geometric-distribution?probability_of_success=0.1666667&trial=3
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/geometric-distribution(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/geometric-distribution · Markdown: https://tttkmbb.com/statistics/geometric-distribution.md · JSON definition: https://tttkmbb.com/statistics/geometric-distribution.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="geometric-distribution" - OpenAPI operationId:
calculate_geometric_probability - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Geometric distribution (reference)
- Wolfram MathWorld – Geometric Distribution (reference)
FAQ
Which convention does this calculator use?
k counts the trial of the first success (k ≥ 1). If your textbook counts failures before the first success, subtract 1 from k and use expected_failures for the mean.
Is the geometric distribution memoryless?
Yes: after any number of failures, the distribution of the remaining number of trials until success is unchanged. Past failures do not make a success 'due'.
Related calculators
- Binomial Distribution Calculator — Number of successes in a fixed number of trials.
- Exponential Distribution Calculator — Continuous-time analogue (memoryless waiting time).