{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $X_1, X_2, \\dots$ be [[independent and identically distributed|00MRN0FARV]] real random variables with $E\\abs{X_1} \u003c \\infty$.\nLet $S_n = X_1 + \\cdots + X_n$.\nLet $N$ be a [[stopping time|WND87FBAKC]] with values in $\\set{1, 2, \\dots}$ with respect to the filtration $\\mathcal{F}_n = \\sigma(X_1, \\dots, X_n)$, and assume $E[N] \u003c \\infty$.\nThen\n$$E[S_N] = E[N] \\, E[X_1],$$\nwhere $E$ is the [[expectation|0WQNRCNY3M]].\n\n## Remarks\n\nWrite $S_N = \\sum_{i \\ge 1} X_i \\mathbf{1}_{\\set{N \\ge i}}$.\nThe event $\\set{N \\ge i}$ is the complement of $\\set{N \\le i - 1}$, so it depends only on $X_1, \\dots, X_{i-1}$ and is independent of $X_i$.\nHence $E[X_i \\mathbf{1}_{\\set{N \\ge i}}] = E[X_1] \\, P(N \\ge i)$, and summing over $i$ gives $E[X_1] \\sum_i P(N \\ge i) = E[X_1] \\, E[N]$.\nThe same computation with $\\abs{X_i}$ shows that the series converges absolutely, which justifies exchanging sum and expectation.\n\nThe hypothesis $E[N] \u003c \\infty$ is necessary.\nFor the simple symmetric [[random walk|04VZE3FZXF]], with $P(X_i = 1) = P(X_i = -1) = 1/2$, let $N$ be the first $n$ with $S_n = 1$.\nThen $N$ is finite with probability one and $S_N = 1$, so $E[S_N] = 1$, while $E[X_1] = 0$; here $E[N] = \\infty$.\n\n## Explanations\n\n### L1 human\n\nA gambler plays a game many times and decides when to stop using only what has happened so far.\nWald's equation says that the expected total winnings equal the expected number of games times the expected winnings per game.\nSo no stopping strategy turns a fair game into a profitable one, provided the expected number of games is finite.\n\n### L2 human\n\nWald's equation is a key tool in [[sequential analysis|9CWYNB9003]], where it gives the expected sample size of the sequential probability ratio test from the drift of the log-likelihood ratio.\nIt is also used in renewal theory and queueing theory.\nIt can also be derived from the [[optional stopping theorem|DC9HZT2HVJ]] applied to the martingale $S_n - n E[X_1]$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "WND87FBAKC"
    ],
    "kind": "statement",
    "msc": [
      "60G50",
      "62L10",
      "60G40"
    ],
    "name": "Wald's equation",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q937458",
      "wikipedia": "Wald's equation"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Wald%27s_equation"
      }
    ],
    "tag": "CTDG4MZC8D",
    "uses": [
      "00MRN0FARV",
      "WND87FBAKC",
      "0WQNRCNY3M",
      "04VZE3FZXF",
      "9CWYNB9003",
      "DC9HZT2HVJ"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/CTDG4MZC8D/",
  "links": [
    {
      "field": "about",
      "target": "WND87FBAKC"
    },
    {
      "field": "uses",
      "target": "00MRN0FARV"
    },
    {
      "field": "uses",
      "target": "WND87FBAKC"
    },
    {
      "field": "uses",
      "target": "0WQNRCNY3M"
    },
    {
      "field": "uses",
      "target": "04VZE3FZXF"
    },
    {
      "field": "uses",
      "target": "9CWYNB9003"
    },
    {
      "field": "uses",
      "target": "DC9HZT2HVJ"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/CTDG4MZC8D.md",
  "msc": [
    "60G50",
    "62L10",
    "60G40"
  ],
  "name": "Wald's equation",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/CTD/CTDG4MZC8D.md",
  "status": null,
  "tag": "CTDG4MZC8D",
  "uri": "m2://CTDG4MZC8D",
  "url": "https://tamnd.github.io/math2/wiki/walds-equation/",
  "writing": {
    "tag": "CTDG4MZC8D",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
