{
  "id": "recurrence-relation",
  "title": "Recurrence Relation",
  "lang": "en",
  "source_lang": "en",
  "summary": "A recurrence relation specifies terms of a sequence through other terms, usually earlier ones, and initial conditions select a particular solution.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Recurrence equation",
    "Recursive relation"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/recurrence-relation/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/recurrence-relation/",
      "json": "https://aiwiki.page/zh/recurrence-relation.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A recurrence relation is an equation that relates terms of a sequence to other terms of the same sequence, usually at smaller indices. Together with suitable initial conditions, it can define a sequence by successive computation. Recurrence relations express recursion mathematically and are used to describe numerical patterns and analyze algorithms. Solving a recurrence generally means finding an explicit formula or determining how its solutions grow. (discrete.openmathbooks.org)"
    },
    {
      "heading": "Definition and initial conditions",
      "text": "A common finite-order form is\n\n\\[a_n=F(n,a_{n-1},a_{n-2},\\ldots,a_{n-k}), \\qquad n\\ge k,\\]\n\nwhere \\(F\\) is a specified function and \\(k\\) is a fixed positive integer. When \\(F\\) genuinely depends on the term \\(k\\) steps earlier, the recurrence has order \\(k\\). For this explicit form, specifying \\(a_0,\\ldots,a_{k-1}\\) determines subsequent terms uniquely, provided every evaluation of \\(F\\) is defined. A recurrence without initial conditions normally describes a family of sequences rather than one sequence. (ocw.mit.edu)\n\nFor example,\n\n\\[a_n=a_{n-1}+d,\\qquad a_0=A\\]\n\ngives \\(a_n=A+nd\\). Likewise, \\(a_n=ra_{n-1}\\) gives \\(a_n=Ar^n\\). These illustrate the distinction between a recursive specification, which refers to previous values, and a closed-form expression, which computes a term directly from its index. A proposed formula can be verified using mathematical induction: check the initial values, then show that the formula satisfies the recurrence. (discrete.openmathbooks.org)"
    },
    {
      "heading": "Classification",
      "text": "A recurrence is linear when its sequence terms occur to the first power and are not multiplied together. A linear recurrence of order \\(k\\) can be written\n\n\\[a_n=c_1(n)a_{n-1}+\\cdots+c_k(n)a_{n-k}+g(n).\\]\n\nIt has constant coefficients when the \\(c_j(n)\\) are independent of \\(n\\). It is homogeneous when \\(g(n)=0\\), and nonhomogeneous otherwise. For a homogeneous linear recurrence, any linear combination of solutions is again a solution. For a nonhomogeneous recurrence, the general solution is a particular solution plus the general solution of the corresponding homogeneous relation. (ocw.mit.edu)\n\nVariable coefficients need not make a recurrence nonlinear. For instance, factorials satisfy \\(a_n=na_{n-1}\\), with \\(a_0=1\\), which is linear but has a coefficient depending on \\(n\\). By contrast, an expression involving \\(a_{n-1}^2\\) is nonlinear. Thus linearity, coefficient dependence, and homogeneity are separate classification criteria. (ocw.mit.edu)"
    },
    {
      "heading": "Characteristic-root method",
      "text": "For a homogeneous linear recurrence with constant coefficients,\n\n\\[a_n=c_1a_{n-1}+\\cdots+c_ka_{n-k},\\]\n\nsubstitution of an exponential trial solution \\(a_n=r^n\\) leads to the characteristic polynomial\n\n\\[p(r)=r^k-c_1r^{k-1}-\\cdots-c_k.\\]\n\nAssuming \\(c_k\\ne0\\), if its roots \\(r_1,\\ldots,r_k\\) are distinct, the general solution is\n\n\\[a_n=C_1r_1^n+\\cdots+C_kr_k^n.\\]\n\nThe constants are determined from the initial conditions through a system of linear equations. A root \\(r\\) of multiplicity \\(m\\) instead contributes\n\n\\[(C_0+C_1n+\\cdots+C_{m-1}n^{m-1})r^n.\\]\n\nThe method also accommodates complex roots. (math.libretexts.org)\n\nThe Fibonacci sequence is the standard second-order example:\n\n\\[F_0=0,\\qquad F_1=1,\\qquad F_n=F_{n-1}+F_{n-2}.\\]\n\nIts characteristic equation is \\(r^2-r-1=0\\). Writing\n\\(\\phi=(1+\\sqrt5)/2\\) and \\(\\psi=(1-\\sqrt5)/2\\), the initial conditions yield\n\n\\[F_n=\\frac{\\phi^n-\\psi^n}{\\sqrt5}.\\]\n\nAlthough this formula contains irrational quantities, it gives integer values at nonnegative integer indices because it satisfies the defining recurrence and initial conditions. (math.libretexts.org)"
    },
    {
      "heading": "Generating functions",
      "text": "An ordinary generating function packages a sequence into a power series:\n\n\\[A(x)=\\sum_{n=0}^{\\infty}a_nx^n.\\]\n\nMultiplying a recurrence by \\(x^n\\) and summing over its valid indices converts shifts in the sequence into algebraic operations on \\(A(x)\\). Initial terms must be accounted for separately. The series can be treated formally, so these manipulations need not depend on analytic convergence. (math.libretexts.org)\n\nFor the Fibonacci sequence, the recurrence gives\n\n\\[A(x)-xA(x)-x^2A(x)=x,\\]\n\nand hence\n\n\\[A(x)=\\frac{x}{1-x-x^2}.\\]\n\nFactoring the denominator and expanding the resulting fractions using geometric series recovers the explicit formula. More generally, generating functions translate a problem about indexed terms into one about algebraic expressions, after which coefficients are extracted to recover the sequence. (math.libretexts.org)"
    },
    {
      "heading": "Algorithm analysis",
      "text": "In computer science, recurrences often describe running time rather than individual numerical sequences. A divide-and-conquer algorithm that creates \\(a\\) subproblems of size approximately \\(n/b\\), with additional work \\(f(n)\\), commonly leads to\n\n\\[T(n)=aT(n/b)+f(n).\\]\n\nBase cases and integer rounding complete the specification. For merge sort, the usual recurrence is \\(T(n)=2T(n/2)+\\Theta(n)\\), giving \\(\\Theta(n\\log n)\\) running time. Binary search instead gives \\(T(n)=T(n/2)+\\Theta(1)\\), resulting in \\(\\Theta(\\log n)\\). (ocw.mit.edu)\n\nMethods include repeated expansion, guessing a bound and proving it by induction, and summing work over a recursion tree. The master theorem handles many recurrences of the displayed divide-and-conquer form by comparing \\(f(n)\\) with \\(n^{\\log_b a}\\). Its cases have specific growth and regularity conditions; it is not a universal method for arbitrary recurrences. In algorithm analysis, such complexity bounds are often more useful than exact formulas, because they characterize growth while suppressing implementation-dependent constants. (live.ocw.mit.edu)"
    }
  ],
  "links": [
    "equation",
    "sequence",
    "recursion",
    "algorithm",
    "mathematical-function",
    "integer",
    "closed-form-expression",
    "mathematical-induction",
    "linear-combination",
    "factorial",
    "characteristic-polynomial",
    "system-of-linear-equations",
    "complex-number",
    "fibonacci-sequence",
    "generating-function",
    "power-series",
    "geometric-series",
    "computer-science",
    "time-complexity",
    "divide-and-conquer",
    "merge-sort",
    "binary-search",
    "master-theorem",
    "computational-complexity"
  ],
  "sources": [
    {
      "title": "discrete.openmathbooks.org/dmoi3/sec_recurrence.html",
      "url": "https://discrete.openmathbooks.org/dmoi3/sec_recurrence.html"
    },
    {
      "title": "ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-spring-2015/mit6_04…",
      "url": "https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-spring-2015/mit6_042js15_textbook.pdf"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Applied_…",
      "url": "https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Applied_Discrete_Structures_%28Doerr_and_Levasseur%29/08%253A_Recursion_and_Recurrence_Relations/8.03%253A_Recurrence_Relations"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Combinat…",
      "url": "https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Combinatorics_and_Graph_Theory_%28Guichard%29/03%3A_Generating_Functions/3.05%3A_Recurrence_Relations"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Applied_…",
      "url": "https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Applied_Discrete_Structures_%28Doerr_and_Levasseur%29/08%3A_Recursion_and_Recurrence_Relations/8.05%3A_Generating_Functions"
    },
    {
      "title": "ocw.mit.edu/courses/6-1200j-mathematics-for-computer-science-spring-2024/mit6_1…",
      "url": "https://ocw.mit.edu/courses/6-1200j-mathematics-for-computer-science-spring-2024/mit6_1200j_s24_lec07.pdf"
    },
    {
      "title": "live.ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/1869dbf64…",
      "url": "https://live.ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/1869dbf640ded6b31f1bd369d2001ef5_MIT6_006S20_r03.pdf"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}