{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $S(n,m)$ be the number of [[surjective functions|01RVCMSN5N]] from the set $[n] = \\{1, \\dots, n\\}$ onto the set $[m] = \\{1, \\dots, m\\}$.\nThen\n$$S(n,m) = \\sum_{k=0}^{m} (-1)^k \\binom{m}{k} (m-k)^n,$$\nwhere $\\binom{m}{k}$ is a [[binomial coefficient|0GBZM0MT0F]].\n\n## Remarks\n\nThe term $(m-k)^n$ is the number of all functions from $[n]$ to a fixed set of $m-k$ elements.\nThe sum comes from the inclusion-exclusion principle: count all functions, then correct for the functions that miss some chosen set of $k$ values of $[m]$.\n",
  "commit": "bdea0329dc328964ec62566e23a0159c6ce93f2d",
  "front": {
    "kind": "statement",
    "msc": [
      "05A05",
      "05A19"
    ],
    "name": "Formula for the number of surjections between finite sets",
    "role": "theorem",
    "sources": [
      {
        "locator": "source/s_inclusion-exclusion_surjections.ptx:29",
        "url": "https://github.com/mitchkeller/applied-combinatorics/blob/ebd95d6bd59e23c633c65cf560bcb93efa912aae/source/s_inclusion-exclusion_surjections.ptx#L29"
      }
    ],
    "tag": "X9JC3BH2T0",
    "uses": [
      "01RVCMSN5N",
      "0GBZM0MT0F"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/X9JC3BH2T0/",
  "links": [
    {
      "field": "uses",
      "target": "01RVCMSN5N"
    },
    {
      "field": "uses",
      "target": "0GBZM0MT0F"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/X9JC3BH2T0.md",
  "msc": [
    "05A05",
    "05A19"
  ],
  "name": "Formula for the number of surjections between finite sets",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/X9J/X9JC3BH2T0.md",
  "status": null,
  "tag": "X9JC3BH2T0",
  "uri": "m2://X9JC3BH2T0",
  "url": "https://math2.tamnd.com/wiki/formula-for-the-number-of-surjections-between-finite-sets/",
  "writing": {
    "tag": "X9JC3BH2T0",
    "kind": "statement",
    "level": "W1",
    "next": [
      {
        "what": "edge about out",
        "note": "the concepts that the statement is about",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge proves in",
        "note": "at least one proof node",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of or illustrates in",
        "note": "one example that shows the statement at work",
        "have": 0,
        "want": 1
      },
      {
        "what": "explanation L2",
        "have": 0,
        "want": 1
      }
    ]
  }
}
