Skip to main content

8.2 Linear Recurrence Relations: Characteristic Roots & Particular Solutions

πŸ“šModule 08: Combinatorics & Recurrence RelationsTopic 8.2: Linear Recurrence Relations & Characteristic Roots⏱️5 min read
🎯High-Yield For:Semester Exams β€’ GATE CSE β€’ Technical Interviews

πŸ’‘ Core Intuition: The 3-Second Mental Model​

🍳 The Everyday Analogy: Compounding Bank Interest & The Fibonacci Rabbit Pair​

Think of recurrence relations as dynamic feedback loops over discrete time steps:

  1. The Recursive Definition: You deposit $1,000 in a bank account that pays 5% annual compound interest. Your balance at year nn depends on your balance at year nβˆ’1n - 1: an=1.05β‹…anβˆ’1a_n = 1.05 \cdot a_{n-1} To find your balance at year 50 without calculating all 50 intermediate years step-by-step, you need a closed-form formula: an=1000β‹…(1.05)na_n = 1000 \cdot (1.05)^n.
  2. The Characteristic Root Magic: For linear homogeneous equations like an=5anβˆ’1βˆ’6anβˆ’2a_n = 5a_{n-1} - 6a_{n-2}, we hypothesize that the solution grows exponentially like an interest rate (an=rna_n = r^n). Substituting rnr^n collapses the recurrence into a simple algebraic polynomial (r2βˆ’5r+6=0r^2 - 5r + 6 = 0). Factoring this polynomial unlocks the exact growth trajectory of the discrete system!
  3. Homogeneous vs Non-Homogeneous:
    • Homogeneous (F(n)=0F(n) = 0): The system runs purely on internal momentum (an=c1anβˆ’1+c2anβˆ’2a_n = c_1 a_{n-1} + c_2 a_{n-2}).
    • Non-Homogeneous (F(n)β‰ 0F(n) \neq 0): External energy or inputs are applied at every step (+F(n)+ F(n), such as depositing an extra $100 every year). The total solution is the sum of internal momentum (an(h)a_n^{(h)}) plus the steady-state response to the external drive (an(p)a_n^{(p)}).

πŸ’» Bridging to Computer Science: Dynamic Programming, Divide-and-Conquer & State Invariants​

In computer science:

  • Algorithm Complexity Analysis: Analyzing recursive algorithms (Merge Sort, Binary Search, Tower of Hanoi) produces recurrences solved via characteristic roots, iteration trees, or the Master Theorem.
  • Dynamic Programming (DP): Finding the nn-th Fibonacci number in O(log⁑n)O(\log n) time using fast matrix exponentiation: (Fn+1FnFnFnβˆ’1)=(1110)n\begin{pmatrix} F_{n+1} & F_n \\ F_n & F_{n-1} \end{pmatrix} = \begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}^n
  • Combinatorial Bit-String Constraints: Counting valid binary strings with no consecutive 1s or strings avoiding forbidden sub-patterns naturally models as a 2nd-order linear recurrence.
  • Queueing Theory & Markov Chains: Steady-state probability distributions across server request queues satisfy linear recurrence systems.

πŸ“ Linear Homogeneous Recurrence Relations (LHRR-CC)​

πŸ“–Definition 8.1: Linear Homogeneous Recurrence Relationdefinition

A Linear Homogeneous Recurrence Relation of Degree kk with Constant Coefficients (LHRR-CC) has the standard form:

an=c1anβˆ’1+c2anβˆ’2+c3anβˆ’3+β‹―+ckanβˆ’ka_n = c_1 a_{n-1} + c_2 a_{n-2} + c_3 a_{n-3} + \dots + c_k a_{n-k}

where:

  1. c1,c2,…,ckc_1, c_2, \dots, c_k are real numbers with ckβ‰ 0c_k \neq 0.
  2. The relation is linear because each term anβˆ’ia_{n-i} appears strictly to the first power (no non-linear terms like anβˆ’12a_{n-1}^2 or anβˆ’1anβˆ’2a_{n-1} a_{n-2}).
  3. The relation is homogeneous because there is no isolated function of nn (no independent +F(n)+ F(n) term).
  4. The degree (or order) is kk (the difference between the highest index nn and the lowest index nβˆ’kn - k).

Initial Conditions: A recurrence of degree kk strictly requires kk initial values (a0,a1,…,akβˆ’1a_0, a_1, \dots, a_{k-1}) to uniquely determine the sequence.


⚑ The Characteristic Equation & Root Multiplicity Cases​

To solve an=c1anβˆ’1+c2anβˆ’2+β‹―+ckanβˆ’ka_n = c_1 a_{n-1} + c_2 a_{n-2} + \dots + c_k a_{n-k}, we test the exponential ansatz:

an=rn(r≠0)a_n = r^n \quad (r \neq 0)

Substituting anβˆ’i=rnβˆ’ia_{n-i} = r^{n-i} yields:

rn=c1rnβˆ’1+c2rnβˆ’2+β‹―+ckrnβˆ’kr^n = c_1 r^{n-1} + c_2 r^{n-2} + \dots + c_k r^{n-k}

Dividing across by rnβˆ’kr^{n-k} produces the Characteristic Equation:

rkβˆ’c1rkβˆ’1βˆ’c2rkβˆ’2βˆ’β‹―βˆ’ck=0r^k - c_1 r^{k-1} - c_2 r^{k-2} - \dots - c_k = 0
βœ“ Analytical Solution WorkflowAnsatz aβ‚™ = rⁿFactor RootsInspect F(n)Fit c₁, cβ‚‚Recurrence Eqaβ‚™ = βˆ‘ cα΅’aβ‚™β‚‹α΅’ + F(n)Char Equationrᡏ - βˆ‘ cα΅’rᡏ⁻ⁱ = 0Homogeneous aₙ⁽ʰ⁾Root MultiplicitiesParticular aₙ⁽ᡖ⁾Undetermined CoeffsTotal aβ‚™ = aₙ⁽ʰ⁾ + aₙ⁽ᡖ⁾Linear SuperpositionUnique Closed FormFit Initial Conditions
Mechanical flow: Factor characteristic polynomial for aₙ⁽ʰ⁾, determine trial particular solution aₙ⁽ᡖ⁾, and apply initial values.
Architecture Flow

The 3 Characteristic Root Solution Regimes

Formulating the general homogeneous solution based on the algebraic roots of the characteristic polynomial

🌱Case 1

Distinct Real Roots

k distinct real roots r₁, rβ‚‚, ..., rβ‚–. General solution: aβ‚™ = α₁ r₁ⁿ + Ξ±β‚‚ r₂ⁿ + ... + Ξ±β‚– rₖⁿ.

β†’
If Roots Repeat
πŸ”„Case 2

Repeated Real Roots

Root r has multiplicity m. General solution introduces polynomial factors: (Ξ±β‚€ + α₁ n + ... + Ξ±β‚˜β‚‹β‚ nᡐ⁻¹) rⁿ.

β†’
If Roots are Complex
πŸŒ€Case 3

Complex Conjugate Roots

Roots r = ρ e^(Β±iΞΈ). Express via Euler's identity: ρⁿ (α₁ cos(nΞΈ) + Ξ±β‚‚ sin(nΞΈ)).

πŸ“Theorem 8.4: Master Solution for Repeated Characteristic Rootstheorem

Let the characteristic equation have tt distinct roots r1,r2,…,rtr_1, r_2, \dots, r_t with multiplicities m1,m2,…,mtm_1, m_2, \dots, m_t respectively (such that βˆ‘i=1tmi=k\sum_{i=1}^t m_i = k). The general solution to the homogeneous recurrence relation is:

an=βˆ‘i=1t(Ξ±i,0+Ξ±i,1n+Ξ±i,2n2+β‹―+Ξ±i,miβˆ’1nmiβˆ’1)rina_n = \sum_{i=1}^{t} \left( \alpha_{i, 0} + \alpha_{i, 1} n + \alpha_{i, 2} n^2 + \dots + \alpha_{i, m_i - 1} n^{m_i - 1} \right) r_i^n

where the kk unknown constants Ξ±i,j\alpha_{i, j} are uniquely solved by substituting the kk initial boundary conditions.


πŸš€ Linear Non-Homogeneous Recurrence Relations​

When an external driving term F(n)F(n) is present:

an=c1anβˆ’1+c2anβˆ’2+β‹―+ckanβˆ’k+F(n)a_n = c_1 a_{n-1} + c_2 a_{n-2} + \dots + c_k a_{n-k} + F(n)
πŸ“Theorem 8.5: Decomposition of Non-Homogeneous Solutiontheorem

The total general solution ana_n is the linear superposition of two independent components:

an=an(h)+an(p)a_n = a_n^{(h)} + a_n^{(p)}
  1. an(h)a_n^{(h)} (Homogeneous Solution): The general solution to the associated homogeneous recurrence (F(n)=0F(n) = 0). Contains kk arbitrary constants Ξ±i\alpha_i.
  2. an(p)a_n^{(p)} (Particular Solution): A specific sequence satisfying the non-homogeneous equation with no arbitrary constants.

The Method of Undetermined Coefficients

Standard trial templates for the particular solution aₙ⁽ᡖ⁾

πŸ“ˆ

Exponential: F(n) = c · sⁿ

Geometric Drive
  • If s is NOT a characteristic root: Trial aₙ⁽ᡖ⁾ = A Β· sⁿ.
  • If s IS a root with multiplicity m: Trial aₙ⁽ᡖ⁾ = A Β· nᡐ Β· sⁿ.
  • Crucial: The factor nᡐ breaks linear dependence (resonance).
πŸ”’

Polynomial: F(n) = Pβ‚œ(n)

Degree t Drive
  • If 1 is NOT a characteristic root: Trial aₙ⁽ᡖ⁾ = Aβ‚œ nα΅— + ... + A₁ n + Aβ‚€.
  • If 1 IS a root with multiplicity m: Trial aₙ⁽ᡖ⁾ = nᡐ (Aβ‚œ nα΅— + ... + Aβ‚€).
  • Example: For F(n) = n, trial is A₁n + Aβ‚€ (or n(A₁n + Aβ‚€) if r=1 is root).
βš™οΈ

Compound: F(n) = Pβ‚œ(n) Β· sⁿ

General Form
  • Combines both polynomial and geometric driving terms.
  • Trial form: aₙ⁽ᡖ⁾ = nᡐ (Aβ‚œ nα΅— + ... + A₁ n + Aβ‚€) Β· sⁿ.
  • Substitute into full recurrence and equate coefficients.
πŸ”’

Crucial Rule of Initial Conditions

Order of Operations
  • NEVER evaluate constants Ξ±α΅’ on aₙ⁽ʰ⁾ alone!
  • Always combine aβ‚™ = aₙ⁽ʰ⁾ + aₙ⁽ᡖ⁾ FIRST.
  • Fit initial conditions (aβ‚€, a₁, ...) exclusively to the full sum.

πŸ“ Step-by-Step Worked Examples​

Example 1: Solving the Classic Fibonacci Recurrence (Binet's Formula)​

Problem Statement: Solve the Fibonacci recurrence relation:

Fn=Fnβˆ’1+Fnβˆ’2forΒ nβ‰₯2F_n = F_{n-1} + F_{n-2} \quad \text{for } n \ge 2

with initial conditions F0=0F_0 = 0 and F1=1F_1 = 1.

Step-by-Step Solution:

  1. Step 1: Form the Characteristic Equation

    • The recurrence is Fnβˆ’Fnβˆ’1βˆ’Fnβˆ’2=0F_n - F_{n-1} - F_{n-2} = 0.
    • Substitute Fn=rnF_n = r^n: r2βˆ’rβˆ’1=0r^2 - r - 1 = 0
  2. Step 2: Solve for Characteristic Roots

    • Applying the quadratic formula: r=βˆ’(βˆ’1)Β±(βˆ’1)2βˆ’4(1)(βˆ’1)2(1)=1Β±52r = \frac{-(-1) \pm \sqrt{(-1)^2 - 4(1)(-1)}}{2(1)} = \frac{1 \pm \sqrt{5}}{2}
    • The two distinct roots are: r1=1+52(TheΒ GoldenΒ RatioΒ Ο•),r2=1βˆ’52(Ο•^)r_1 = \frac{1 + \sqrt{5}}{2} \quad (\text{The Golden Ratio } \phi), \qquad r_2 = \frac{1 - \sqrt{5}}{2} \quad (\hat{\phi})
  3. Step 3: Write the General Solution

    • By Case 1 (distinct real roots): Fn=Ξ±1(1+52)n+Ξ±2(1βˆ’52)nF_n = \alpha_1 \left(\frac{1 + \sqrt{5}}{2}\right)^n + \alpha_2 \left(\frac{1 - \sqrt{5}}{2}\right)^n
  4. Step 4: Solve for Constants using Initial Conditions

    • For n=0n = 0: F0=Ξ±1+Ξ±2=0β€…β€ŠβŸΉβ€…β€ŠΞ±2=βˆ’Ξ±1F_0 = \alpha_1 + \alpha_2 = 0 \implies \alpha_2 = -\alpha_1
    • For n=1n = 1: F1=Ξ±1(1+52)βˆ’Ξ±1(1βˆ’52)=1F_1 = \alpha_1 \left(\frac{1 + \sqrt{5}}{2}\right) - \alpha_1 \left(\frac{1 - \sqrt{5}}{2}\right) = 1 Ξ±1(1+5βˆ’1+52)=Ξ±15=1β€…β€ŠβŸΉβ€…β€ŠΞ±1=15\alpha_1 \left( \frac{1 + \sqrt{5} - 1 + \sqrt{5}}{2} \right) = \alpha_1 \sqrt{5} = 1 \implies \alpha_1 = \frac{1}{\sqrt{5}} Ξ±2=βˆ’15\alpha_2 = -\frac{1}{\sqrt{5}}
  5. Step 5: Final Closed-Form (Binet's Formula)

    Fn=15[(1+52)nβˆ’(1βˆ’52)n]F_n = \frac{1}{\sqrt{5}} \left[ \left(\frac{1 + \sqrt{5}}{2}\right)^n - \left(\frac{1 - \sqrt{5}}{2}\right)^n \right]

Key Takeaway: Even though the closed-form formula involves the irrational number 5\sqrt{5}, all square roots cancel out identically for every integer nβ‰₯0n \ge 0, always yielding an integer output!


Example 2: Solving a Non-Homogeneous Recurrence with Resonance​

Problem Statement: Solve the non-homogeneous recurrence relation:

anβˆ’4anβˆ’1+4anβˆ’2=2nforΒ nβ‰₯2a_n - 4a_{n-1} + 4a_{n-2} = 2^n \quad \text{for } n \ge 2

with initial conditions a0=1a_0 = 1 and a1=2a_1 = 2.

Step-by-Step Solution:

  1. Step 1: Solve the Associated Homogeneous Recurrence

    • Characteristic equation: r2βˆ’4r+4=0β€…β€ŠβŸΉβ€…β€Š(rβˆ’2)2=0r^2 - 4r + 4 = 0 \implies (r - 2)^2 = 0.
    • Root r=2r = 2 has multiplicity m=2m = 2.
    • Homogeneous solution: an(h)=(Ξ±0+Ξ±1n)β‹…2na_n^{(h)} = (\alpha_0 + \alpha_1 n) \cdot 2^n
  2. Step 2: Determine Particular Solution an(p)a_n^{(p)} (Resonance Detection)

    • External driving term is F(n)=2n=1β‹…2nF(n) = 2^n = 1 \cdot 2^n (base s=2s = 2).
    • Notice that s=2s = 2 is already a characteristic root with multiplicity m=2m = 2!
    • Therefore, multiplying by n2n^2: an(p)=Aβ‹…n2β‹…2na_n^{(p)} = A \cdot n^2 \cdot 2^n
    • Substitute an(p)a_n^{(p)} into the recurrence: An22nβˆ’4A(nβˆ’1)22nβˆ’1+4A(nβˆ’2)22nβˆ’2=2nA n^2 2^n - 4 A (n - 1)^2 2^{n-1} + 4 A (n - 2)^2 2^{n-2} = 2^n
    • Divide through by 2n2^n: An2βˆ’4A(nβˆ’1)2(12)+4A(nβˆ’2)2(14)=1A n^2 - 4 A (n - 1)^2 \left(\frac{1}{2}\right) + 4 A (n - 2)^2 \left(\frac{1}{4}\right) = 1 A[n2βˆ’2(n2βˆ’2n+1)+(n2βˆ’4n+4)]=1A [n^2 - 2(n^2 - 2n + 1) + (n^2 - 4n + 4)] = 1 A[n2βˆ’2n2+4nβˆ’2+n2βˆ’4n+4]=1A [n^2 - 2n^2 + 4n - 2 + n^2 - 4n + 4] = 1 A[2]=1β€…β€ŠβŸΉβ€…β€ŠA=12A [2] = 1 \implies A = \frac{1}{2}
    • Thus: an(p)=12n22n=n22nβˆ’1a_n^{(p)} = \frac{1}{2} n^2 2^n = n^2 2^{n-1}
  3. Step 3: Form Total General Solution

    an=an(h)+an(p)=(Ξ±0+Ξ±1n)2n+12n22na_n = a_n^{(h)} + a_n^{(p)} = (\alpha_0 + \alpha_1 n) 2^n + \frac{1}{2} n^2 2^n
  4. Step 4: Solve for Constants using Initial Conditions

    • For n=0n = 0: a0=Ξ±0β‹…20+0=1β€…β€ŠβŸΉβ€…β€ŠΞ±0=1a_0 = \alpha_0 \cdot 2^0 + 0 = 1 \implies \alpha_0 = 1
    • For n=1n = 1: a1=(1+Ξ±1)β‹…21+12(1)2β‹…21=2(1+Ξ±1)+1=2a_1 = (1 + \alpha_1) \cdot 2^1 + \frac{1}{2} (1)^2 \cdot 2^1 = 2 (1 + \alpha_1) + 1 = 2 2+2Ξ±1+1=2β€…β€ŠβŸΉβ€…β€Š2Ξ±1=βˆ’1β€…β€ŠβŸΉβ€…β€ŠΞ±1=βˆ’122 + 2\alpha_1 + 1 = 2 \implies 2\alpha_1 = -1 \implies \alpha_1 = -\frac{1}{2}
  5. Step 5: Final Unique Closed Form

    an=(1βˆ’12n)2n+12n22n=(1βˆ’n2+n22)2na_n = \left( 1 - \frac{1}{2} n \right) 2^n + \frac{1}{2} n^2 2^n = \left( 1 - \frac{n}{2} + \frac{n^2}{2} \right) 2^n

Example 3: Binary Strings with No Consecutive 1s​

Problem Statement: Find the number of binary strings of length nn that do not contain two consecutive 1s (11).

Step-by-Step Solution:

  1. Let ana_n denote the number of valid binary strings of length nn.
  2. Case Analysis on the Final Bit:
    • Case A (Ends in 0): The preceding nβˆ’1n - 1 bits can be any valid binary string without 11. There are anβˆ’1a_{n-1} such strings.
    • Case B (Ends in 1): To avoid 11, the (nβˆ’1)(n-1)-th bit MUST be 0. The preceding nβˆ’2n - 2 bits can be any valid string. There are anβˆ’2a_{n-2} such strings.
  3. By the Rule of Sum, we obtain the recurrence: an=anβˆ’1+anβˆ’2forΒ nβ‰₯3a_n = a_{n-1} + a_{n-2} \quad \text{for } n \ge 3
  4. Base Cases:
    • n=1n = 1: Valid strings are 0 and 1 β€…β€ŠβŸΉβ€…β€Ša1=2\implies a_1 = 2.
    • n=2n = 2: Valid strings are 00, 01, 10 (11 forbidden) β€…β€ŠβŸΉβ€…β€Ša2=3\implies a_2 = 3.
  5. Comparing to the standard Fibonacci sequence (F1=1,F2=1,F3=2,F4=3,F5=5,… )(F_1=1, F_2=1, F_3=2, F_4=3, F_5=5, \dots): an=Fn+2a_n = F_{n+2}

🎯 Exam & Interview Pitfall Check​

Recurrence FormGoverning Characteristic / Trial SolutionCommon Fatal Error
an=c1anβˆ’1+c2anβˆ’2a_n = c_1 a_{n-1} + c_2 a_{n-2}r2βˆ’c1rβˆ’c2=0r^2 - c_1 r - c_2 = 0Setting signs incorrectly: writing r2+c1r+c2=0r^2 + c_1 r + c_2 = 0
Root rr repeats with multiplicity mm(Ξ±0+Ξ±1n+β‹―+Ξ±mβˆ’1nmβˆ’1)rn(\alpha_0 + \alpha_1 n + \dots + \alpha_{m-1} n^{m-1}) r^nWriting Ξ±0rn+Ξ±1rn\alpha_0 r^n + \alpha_1 r^n (collapsing constants into one)
F(n)=cβ‹…snF(n) = c \cdot s^n where ss is root of mult. mman(p)=Aβ‹…nmβ‹…sna_n^{(p)} = A \cdot n^m \cdot s^nTrying Aβ‹…snA \cdot s^n (which evaluates to 0 on LHS due to resonance)
Applying Initial ConditionsApply exclusively to an=an(h)+an(p)a_n = a_n^{(h)} + a_n^{(p)}Solving Ξ±i\alpha_i using an(h)a_n^{(h)} alone before adding an(p)a_n^{(p)}
Degree of Recurrence kkRequires strictly kk initial conditionsAttempting to solve unique closed form with fewer than kk values
Core Conceptual Questions

Question 1: If the characteristic equation has roots r=3,3,3r = 3, 3, 3 (multiplicity 3), why must we multiply by ascending powers of nn? Key Focus Points: Because root 33 repeats three times, the functions 3n,n3n,n23n3^n, n 3^n, n^2 3^n form a linearly independent basis for the 3-dimensional solution space of the 3rd-order recurrence:

an=(Ξ±0+Ξ±1n+Ξ±2n2)β‹…3na_n = (\alpha_0 + \alpha_1 n + \alpha_2 n^2) \cdot 3^n

If you omit the nn and n2n^2 factors, the terms Ξ±03n+Ξ±13n+Ξ±23n=(Ξ±0+Ξ±1+Ξ±2)3n\alpha_0 3^n + \alpha_1 3^n + \alpha_2 3^n = (\alpha_0 + \alpha_1 + \alpha_2) 3^n collapse into a single term with only 1 degree of freedom, failing to satisfy 3 independent initial conditions!

Question 2: What trial particular solution should be used if F(n)=2nF(n) = 2^n and r=2r = 2 is already a simple root of the characteristic equation? Key Focus Points: Because 22 is already a root of the homogeneous equation with multiplicity m=1m = 1, the standard trial Aβ‹…2nA \cdot 2^n will produce 00 when plugged into the left-hand side (resonance!). You must multiply by n1n^1:

an(p)=Aβ‹…nβ‹…2na_n^{(p)} = A \cdot n \cdot 2^n

If 22 had multiplicity 2, you would try Aβ‹…n2β‹…2nA \cdot n^2 \cdot 2^n.

Common Interview Traps: Architectural Trade-Offs

Trap 1: Applying Initial Conditions to the Homogeneous Solution Alone Why it fails: In non-homogeneous recurrences an=an(h)+an(p)a_n = a_n^{(h)} + a_n^{(p)}, calculating Ξ±i\alpha_i using an(h)a_n^{(h)} alone is completely incorrect! The boundary values must balance the entire expression: a0=a0(h)(0)+a0(p)(0)a_0 = a_0^{(h)}(0) + a_0^{(p)}(0).

Trap 2: Forgetting the Degree Determines the Number of Initial Conditions Why it fails: A recurrence of degree kk strictly requires kk initial conditions. If fewer than kk conditions are given, the sequence is underdetermined and has infinitely many solutions.

πŸ’¬

Discussion & Doubts