{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $n$ and $k$ be natural numbers with $n \\ge 1$.\nThen the number of multisets of size $k$ with elements in an $n$-element set is\n$$\\left(\\!\\binom{n}{k}\\!\\right) = \\binom{n + k - 1}{k}.$$\nEquivalently, this is the number of solutions $(x_1, \\dots, x_n)$ of $x_1 + \\dots + x_n = k$ in natural numbers.\n\n## Remarks\n\nThe proof writes a multiset as a row of $k$ stars and $n - 1$ bars. The bars separate the stars into $n$ groups, one group for each element.\nThe number of solutions in positive integers is $\\binom{k - 1}{n - 1}$ for $k \\ge 1$. This is the [[number of compositions|057H72B2MB]] of $k$ into $n$ parts.\n\n## Explanations\n\n### L1 human\n\nTo share $k$ identical sweets among $n$ children, put the $k$ sweets in a row and insert $n - 1$ dividers.\nThere are $k + n - 1$ positions, and you choose which $k$ of them are sweets.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "statement",
    "msc": [
      "05A10"
    ],
    "name": "Stars and bars",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q7602343",
      "wikipedia": "Stars and bars (combinatorics)"
    },
    "sources": [
      {
        "locator": "Theorem two",
        "url": "https://en.wikipedia.org/wiki/Stars_and_bars_(combinatorics)"
      }
    ],
    "tag": "009TEMTQKH",
    "uses": [
      "092GEF38YD",
      "0YEQG3VBYC"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/009TEMTQKH/",
  "links": [
    {
      "field": "uses",
      "target": "092GEF38YD"
    },
    {
      "field": "uses",
      "target": "0YEQG3VBYC"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/009TEMTQKH.md",
  "msc": [
    "05A10"
  ],
  "name": "Stars and bars",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/009/009TEMTQKH.md",
  "status": null,
  "tag": "009TEMTQKH",
  "uri": "m2://009TEMTQKH",
  "url": "https://math2.tamnd.com/wiki/stars-and-bars/",
  "writing": {
    "tag": "009TEMTQKH",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
