{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $r \\ge 1$ be an integer and let $p \\in (0, 1]$.\nThe negative binomial distribution with parameters $r$ and $p$ is the distribution on $\\{0, 1, 2, \\dots\\}$ with the [[probability mass function|0WF4EJP91W]]\n$$p(k) = \\binom{k + r - 1}{k} p^r (1 - p)^k \\quad \\text{for } k = 0, 1, 2, \\dots$$\n\n## Remarks\n\nIt is the distribution of the number of failures before the $r$-th success in independent Bernoulli trials with success probability $p$. The last trial is a success, and the $k$ failures are among the other $k + r - 1$ trials.\nFor $r = 1$ it is the [[geometric distribution|0XCVV5Q500]]. The sum of $r$ independent geometric random variables with parameter $p$ has the negative binomial distribution with parameters $r$ and $p$.\nThe mean is $r(1 - p)/p$ and the variance is $r(1 - p)/p^2$.\nSome authors count the trials, or the successes before a fixed number of failures. Check the convention of each source.\n\n## Explanations\n\n### L1 human\n\nToss a coin until you have seen $r$ heads, and count the tails on the way.\nThis count has the negative binomial distribution. For $r = 1$ you wait only for the first head.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "defines": "0XBRG3965F",
    "kind": "definition",
    "msc": [
      "60E05"
    ],
    "name": "Negative binomial distribution",
    "sources": [
      {
        "locator": "Probability mass function",
        "url": "https://en.wikipedia.org/wiki/Negative_binomial_distribution"
      }
    ],
    "tag": "0XN7KEVSSS",
    "uses": [
      "0WF4EJP91W",
      "092GEF38YD",
      "0XCVV5Q500"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/0XN7KEVSSS/",
  "links": [
    {
      "field": "defines",
      "target": "0XBRG3965F"
    },
    {
      "field": "uses",
      "target": "0WF4EJP91W"
    },
    {
      "field": "uses",
      "target": "092GEF38YD"
    },
    {
      "field": "uses",
      "target": "0XCVV5Q500"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0XN7KEVSSS.md",
  "msc": [
    "60E05"
  ],
  "name": "Negative binomial distribution",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0XN/0XN7KEVSSS.md",
  "status": null,
  "tag": "0XN7KEVSSS",
  "uri": "m2://0XN7KEVSSS",
  "url": "https://math2.tamnd.com/wiki/negative-binomial-distribution-definition/",
  "writing": {
    "tag": "0XN7KEVSSS",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
