{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "5F76XA1ABC"
    }
  ],
  "body": "\n## Statement\n\nLet $a \u003c b$ be real numbers and let $f \\colon [a, b] \\to \\R$ be a [[continuous function|0X3WGX95FE]] with $f(a) f(b) \u003c 0$.\nThe *bisection method* sets $a_0 = a$ and $b_0 = b$.\nFor $k \\ge 0$ it lets $m_k = (a_k + b_k)/2$ and proceeds as follows.\nIf $f(m_k) = 0$ it stops with the zero $m_k$; if $f(a_k) f(m_k) \u003c 0$ it sets $(a_{k+1}, b_{k+1}) = (a_k, m_k)$; otherwise it sets $(a_{k+1}, b_{k+1}) = (m_k, b_k)$.\nIf the method does not stop, then for every $k \\ge 0$:\n\n1. $f(a_k) f(b_k) \u003c 0$, so $[a_k, b_k]$ contains a zero of $f$;\n2. $b_k - a_k = (b - a)/2^k$;\n3. the sequences $(a_k)$, $(b_k)$ and $(m_k)$ converge to the same zero $r$ of $f$, and $\\abs{m_k - r} \\le (b - a)/2^{k+1}$.\n\n## Remarks\n\nClause 1 holds by induction, since the new interval keeps an endpoint where $f$ is negative and one where it is positive.\nThe [[intermediate value theorem|00KAFBR32E]] then gives a zero in it.\nClause 2 is immediate, and the [[nested intervals theorem|MF56GK7QY2]] gives a common limit $r$ of $a_k$ and $b_k$; by continuity $f(r)^2 = \\lim f(a_k) f(b_k) \\le 0$, so $f(r) = 0$.\nExample: for $f(x) = x^2 - 2$ on $[1, 2]$, the midpoints are $1.5, 1.25, 1.375, 1.4375, \\ldots$, and $20$ steps locate $\\sqrt{2}$ within $2^{-21} \u003c 5 \\times 10^{-7}$.\nContinuity is needed: $f(x) = 1/x$ for $x \\ne 0$ and $f(0) = 1$ changes sign on $[-1, 1]$, and bisection gives $[-1, 0], [-1/2, 0], \\ldots$ and converges to $0$, which is not a zero.\nThe error bound halves at each step, so the method converges linearly with ratio $1/2$ in the sense of the error bound, whatever $f$ is.\n\n## Explanations\n\n### L1 human\n\nIf a continuous function is negative at one end of an interval and positive at the other, it must cross zero somewhere in between.\nCheck the middle: the sign there tells which half still has a crossing.\nKeep halving.\nAfter $k$ steps the zero is trapped in an interval $2^k$ times shorter than at the start.\n\n### L2 human\n\nBisection is the simplest [[root-finding algorithm|TR4CNS5PMJ]] and the most robust: it needs only continuity and a sign change, and its error bound is known in advance.\nIt gains one binary digit per step, so it is slow compared with [[Newton's method|07EXVNF9VP]] or the [[secant method|9ZC177PVPC]].\nPractical methods such as [[Brent's method|5F76XA1ABC]] combine a fast open method with bisection steps to keep the guarantee.\nIt is also the constructive content of the intermediate value theorem.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "TR4CNS5PMJ"
    ],
    "kind": "statement",
    "msc": [
      "65H05"
    ],
    "name": "Bisection method",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q866300",
      "wikipedia": "Bisection method"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Bisection_method"
      }
    ],
    "tag": "7VMYC7MB3Q",
    "uses": [
      "TR4CNS5PMJ",
      "0X3WGX95FE",
      "00KAFBR32E",
      "MF56GK7QY2"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/7VMYC7MB3Q/",
  "links": [
    {
      "field": "about",
      "target": "TR4CNS5PMJ"
    },
    {
      "field": "uses",
      "target": "TR4CNS5PMJ"
    },
    {
      "field": "uses",
      "target": "0X3WGX95FE"
    },
    {
      "field": "uses",
      "target": "00KAFBR32E"
    },
    {
      "field": "uses",
      "target": "MF56GK7QY2"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/7VMYC7MB3Q.md",
  "msc": [
    "65H05"
  ],
  "name": "Bisection method",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/7VM/7VMYC7MB3Q.md",
  "status": null,
  "tag": "7VMYC7MB3Q",
  "uri": "m2://7VMYC7MB3Q",
  "url": "https://tamnd.github.io/math2/wiki/bisection-method/",
  "writing": {
    "tag": "7VMYC7MB3Q",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
