Catalog/stat-geometric-probability

Statistics

Geometric distribution prob API

Computes geometric probabilities (exact/at-most/at-least) under either the trials-until-success or failures-before-success convention, plus mean and variance. Answers 'What is the chance the first success comes on trial k?', 'What is P(X >= k) for a geometric distribution?'.

Price$0.04per request
MethodPOST
Route/v1/stats/geometric-probability
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
statisticsgeometricdistributionprobabilitypmftrialsfirst-successdiscrete
API URLhttps://x402.hexl.dev/v1/stats/geometric-probability
Integration docs
Example request
{
  "p": 0.2,
  "k": 3
}
Example response
{
  "p": 0.2,
  "k": 3,
  "support": "trials",
  "mode": "exact",
  "probability": 0.128,
  "exact": 0.128,
  "atMost": 0.488,
  "atLeast": 0.64,
  "mean": 5,
  "variance": 20,
  "rating": "plausible",
  "interpretation": "Geometric(0.2, trials): P(X = 3) = 0.128."
}
Input schema
{
  "type": "object",
  "required": [
    "p",
    "k"
  ],
  "properties": {
    "p": {
      "type": "number",
      "examples": [
        0.2
      ]
    },
    "k": {
      "type": "integer",
      "examples": [
        3
      ]
    },
    "cumulative": {
      "type": "string",
      "enum": [
        "exact",
        "atMost",
        "atLeast"
      ]
    },
    "support": {
      "type": "string",
      "enum": [
        "trials",
        "failures"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}