{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $k \\ge 1$, and let $a_1, \\dots, a_k \u003e 0$ and $0 \u003c b_1, \\dots, b_k \u003c 1$ be real constants.\nLet $g \\colon [1, \\infty) \\to [0, \\infty)$ satisfy the polynomial growth condition: there are constants $c_1, c_2 \u003e 0$ such that $c_1 g(x) \\le g(u) \\le c_2 g(x)$ for all $x \\ge 1$, all $i$ and all $u \\in [b_i x, x]$.\nLet $h_1, \\dots, h_k$ be real functions with $\\abs{h_i(x)} = O(x / (\\log x)^2)$, in [[big O notation|0TGV80E6A4]].\nLet $x_0$ be large enough, and let $T \\colon [1, \\infty) \\to \\R$ be positive and bounded above and below by positive constants on $[1, x_0]$, and satisfy the recurrence\n$$T(x) = g(x) + \\sum_{i=1}^{k} a_i\\, T\\big(b_i x + h_i(x)\\big) \\qquad (x \u003e x_0).$$\nLet $p$ be the unique real number with $\\sum_{i=1}^{k} a_i b_i^p = 1$.\nThen\n$$T(x) = \\Theta\\left( x^p \\left( 1 + \\int_1^x \\frac{g(u)}{u^{p+1}}\\, du \\right) \\right),$$\nwhere $f(x) = \\Theta(F(x))$ means that $c F(x) \\le f(x) \\le C F(x)$ for some constants $0 \u003c c \\le C$ and all large $x$.\n\n## Remarks\n\nThe number $p$ exists and is unique because $s \\mapsto \\sum a_i b_i^s$ is continuous and strictly decreasing, with limits $\\infty$ and $0$.\nThe proof is by induction on $x$: one guesses the bound with suitable constants and checks that the recurrence preserves it.\nThe growth condition on $g$ is used to compare $g$ at $b_i x$ and at $x$.\nThe perturbations $h_i$ cover floors and ceilings, such as $T(\\lceil x/2 \\rceil)$, which appear in real algorithms.\nExample: for $T(x) = T(x/3) + T(2x/3) + x$, one has $p = 1$ since $1/3 + 2/3 = 1$, and $\\int_1^x u/u^2\\, du = \\log x$, so $T(x) = \\Theta(x \\log x)$.\nThe growth condition on $g$ is needed.\nFor $T(x) = T(x/2) + 2^x$, one has $p = 0$, and the formula would give the order $2^x / x$, since $\\int_1^x 2^u u^{-1}\\, du$ grows like $2^x/(x \\log 2)$; but $T(x) \\ge 2^x$.\nHere $g(x) = 2^x$ fails the growth condition, as $g(x)/g(x/2) = 2^{x/2}$ is unbounded.\n\n## Explanations\n\n### L1 human\n\nDivide-and-conquer algorithms split a problem of size $x$ into smaller pieces of sizes $b_i x$, solve them, and pay $g(x)$ to split and combine.\nTheir running time satisfies a recurrence like the one above.\nThe theorem gives the order of growth of the running time directly, without solving the recurrence.\nFor merge sort, $T(x) = 2 T(x/2) + x$ gives $p = 1$ and $T(x) = \\Theta(x \\log x)$.\n\n### L2 human\n\nThe theorem generalizes the master theorem of algorithm analysis, which handles only equal subproblem sizes $T(x) = a T(x/b) + g(x)$.\nHere the pieces may have different sizes $b_i x$, and small perturbations $h_i$ are allowed.\nTo use it, first solve $\\sum a_i b_i^p = 1$ for $p$, then compute the integral of $g(u)/u^{p+1}$.\nIf $g(x) = x^q$ with $q \u003c p$, the integral stays bounded and $T = \\Theta(x^p)$; if $q = p$, one gets $\\Theta(x^p \\log x)$; if $q \u003e p$, one gets $\\Theta(x^q)$.\nIn Mathlib a version is `AkraBazziRecurrence.isTheta_asympBound`.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "0FYX44GP92"
    ],
    "kind": "statement",
    "msc": [
      "68W40",
      "39A22"
    ],
    "name": "Akra–Bazzi theorem",
    "role": "theorem",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Akra%E2%80%93Bazzi_method"
      }
    ],
    "tag": "VZ1J7KM4QS",
    "uses": [
      "0TGV80E6A4",
      "0FYX44GP92"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/VZ1J7KM4QS/",
  "links": [
    {
      "field": "about",
      "target": "0FYX44GP92"
    },
    {
      "field": "uses",
      "target": "0TGV80E6A4"
    },
    {
      "field": "uses",
      "target": "0FYX44GP92"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/VZ1J7KM4QS.md",
  "msc": [
    "68W40",
    "39A22"
  ],
  "name": "Akra–Bazzi theorem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/VZ1/VZ1J7KM4QS.md",
  "status": null,
  "tag": "VZ1J7KM4QS",
  "uri": "m2://VZ1J7KM4QS",
  "url": "https://tamnd.github.io/math2/wiki/akra-bazzi-theorem/",
  "writing": {
    "tag": "VZ1J7KM4QS",
    "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
      }
    ]
  }
}
