{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "XHTYZ7ER4Z"
    }
  ],
  "body": "\n## Statement\n\nLet $(X_n)_{n \\ge 0}$ be a [[martingale|0CDVK9RQBH]] with respect to a [[filtration|HNK1Y62G7V]] $(\\mathcal{F}_n)_{n \\ge 0}$, and let $\\tau$ be a [[stopping time|WND87FBAKC]] for $(\\mathcal{F}_n)$.\nAssume that one of the following holds:\n\n1. There is a constant $N$ with $\\tau \\le N$ almost surely.\n2. $E[\\tau] \u003c \\infty$, and there is a constant $c$ with $E\\bigl[\\abs{X_{n+1} - X_n} \\mid \\mathcal{F}_n\\bigr] \\le c$ almost surely on the event $\\{\\tau \u003e n\\}$, for all $n \\ge 0$.\n3. $\\tau \u003c \\infty$ almost surely, and there is a constant $c$ with $\\abs{X_{n \\wedge \\tau}} \\le c$ almost surely for all $n \\ge 0$.\n\nThen $X_\\tau$ is integrable and $E[X_\\tau] = E[X_0]$.\nIf $(X_n)$ is only a [[submartingale|EQ055QMACW]], the same hypotheses give $E[X_\\tau] \\ge E[X_0]$.\n\n## Remarks\n\nThe [[stopped process|NG35MGYDZR]] $(X_{n \\wedge \\tau})_{n \\ge 0}$ is again a martingale, so $E[X_{n \\wedge \\tau}] = E[X_0]$ for every $n$.\nEach hypothesis lets one pass to the limit $n \\to \\infty$.\nIn case 1 take $n = N$.\nIn cases 2 and 3 use dominated convergence, with the bound $\\abs{X_0} + \\sum_{k \u003c \\tau} \\abs{X_{k+1} - X_k}$ in case 2 and the constant $c$ in case 3.\nExample: let $S_n$ be the simple symmetric random walk from $0$, let $a, b$ be positive integers, and let $\\tau$ be the first time $S_n \\in \\{-a, b\\}$.\nCase 3 applies, so $0 = E[S_\\tau] = b\\,P(S_\\tau = b) - a\\,(1 - P(S_\\tau = b))$, which gives $P(S_\\tau = b) = a/(a + b)$.\nSome hypothesis is needed: if $\\tau$ is the first time the same walk hits $1$, then $\\tau \u003c \\infty$ almost surely but $E[S_\\tau] = 1 \\ne 0 = E[S_0]$; here $E[\\tau] = \\infty$ and the stopped walk is unbounded below.\n\n## Explanations\n\n### L1 human\n\nIn a fair game, no rule for deciding when to quit can give you an expected profit.\nThis is true as long as the rule only uses the past, and the game cannot drag on in an uncontrolled way.\nThe theorem makes \"uncontrolled\" precise with three alternative conditions.\nWithout such conditions, the strategy \"play until you are one unit ahead\" would beat a fair game, but it may take an unbounded time and unbounded credit.\n\n### L2 human\n\nThe theorem is the main tool for computing hitting probabilities and expected hitting times of random walks and Brownian motion.\nFor example, applying it to the martingale $S_n^2 - n$ in the gambler's ruin gives $E[\\tau] = ab$.\nIt gives a short proof of [[Doob's martingale inequality|4G53E7BRXF]].\nIn continuous time the same result holds for right-continuous martingales.\nFor uniformly integrable martingales it holds for all stopping times, with $X_\\infty$ the limit from [[Doob's martingale convergence theorems|MRXBC4ZNRR]].\n",
  "commit": "5fc425f97f1f6b11da5892c2948ef8c5d8805665",
  "front": {
    "about": [
      "0D0GBNDKDH",
      "WND87FBAKC"
    ],
    "kind": "statement",
    "msc": [
      "60G42",
      "60G40"
    ],
    "name": "Optional stopping theorem",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q2027347",
      "wikipedia": "Optional stopping theorem"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Optional_stopping_theorem"
      }
    ],
    "tag": "DC9HZT2HVJ",
    "uses": [
      "0CDVK9RQBH",
      "EQ055QMACW",
      "WND87FBAKC",
      "NG35MGYDZR",
      "0DCT0QZVQ1"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/DC9HZT2HVJ/",
  "links": [
    {
      "field": "about",
      "target": "0D0GBNDKDH"
    },
    {
      "field": "about",
      "target": "WND87FBAKC"
    },
    {
      "field": "uses",
      "target": "0CDVK9RQBH"
    },
    {
      "field": "uses",
      "target": "EQ055QMACW"
    },
    {
      "field": "uses",
      "target": "WND87FBAKC"
    },
    {
      "field": "uses",
      "target": "NG35MGYDZR"
    },
    {
      "field": "uses",
      "target": "0DCT0QZVQ1"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/DC9HZT2HVJ.md",
  "msc": [
    "60G42",
    "60G40"
  ],
  "name": "Optional stopping theorem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/DC9/DC9HZT2HVJ.md",
  "status": null,
  "tag": "DC9HZT2HVJ",
  "uri": "m2://DC9HZT2HVJ",
  "url": "https://math2.tamnd.com/wiki/optional-stopping-theorem/",
  "writing": {
    "tag": "DC9HZT2HVJ",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
