{
  "aliases": [
    "counting-in-two-ways"
  ],
  "backlinks": null,
  "body": "\n## Summary\n\nDouble counting is a proof technique in combinatorics.\nTo prove that two expressions are equal, one shows that both count the elements of the same finite set.\nEach expression comes from a different way to count that set.\n\nA common form uses a relation $R \\subseteq A \\times B$ between finite sets $A$ and $B$.\nFor $a \\in A$, let $d(a)$ be the number of $b \\in B$ with $(a, b) \\in R$.\nFor $b \\in B$, let $e(b)$ be the number of $a \\in A$ with $(a, b) \\in R$.\nThen both sums count the pairs in $R$, so\n$$\\sum_{a \\in A} d(a) = |R| = \\sum_{b \\in B} e(b).$$\n\n## Remarks\n\nThe [[handshaking lemma|0XAP8WHNES]] is double counting applied to the pairs of a vertex and an edge that contains it.\nThe [[symmetry of binomial coefficients|0R7JS3DP3W]] has a short proof by this technique.\n\n## Explanations\n\n### L1 human\n\nCount the same thing in two ways, and the two answers must be equal.\nFor example, in a class each pair of friends shakes hands once. If you add the number of handshakes of each person, you count each handshake twice, so the sum is even.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "counting-in-two-ways"
    ],
    "kind": "concept",
    "msc": [
      "05A19"
    ],
    "name": "Double counting",
    "same_as": {
      "wikidata": "Q1191750",
      "wikipedia": "Double counting (proof technique)"
    },
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Double_counting_(proof_technique)"
      }
    ],
    "tag": "0F8YBHF2W3"
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/0F8YBHF2W3/",
  "links": null,
  "markdown": "https://math2.tamnd.com/node/0F8YBHF2W3.md",
  "msc": [
    "05A19"
  ],
  "name": "Double counting",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0F8/0F8YBHF2W3.md",
  "status": null,
  "tag": "0F8YBHF2W3",
  "uri": "m2://0F8YBHF2W3",
  "url": "https://math2.tamnd.com/wiki/double-counting/",
  "writing": {
    "tag": "0F8YBHF2W3",
    "kind": "concept",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
