{
  "id": "sampling-distribution",
  "version": "f53134650a95",
  "status": "published",
  "name": "Sampling Distribution Calculator",
  "question": "What is the sampling distribution?",
  "summary": "Finds the sampling distribution of a sample proportion, mean or sum: its mean, its standard error, and the probability that a sample statistic falls in a range.",
  "category": "statistics",
  "subcategory": "distributions",
  "url": "https://www.acalculator.org/statistics/sampling-distribution-calculator",
  "markdown": "https://www.acalculator.org/statistics/sampling-distribution-calculator.md",
  "kind": "function",
  "method": "p̂ ~ N(p, √(p(1 − p) ÷ n)); x̄ ~ N(μ, σ ÷ √n); Σx ~ N(nμ, √n σ); z = (value − mean) ÷ standard error; the probability is the normal area over the range.",
  "assumptions": [
    "The samples are random and independent, and the normal shape comes from the central limit theorem.",
    "For p̂, the normal approximation is reasonable when np and n(1 − p) are both more than 5."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "of": {
        "title": "Sampling distribution of",
        "description": "The statistic whose distribution you want: the sample mean, the sample sum or the sample proportion.",
        "type": "string",
        "enum": [
          "mean",
          "sum",
          "proportion"
        ]
      },
      "mu": {
        "title": "Population mean (μ)",
        "description": "The mean of the population you sample from.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "sigma": {
        "title": "Population standard deviation (σ)",
        "description": "The standard deviation of the population you sample from.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "p": {
        "title": "Population proportion (p)",
        "description": "The share of the population with the trait, between 0 and 1.",
        "type": "number",
        "exclusiveMinimum": 0,
        "exclusiveMaximum": 1
      },
      "n": {
        "title": "Sample size (n)",
        "description": "How many values are in each sample.",
        "type": "integer",
        "minimum": 1,
        "maximum": 1000000000
      },
      "find": {
        "title": "Probability",
        "description": "Whether to find the chance of a value between two numbers, below one, or above one.",
        "type": "string",
        "enum": [
          "between",
          "below",
          "above"
        ]
      },
      "a": {
        "title": "Lower value",
        "description": "The lower end, in the units of the statistic.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "b": {
        "title": "Upper value",
        "description": "The upper end, in the units of the statistic.",
        "type": "number",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      }
    }
  },
  "outputs": {
    "probability": {
      "label": "Probability",
      "description": "The chance that the statistic falls in the chosen range, by the normal approximation.",
      "format": "number"
    },
    "center": {
      "label": "Mean of the sampling distribution",
      "description": "The mean of the statistic: μ for x̄, nμ for Σx, and p for p̂.",
      "format": "number"
    },
    "se": {
      "label": "Standard error",
      "description": "The standard deviation of the statistic: σ ÷ √n for x̄, √n σ for Σx, and √(p(1 − p) ÷ n) for p̂.",
      "format": "number"
    },
    "zLo": {
      "label": "z of the lower value",
      "description": "How many standard errors the lower value is from the mean.",
      "format": "number"
    },
    "zHi": {
      "label": "z of the upper value",
      "description": "How many standard errors the upper value is from the mean.",
      "format": "number"
    },
    "check": {
      "label": "Normal approximation",
      "description": "A note on when the normal shape holds for these inputs.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "of": "proportion",
      "mu": 90,
      "sigma": 15,
      "p": 0.4,
      "n": 200,
      "find": "between",
      "a": 0.35,
      "b": 0.45
    },
    "outputs": {
      "probability": 0.8510853268212344,
      "center": 0.4,
      "se": 0.034641016151377546,
      "zLo": -1.4433756729740645,
      "zHi": 1.4433756729740645,
      "check": "np and n(1 − p) are both more than 5, so the normal approximation is reasonable."
    },
    "text": "The probability is 0.8511, with a sampling distribution of mean 0.4 and standard error 0.034641."
  },
  "examples": [
    {
      "given": {
        "of": "proportion",
        "p": 0.4,
        "n": 200,
        "find": "between",
        "a": 0.35,
        "b": 0.45
      },
      "expect": {
        "probability": 0.8510853268212344,
        "center": 0.4,
        "se": 0.034641016151377546,
        "zLo": -1.4433756729740645,
        "zHi": 1.4433756729740645
      },
      "source": "OpenStax, Introductory Business Statistics, §7.3 The Central Limit Theorem for Proportions (mean p, standard deviation √(p(1 − p) ÷ n)), https://openstax.org/books/introductory-business-statistics/pages/7-3-the-central-limit-theorem-for-proportions (retrieved 2026-10-05); hand calculation in content.mdx: √(0.4 × 0.6 ÷ 200) = √0.0012 = 0.034641, z = ±0.05 ÷ 0.034641 = ±1.4434; Python 3: math.erfc"
    },
    {
      "given": {
        "of": "mean",
        "mu": 100,
        "sigma": 12,
        "n": 36,
        "find": "below",
        "b": 103
      },
      "expect": {
        "probability": 0.9331927987311419,
        "center": 100,
        "se": 2,
        "zHi": 1.5
      },
      "source": "OpenStax, Introductory Statistics 2e, §7.1 The Central Limit Theorem for Sample Means (Averages) (x̄ ~ N(μ, σ ÷ √n); Example 7.1: μ = 90, σ = 15, n = 25, P(85 < x̄ < 92) = 0.6997), https://openstax.org/books/introductory-statistics-2e/pages/7-1-the-central-limit-theorem-for-sample-means-averages (retrieved 2026-10-05); hand calculation in content.mdx: 12 ÷ √36 = 2, z = 3 ÷ 2 = 1.5; Python 3: statistics.NormalDist().cdf(1.5)"
    }
  ],
  "sources": [
    "OpenStax, Introductory Business Statistics, §7.3 The Central Limit Theorem for Proportions: mean p and standard deviation √(p(1 − p) ÷ n). https://openstax.org/books/introductory-business-statistics/pages/7-3-the-central-limit-theorem-for-proportions (retrieved 2026-10-05)",
    "OpenStax, Introductory Statistics 2e, §7.1 The Central Limit Theorem for Sample Means (Averages): x̄ ~ N(μ, σ ÷ √n). https://openstax.org/books/introductory-statistics-2e/pages/7-1-the-central-limit-theorem-for-sample-means-averages (retrieved 2026-10-05)",
    "OpenStax, Introductory Statistics 2e, §7.2 The Central Limit Theorem for Sums: ΣX ~ N(nμ, √n σ). https://openstax.org/books/introductory-statistics-2e/pages/7-2-the-central-limit-theorem-for-sums (retrieved 2026-10-05)",
    "OpenStax, Introductory Statistics 2e, §8.3 A Population Proportion: the normal approximation needs np and n(1 − p) both more than 5. https://openstax.org/books/introductory-statistics-2e/pages/8-3-a-population-proportion (retrieved 2026-10-05)"
  ],
  "related": [
    "central-limit-theorem",
    "standard-error",
    "confidence-interval"
  ],
  "changelog": []
}
