{
  "id": "probability-distribution",
  "version": "1e24e4c88e67",
  "status": "published",
  "name": "Probability Distribution Calculator",
  "question": "Probability distribution: P(X ≤ x)?",
  "summary": "Computes P(X ≤ x), P(X > x), P(X = x) or the density, the mean and the standard deviation for a normal, binomial, Poisson, exponential or uniform distribution, with its curve.",
  "category": "statistics",
  "subcategory": "distributions",
  "url": "https://www.acalculator.org/statistics/probability-distribution-calculator",
  "markdown": "https://www.acalculator.org/statistics/probability-distribution-calculator.md",
  "kind": "function",
  "method": "Normal: Φ((x − μ) ÷ σ); binomial: Σ C(n, j) pʲ (1 − p)ⁿ⁻ʲ for j ≤ x; Poisson: Σ e^−λ λʲ ÷ j! for j ≤ x; exponential: 1 − e^(−x/β); uniform: (x − A) ÷ (B − A).",
  "assumptions": [
    "Binomial and Poisson x are whole numbers (counts). Below 0 every count has P(X ≤ x) = 0.",
    "The exponential distribution starts at 0 (location 0) with mean β, as NIST’s standard form."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "dist": {
        "title": "Distribution",
        "description": "The probability distribution of X.",
        "type": "string",
        "enum": [
          "normal",
          "binomial",
          "poisson",
          "exponential",
          "uniform"
        ]
      },
      "mu": {
        "title": "Mean (μ)",
        "description": "The mean of the normal distribution.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "sigma": {
        "title": "Standard deviation (σ)",
        "description": "The spread of the normal distribution; at least 0.000000001.",
        "type": "number",
        "minimum": 1e-9,
        "maximum": 1000000000
      },
      "n": {
        "title": "Trials (n)",
        "description": "How many independent trials, from 1 to 1,000.",
        "type": "integer",
        "minimum": 1,
        "maximum": 1000
      },
      "p": {
        "title": "Probability of success (p)",
        "description": "The chance of a success on each trial, from 0 to 1.",
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "lambda": {
        "title": "Mean count (λ)",
        "description": "The average number of events in the interval; at least 0.000000001.",
        "type": "number",
        "minimum": 1e-9,
        "maximum": 100000
      },
      "beta": {
        "title": "Mean (β)",
        "description": "The mean (scale) of the exponential distribution, 1 ÷ rate; at least 0.000000001.",
        "type": "number",
        "minimum": 1e-9,
        "maximum": 1000000000
      },
      "a": {
        "title": "Lower bound (A)",
        "description": "The smallest value the uniform distribution takes.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "b": {
        "title": "Upper bound (B)",
        "description": "The largest value; more than A.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "x": {
        "title": "Value (x)",
        "description": "The value to find probabilities at. A whole number for the binomial and Poisson counts.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      }
    }
  },
  "outputs": {
    "atMost": {
      "label": "P(X ≤ x)",
      "description": "The probability that X is at most x: the cumulative distribution function at x.",
      "format": "number"
    },
    "above": {
      "label": "P(X > x)",
      "description": "The probability that X is more than x: 1 − P(X ≤ x).",
      "format": "number"
    },
    "exactly": {
      "label": "P(X = x)",
      "description": "For a count (binomial, Poisson): the probability of exactly x.",
      "format": "number"
    },
    "pdf": {
      "label": "Density f(x)",
      "description": "For a continuous distribution: the height of the density curve at x.",
      "format": "number"
    },
    "mean": {
      "label": "Mean",
      "description": "The expected value of X.",
      "format": "number"
    },
    "sd": {
      "label": "Standard deviation",
      "description": "The spread of X.",
      "format": "number"
    },
    "variance": {
      "label": "Variance",
      "description": "The standard deviation squared.",
      "format": "number"
    },
    "name": {
      "label": "Distribution",
      "description": "The distribution used.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "dist": "normal",
      "mu": 0,
      "sigma": 1,
      "n": 10,
      "p": 0.5,
      "lambda": 4,
      "beta": 2,
      "a": 0,
      "b": 10,
      "x": 1
    },
    "outputs": {
      "atMost": 0.841344746068543,
      "above": 0.1586552539314569,
      "pdf": 0.24197072451914337,
      "mean": 0,
      "sd": 1,
      "variance": 1,
      "name": "normal"
    },
    "text": "For this normal distribution, P(X ≤ 1) = 0.8413447461."
  },
  "examples": [
    {
      "given": {
        "dist": "normal",
        "mu": 0,
        "sigma": 1,
        "x": 1.96
      },
      "expect": {
        "atMost": 0.9750021048517795,
        "above": 0.02499789514822043,
        "pdf": 0.058440944333451476
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.1 Normal Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda3661.htm; Python 3: statistics.NormalDist().cdf(1.96) = 0.9750021048517795"
    },
    {
      "given": {
        "dist": "binomial",
        "n": 10,
        "p": 0.5,
        "x": 5
      },
      "expect": {
        "exactly": 0.24609375,
        "atMost": 0.623046875,
        "above": 0.376953125,
        "mu": 5
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm; hand calculation in content.mdx: C(10, 5) ÷ 2¹⁰ = 252 ÷ 1024"
    },
    {
      "given": {
        "dist": "poisson",
        "lambda": 4,
        "x": 2
      },
      "expect": {
        "exactly": 0.14652511110987343,
        "atMost": 0.2381033055535443,
        "sigma": 2
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.19 Poisson Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda366j.htm; hand calculation in content.mdx: e⁻⁴ (1 + 4 + 8) = 13e⁻⁴"
    },
    {
      "given": {
        "dist": "exponential",
        "beta": 2,
        "x": 1
      },
      "expect": {
        "atMost": 0.3934693402873666,
        "above": 0.6065306597126334,
        "pdf": 0.3032653298563167
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.7 Exponential Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda3667.htm; hand calculation in content.mdx: 1 − e^(−1/2)"
    },
    {
      "given": {
        "dist": "uniform",
        "a": 0,
        "b": 10,
        "x": 2.5
      },
      "expect": {
        "atMost": 0.25,
        "pdf": 0.1,
        "mu": 5,
        "sigma": 2.886751345948129
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.2 Uniform Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda3662.htm; hand calculation in content.mdx: (2.5 − 0) ÷ 10 = 0.25; σ = 10 ÷ √12"
    }
  ],
  "sources": [
    "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.1 Normal Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda3661.htm (retrieved 2026-10-02)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.2 Uniform Distribution (f(x) = 1/(B − A); mean (A + B)/2; standard deviation √((B − A)²/12)). https://www.itl.nist.gov/div898/handbook/eda/section3/eda3662.htm (retrieved 2026-10-02)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.7 Exponential Distribution (F(x) = 1 − e^(−x/β); mean and standard deviation β). https://www.itl.nist.gov/div898/handbook/eda/section3/eda3667.htm (retrieved 2026-10-02)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm (retrieved 2026-10-02)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.19 Poisson Distribution (p(x; λ) = e^−λ λˣ / x!; mean λ, standard deviation √λ). https://www.itl.nist.gov/div898/handbook/eda/section3/eda366j.htm (retrieved 2026-10-02)"
  ],
  "related": [
    "normal-distribution",
    "binomial-distribution",
    "poisson-distribution",
    "expected-value"
  ],
  "changelog": []
}
