Catalog/stat-binomial-probability

Calculators

Binomial probability API

Compute binomial probabilities P(X=k)=C(n,k)p^k(1−p)^(n−k) for n trials with success probability p, including exact, at-most (CDF) and at-least, plus mean np and variance np(1−p). Auditable: returns all three modes. Answers 'probability of exactly 5 heads in 10 flips','at most 2 successes','binomial CDF'.

Price$0.01per request
MethodPOST
Route/v1/calc/stat-binomial-probability
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
calcstatisticsbinomialprobabilitypmfcdftrialsdistribution
API URLhttps://x402.hexl.dev/v1/calc/stat-binomial-probability
Integration docs
Example request
{
  "n": 10,
  "k": 5,
  "p": 0.5
}
Example response
{
  "n": 10,
  "k": 5,
  "p": 0.5,
  "mode": "exact",
  "probability": 0.24609375,
  "exact": 0.24609375,
  "atMost": 0.62304688,
  "atLeast": 0.62304687,
  "mean": 5,
  "variance": 2.5,
  "rating": "plausible",
  "interpretation": "P(X = 5) = 0.246094 for Binomial(10, 0.5)."
}
Input schema
{
  "type": "object",
  "required": [
    "n",
    "k",
    "p"
  ],
  "properties": {
    "n": {
      "type": "number",
      "description": "number of trials",
      "examples": [
        10
      ]
    },
    "k": {
      "type": "number",
      "description": "number of successes (0..n)",
      "examples": [
        5
      ]
    },
    "p": {
      "type": "number",
      "description": "success probability (0..1)",
      "examples": [
        0.5
      ]
    },
    "cumulative": {
      "type": "string",
      "enum": [
        "exact",
        "atMost",
        "atLeast"
      ],
      "default": "exact"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}