{
  "aliases": [
    "lotus",
    "change-of-variables-formula-for-expectation"
  ],
  "backlinks": [
    {
      "field": "uses",
      "target": "0MYDNRT7PP"
    },
    {
      "field": "uses",
      "target": "0PH0VHTQS0"
    }
  ],
  "body": "\n## Statement\n\nLet $X$ be a random variable on $(\\Omega, \\mathcal{F}, P)$ with values in $(E, \\mathcal{E})$ and with [[law|0TST4MHA3A]] $\\mu_X$. Let $g \\colon E \\to \\mathbb{R}$ be measurable.\nThen $g(X)$ is integrable if and only if $\\int_E |g| \\, d\\mu_X \u003c \\infty$. In that case,\n$$E[g(X)] = \\int_E g(x) \\, \\mu_X(dx).$$\nIn particular, if $X$ is discrete with [[mass function|0WF4EJP91W]] $p$, then $E[g(X)] = \\sum_x g(x) \\, p(x)$. If $X$ is real with [[density|04YG690N5V]] $f$, then $E[g(X)] = \\int_{-\\infty}^{\\infty} g(x) f(x) \\, dx$.\n\n## Remarks\n\nThe formula also holds for $g \\ge 0$ without any integrability condition, with both sides in $[0, \\infty]$.\nThe proof checks the formula first for indicator functions $g = 1_B$, where it says $P(X \\in B) = \\mu_X(B)$. Then it extends to simple, nonnegative and integrable $g$.\nThe point is that one does not need the law of $g(X)$ to compute $E[g(X)]$.\n\n## History\n\nThe name refers to statisticians who use the formula as the definition of $E[g(X)]$. They are \"unconscious\" that it is a theorem that needs a proof.\n\n## Explanations\n\n### L1 human\n\nTo find the average of $g(X)$, you can average $g(x)$ over the values $x$ of $X$ with their probabilities.\nFor a fair die, $E[X^2] = (1 + 4 + 9 + 16 + 25 + 36)/6 = 91/6$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "lotus",
      "change-of-variables-formula-for-expectation"
    ],
    "kind": "statement",
    "msc": [
      "60A05"
    ],
    "name": "Law of the unconscious statistician",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q6503509",
      "wikipedia": "Law of the unconscious statistician"
    },
    "sources": [
      {
        "locator": "Measure-theoretic formulation",
        "url": "https://en.wikipedia.org/wiki/Law_of_the_unconscious_statistician"
      }
    ],
    "tag": "01ZWX875AT",
    "uses": [
      "0DCT0QZVQ1",
      "0TST4MHA3A",
      "0WF4EJP91W",
      "04YG690N5V"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/01ZWX875AT/",
  "links": [
    {
      "field": "uses",
      "target": "0DCT0QZVQ1"
    },
    {
      "field": "uses",
      "target": "0TST4MHA3A"
    },
    {
      "field": "uses",
      "target": "0WF4EJP91W"
    },
    {
      "field": "uses",
      "target": "04YG690N5V"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/01ZWX875AT.md",
  "msc": [
    "60A05"
  ],
  "name": "Law of the unconscious statistician",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/01Z/01ZWX875AT.md",
  "status": null,
  "tag": "01ZWX875AT",
  "uri": "m2://01ZWX875AT",
  "url": "https://math2.tamnd.com/wiki/law-of-the-unconscious-statistician/",
  "writing": {
    "tag": "01ZWX875AT",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
