{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe expand the square and use linearity of expectation.\n\n1. Let $X$ be a real random variable with $E[X^2] \u003c \\infty$.\n2. For each real $x$, $(\\abs{x} - 1)^2 \\ge 0$, so $\\abs{x} \\le (1 + x^2)/2$.\n3. Hence $0 \\le \\abs{X} \\le (1 + X^2)/2$. The integral of nonnegative functions is monotone, so the [[expected value|0DCT0QZVQ1]] $E[\\abs{X}]$ is at most $(1 + E[X^2])/2 \u003c \\infty$.\n4. So $X$ is integrable. Let $m = E[X]$, a real number. The [[variance|007QED3E0Y]] of $X$ is $E[(X - m)^2]$.\n5. Pointwise, $(X - m)^2 = X^2 - 2mX + m^2$.\n6. The variables $X^2$, $X$ and the constant $m^2$ are integrable. By [[linearity of expectation|0P7PTC8DDE]], $E[(X - m)^2] = E[X^2] - 2m E[X] + m^2$.\n7. Since $E[X] = m$, the right side is $E[X^2] - 2m^2 + m^2 = E[X^2] - m^2$.\n8. So $\\operatorname{Var}(X) = E[X^2] - (E[X])^2$.\n\n## Idea\n\nSquare out $(X - m)^2$ and take the expectation of each term. The cross term gives $-2m^2$, which cancels the constant $m^2$ down to $-m^2$.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "60A05"
    ],
    "name": "Proof of the formula for the variance as the mean of the square minus the square of the mean",
    "proves": "0NMF95YK8W",
    "sources": [
      {
        "locator": "Definition",
        "url": "https://en.wikipedia.org/wiki/Variance"
      }
    ],
    "tag": "H81VD38Y1B",
    "uses": [
      "0DCT0QZVQ1",
      "007QED3E0Y",
      "0P7PTC8DDE"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/H81VD38Y1B/",
  "links": [
    {
      "field": "proves",
      "target": "0NMF95YK8W"
    },
    {
      "field": "uses",
      "target": "0DCT0QZVQ1"
    },
    {
      "field": "uses",
      "target": "007QED3E0Y"
    },
    {
      "field": "uses",
      "target": "0P7PTC8DDE"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/H81VD38Y1B.md",
  "msc": [
    "60A05"
  ],
  "name": "Proof of the formula for the variance as the mean of the square minus the square of the mean",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/H81/H81VD38Y1B.md",
  "status": null,
  "tag": "H81VD38Y1B",
  "uri": "m2://H81VD38Y1B",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-formula-for-the-variance-as-the-mean-of-the-square-minus-the-square-of-the-mean/",
  "writing": {
    "tag": "H81VD38Y1B",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
