{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Example\n\nLet $a \\ge 1$ and $b \\ge 1$ be integers.\nAn urn holds $a$ red balls and $b$ black balls.\nAt each step one draws a ball uniformly at random and notes its colour.\nThen one puts it back together with one more ball of the same colour.\nLet $R_n$ and $B_n$ be the numbers of red and black balls after $n$ steps, so $R_n + B_n = a + b + n$.\nThen $(R_n, B_n)$ is a [[Markov chain|0G48PYM96Q]], since the next draw depends only on the current contents.\nFrom $(r, k)$ it moves to $(r + 1, k)$ with probability $r/(r + k)$ and to $(r, k + 1)$ otherwise.\n\nThe fraction $M_n = R_n / (a + b + n)$ of red balls is a [[martingale|0D0GBNDKDH]]:\n$$\\mathbb{E}[M_{n+1} \\mid R_n, B_n] = \\frac{R_n}{R_n + B_n} \\cdot \\frac{R_n + 1}{R_n + B_n + 1} + \\frac{B_n}{R_n + B_n} \\cdot \\frac{R_n}{R_n + B_n + 1} = \\frac{R_n}{R_n + B_n} = M_n.$$\nIt takes values in $[0, 1]$, so it converges almost surely, and its limit has the [[beta distribution|0EW824Z7G2]] with parameters $a$ and $b$.\n\n## Remarks\n\nFor $a = b = 1$ the limit is uniform on $[0, 1]$, and $R_n$ is uniform on $\\set{1, 2, \\ldots, n + 1}$ for each $n$.\nThe sequence of colours drawn is [[exchangeable|4MR4YJS1ZD]]: the probability of a sequence depends only on how many red and black draws it contains.\nBy [[de Finetti's theorem|W19129PVKQ]], given the limit fraction $M$, the draws are independent with probability $M$ of red.\nThe urn shows that a random process can have a random limit: the rich get richer.\n\n## Explanations\n\n### L1 human\n\nEach draw of a colour makes that colour more likely next time.\nEarly luck has a lasting effect, so the proportion of red settles down, but to a value that is itself random.\nStarting with one red and one black ball, every final proportion between $0$ and $1$ is equally likely.\n",
  "commit": "5fc425f97f1f6b11da5892c2948ef8c5d8805665",
  "front": {
    "instance_of": [
      "0G48PYM96Q"
    ],
    "kind": "example",
    "msc": [
      "60C05",
      "60G42",
      "60J10"
    ],
    "name": "Pólya urn model",
    "same_as": {
      "wikidata": "Q2120628",
      "wikipedia": "Pólya urn model"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Pólya_urn_model"
      }
    ],
    "tag": "DHPXDFEEMF"
  },
  "kind": "example",
  "link": "https://math2.tamnd.com/node/DHPXDFEEMF/",
  "links": [
    {
      "field": "instance_of",
      "target": "0G48PYM96Q"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/DHPXDFEEMF.md",
  "msc": [
    "60C05",
    "60G42",
    "60J10"
  ],
  "name": "Pólya urn model",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/DHP/DHPXDFEEMF.md",
  "status": null,
  "tag": "DHPXDFEEMF",
  "uri": "m2://DHPXDFEEMF",
  "url": "https://math2.tamnd.com/wiki/polya-urn-model/",
  "writing": {
    "tag": "DHPXDFEEMF",
    "kind": "example",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
