{
  "aliases": [
    "computational-formula-for-variance"
  ],
  "backlinks": [
    {
      "field": "uses",
      "target": "03BY5XTNA4"
    }
  ],
  "body": "\n## Statement\n\nLet $X$ be a real random variable with $E[X^2] \u003c \\infty$. Then\n$$\\operatorname{Var}(X) = E[X^2] - (E[X])^2.$$\n\n## Remarks\n\nProof: with $\\mu = E[X]$, $(X - \\mu)^2 = X^2 - 2\\mu X + \\mu^2$. By [[linearity of expectation|0P7PTC8DDE]], $E[(X - \\mu)^2] = E[X^2] - 2\\mu^2 + \\mu^2 = E[X^2] - \\mu^2$.\nAs a corollary, $(E[X])^2 \\le E[X^2]$.\nFor a fair die, $E[X^2] = 91/6$ and $E[X] = 7/2$, so $\\operatorname{Var}(X) = 91/6 - 49/4 = 35/12$.\nIn floating-point arithmetic, this formula can lose much precision when $E[X^2]$ and $(E[X])^2$ are close.\n\n## Explanations\n\n### L1 human\n\nThis formula is often the fastest way to compute a variance: find the average of the squares and subtract the square of the average.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "computational-formula-for-variance"
    ],
    "kind": "statement",
    "msc": [
      "60A05"
    ],
    "name": "Variance as the mean of the square minus the square of the mean",
    "role": "proposition",
    "sources": [
      {
        "locator": "Definition",
        "url": "https://en.wikipedia.org/wiki/Variance"
      }
    ],
    "tag": "0NMF95YK8W",
    "uses": [
      "007QED3E0Y",
      "0P7PTC8DDE"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/0NMF95YK8W/",
  "links": [
    {
      "field": "uses",
      "target": "007QED3E0Y"
    },
    {
      "field": "uses",
      "target": "0P7PTC8DDE"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0NMF95YK8W.md",
  "msc": [
    "60A05"
  ],
  "name": "Variance as the mean of the square minus the square of the mean",
  "prov": null,
  "role": "proposition",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0NM/0NMF95YK8W.md",
  "status": null,
  "tag": "0NMF95YK8W",
  "uri": "m2://0NMF95YK8W",
  "url": "https://math2.tamnd.com/wiki/variance-as-the-mean-of-the-square-minus-the-square-of-the-mean/",
  "writing": {
    "tag": "0NMF95YK8W",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
