{
  "aliases": [
    "cauchy-schwarz-inequality-for-random-variables"
  ],
  "backlinks": null,
  "body": "\n## Statement\n\nLet $X$ and $Y$ be real random variables on one probability space with $E[X^2] \u003c \\infty$ and $E[Y^2] \u003c \\infty$. Then $XY$ is integrable and\n$$\\left(E[XY]\\right)^2 \\le E[X^2] \\, E[Y^2].$$\nEquality holds if and only if $aX + bY = 0$ almost surely for some reals $a$ and $b$, not both $0$.\n\n## Remarks\n\nProof: for each real $s$, $0 \\le E[(X + sY)^2] = E[X^2] + 2s E[XY] + s^2 E[Y^2]$. A quadratic polynomial in $s$ that is never negative has a discriminant that is not positive.\nThis is the Cauchy–Schwarz inequality for the inner product $\\langle X, Y \\rangle = E[XY]$ on the space $L^2$ of square-integrable random variables.\nApplied to $X - E[X]$ and $Y - E[Y]$, it gives $\\operatorname{Cov}(X, Y)^2 \\le \\operatorname{Var}(X) \\operatorname{Var}(Y)$. So the correlation coefficient is in $[-1, 1]$.\n\n## Explanations\n\n### L1 human\n\nThe average of a product cannot be larger than what the sizes of the two factors allow.\nThis simple inequality is behind the fact that a correlation is always between $-1$ and $1$.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "aliases": [
      "cauchy-schwarz-inequality-for-random-variables"
    ],
    "kind": "statement",
    "msc": [
      "60E15"
    ],
    "name": "Cauchy–Schwarz inequality for expectations",
    "role": "theorem",
    "sources": [
      {
        "locator": "Probability theory",
        "url": "https://en.wikipedia.org/wiki/Cauchy–Schwarz_inequality"
      }
    ],
    "tag": "03PGHKAJG3",
    "uses": [
      "0DCT0QZVQ1",
      "0DJ8W3HP2D"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/03PGHKAJG3/",
  "links": [
    {
      "field": "uses",
      "target": "0DCT0QZVQ1"
    },
    {
      "field": "uses",
      "target": "0DJ8W3HP2D"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/03PGHKAJG3.md",
  "msc": [
    "60E15"
  ],
  "name": "Cauchy–Schwarz inequality for expectations",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/03P/03PGHKAJG3.md",
  "status": null,
  "tag": "03PGHKAJG3",
  "uri": "m2://03PGHKAJG3",
  "url": "https://math2.tamnd.com/wiki/cauchy-schwarz-inequality-for-expectations/",
  "writing": {
    "tag": "03PGHKAJG3",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
