ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Discrete Structures
    GE-167
    Progress0 / 67 topics
    Topics
    1. Mathematical Reasoning: Propositional and Predicate Logic2. Propositional Logic: Logical Operators3. Translations Between Symbolic Expressions and Formal English Expression4. Logical Equivalences5. Predicate Logic: Quantifiers6. Nested Quantification7. Equivalences in Predicate Logic8. Translations Between Symbolic Forms and Formal English9. Rules of Inference: Proof Methods and Strategies10. Direct Proof11. Proof by Contraposition12. Proof by Induction13. Proof by Implication14. Existence Proof15. Uniqueness Proofs16. Trivial Proofs17. Vacuous Proofs18. Sets: Notations and Set Operations19. Venn Diagrams20. Countable and Uncountable Sets21. Relations: Equivalence Relations and Partitions22. Partial Orderings23. Recurrence Relations24. Functions: Injective, Surjective, Bijective25. Special Types of Functions26. Function Composition27. Inverse Functions28. Recursive Functions29. Compositions30. Number Theory: Sequences and Series31. Counting: Inclusion and Exclusion Principle32. Pigeonhole Principle33. Permutations and Combinations34. Integers and Divisibility: Division Theorem35. Modular Arithmetic36. LCM and GCD37. Euclidean and Extended Euclidean Method38. Finding Solutions to Congruence39. Primes: Fundamental Theorem of Arithmetic40. Characterizations of Primes41. Mersenne Primes42. Induction: Weak Induction43. Strong Induction44. Recursion and Recurrences: Formulation of Recurrences45. Closed Formulas46. Counting: Product Rule and Sum Rule47. Principle of Inclusion-Exclusion48. Binomial Coefficients49. Pascal's Identity and Pascal’s Triangle50. Binomial Theorem51. Relations: Reflexive, Symmetric, Transitive, and Antisymmetric52. Equivalence Relations and Equivalence Classes53. Partial Orders54. Graph Theory: Terminologies55. Elements of Graph Theory56. Planar Graphs57. Graph Coloring58. Euler Graph59. Hamiltonian Path60. Rooted Trees61. Graph Traversals62. Handshaking Lemma and Corollary63. Special Families of Graphs64. Graph Isomorphism65. Planarity in Graphs66. Eulerian and Hamiltonian Graphs67. Trees in Graph Theory
    GE-167›Recurrence Relations
    Discrete StructuresTopic 23 of 67

    Recurrence Relations

    14 minread
    2,373words
    Intermediatelevel

    Recurrence Relations

    A recurrence relation is an equation or inequality that describes a function in terms of its values at smaller inputs. Recurrence relations are commonly used in the fields of mathematics and computer science to define sequences and solve problems in areas like algorithm analysis, dynamic programming, and discrete mathematics.

    Basic Concept

    A recurrence relation defines the value of a function f(n)f(n)f(n) in terms of its previous values, typically in the form:

    f(n)=expression involving f(n−1),f(n−2),…f(n) = \text{expression involving } f(n-1), f(n-2), \dotsf(n)=expression involving f(n−1),f(n−2),…

    The function’s initial conditions are usually given for some starting values, typically f(0)f(0)f(0), f(1)f(1)f(1), etc., and then the recurrence relation allows us to compute all subsequent values.

    For example, a simple recurrence relation is:

    f(n)=f(n−1)+1with the initial conditionf(0)=0f(n) = f(n-1) + 1 \quad \text{with the initial condition} \quad f(0) = 0f(n)=f(n−1)+1with the initial conditionf(0)=0

    This recurrence defines the sequence f(0),f(1),f(2),…f(0), f(1), f(2), \dotsf(0),f(1),f(2),…, and by using the recurrence, we can generate the values:

    f(0)=0,f(1)=f(0)+1=1,f(2)=f(1)+1=2,…f(0) = 0, \quad f(1) = f(0) + 1 = 1, \quad f(2) = f(1) + 1 = 2, \quad \dotsf(0)=0,f(1)=f(0)+1=1,f(2)=f(1)+1=2,…

    Thus, f(n)=nf(n) = nf(n)=n for all n≥0n \geq 0n≥0.


    Types of Recurrence Relations

    1. Linear Recurrence Relations:

      • A recurrence relation is called linear if the function f(n)f(n)f(n) can be expressed as a linear combination of its previous terms.

      • For example, a linear recurrence relation is:

        f(n)=a1f(n−1)+a2f(n−2)+⋯+akf(n−k)f(n) = a_1 f(n-1) + a_2 f(n-2) + \dots + a_k f(n-k)f(n)=a1​f(n−1)+a2​f(n−2)+⋯+ak​f(n−k)

        where a1,a2,…,aka_1, a_2, \dots, a_ka1​,a2​,…,ak​ are constants.

      • Example:

        The Fibonacci sequence is a well-known example of a linear recurrence relation:

        f(n)=f(n−1)+f(n−2)with initial conditionsf(0)=0,f(1)=1f(n) = f(n-1) + f(n-2) \quad \text{with initial conditions} \quad f(0) = 0, f(1) = 1f(n)=f(n−1)+f(n−2)with initial conditionsf(0)=0,f(1)=1

        This gives the sequence 0,1,1,2,3,5,8,…0, 1, 1, 2, 3, 5, 8, \dots0,1,1,2,3,5,8,….

    2. Nonlinear Recurrence Relations:

      • A nonlinear recurrence relation involves terms that are not just linear combinations of previous terms.

      • Example:

        f(n)=f(n−1)2+f(n−2)f(n) = f(n-1)^2 + f(n-2)f(n)=f(n−1)2+f(n−2)
    3. Homogeneous and Non-homogeneous Recurrence Relations:

      • A homogeneous recurrence relation is one where the recurrence is equal to zero when all terms are replaced by zero. It has the form:

        f(n)=a1f(n−1)+a2f(n−2)+⋯+akf(n−k)f(n) = a_1 f(n-1) + a_2 f(n-2) + \dots + a_k f(n-k)f(n)=a1​f(n−1)+a2​f(n−2)+⋯+ak​f(n−k)
      • A non-homogeneous recurrence relation has an additional term that is not dependent on previous terms:

        f(n)=a1f(n−1)+a2f(n−2)+⋯+akf(n−k)+g(n)f(n) = a_1 f(n-1) + a_2 f(n-2) + \dots + a_k f(n-k) + g(n)f(n)=a1​f(n−1)+a2​f(n−2)+⋯+ak​f(n−k)+g(n)

        where g(n)g(n)g(n) is some non-homogeneous function.


    Solving Recurrence Relations

    There are several methods for solving recurrence relations, depending on their form. Here are some common techniques:

    1. Iteration Method (Unfolding Method)

    The iteration method involves expanding the recurrence to express f(n)f(n)f(n) in terms of earlier terms until a pattern emerges. This is often useful for simple recurrences.

    • Example: Consider the recurrence:

      f(n)=f(n−1)+1withf(0)=0f(n) = f(n-1) + 1 \quad \text{with} \quad f(0) = 0f(n)=f(n−1)+1withf(0)=0

      Let's expand this recurrence:

      f(n)=f(n−1)+1f(n) = f(n-1) + 1f(n)=f(n−1)+1 f(n−1)=f(n−2)+1f(n-1) = f(n-2) + 1f(n−1)=f(n−2)+1 f(n−2)=f(n−3)+1f(n-2) = f(n-3) + 1f(n−2)=f(n−3)+1 …\dots… f(1)=f(0)+1=0+1=1f(1) = f(0) + 1 = 0 + 1 = 1f(1)=f(0)+1=0+1=1

      By repeating the steps, we can see that:

      f(n)=f(0)+n=0+n=nf(n) = f(0) + n = 0 + n = nf(n)=f(0)+n=0+n=n

      So the solution is f(n)=nf(n) = nf(n)=n.

    2. Substitution Method

    The substitution method involves guessing the form of the solution and then proving it by induction.

    • Example: Solve the recurrence:

      f(n)=2f(n−1)+1withf(0)=1f(n) = 2f(n-1) + 1 \quad \text{with} \quad f(0) = 1f(n)=2f(n−1)+1withf(0)=1

      Let's guess that f(n)=2n+1f(n) = 2^n + 1f(n)=2n+1 is the solution.

      • Base case: For n=0n = 0n=0:

        f(0)=20+1=1f(0) = 2^0 + 1 = 1f(0)=20+1=1

        which matches the initial condition.

      • Inductive step: Assume f(k)=2k+1f(k) = 2^k + 1f(k)=2k+1 holds for some k≥0k \geq 0k≥0. Now prove for k+1k+1k+1:

        f(k+1)=2f(k)+1=2(2k+1)+1=2k+1+2+1=2k+1+1f(k+1) = 2f(k) + 1 = 2(2^k + 1) + 1 = 2^{k+1} + 2 + 1 = 2^{k+1} + 1f(k+1)=2f(k)+1=2(2k+1)+1=2k+1+2+1=2k+1+1

        This matches our guess, so by induction, f(n)=2n+1f(n) = 2^n + 1f(n)=2n+1 is the solution.

    3. Characteristic Equation (For Linear Recurrences)

    For linear recurrence relations with constant coefficients, the characteristic equation can often be used to find the solution.

    • Example: Solve the recurrence:

      f(n)=3f(n−1)−2f(n−2)with initial conditionsf(0)=2,f(1)=5f(n) = 3f(n-1) - 2f(n-2) \quad \text{with initial conditions} \quad f(0) = 2, f(1) = 5f(n)=3f(n−1)−2f(n−2)with initial conditionsf(0)=2,f(1)=5

      The characteristic equation for this recurrence is:

      r2−3r+2=0r^2 - 3r + 2 = 0r2−3r+2=0

      Factoring the equation:

      (r−1)(r−2)=0(r - 1)(r - 2) = 0(r−1)(r−2)=0

      So the roots are r=1r = 1r=1 and r=2r = 2r=2. Thus, the general solution is:

      f(n)=A⋅1n+B⋅2nf(n) = A \cdot 1^n + B \cdot 2^nf(n)=A⋅1n+B⋅2n f(n)=A+B⋅2nf(n) = A + B \cdot 2^nf(n)=A+B⋅2n

      Using the initial conditions to find AAA and BBB:

      f(0)=A+B=2f(0) = A + B = 2f(0)=A+B=2 f(1)=A+2B=5f(1) = A + 2B = 5f(1)=A+2B=5

      Solving this system of equations:

      A+B=2A + B = 2A+B=2 A+2B=5A + 2B = 5A+2B=5

      Subtract the first equation from the second:

      B=3B = 3B=3

      Substituting B=3B = 3B=3 into A+B=2A + B = 2A+B=2:

      A+3=2⇒A=−1A + 3 = 2 \quad \Rightarrow \quad A = -1A+3=2⇒A=−1

      Therefore, the solution is:

      f(n)=−1+3⋅2nf(n) = -1 + 3 \cdot 2^nf(n)=−1+3⋅2n

    Applications of Recurrence Relations

    1. Algorithm Analysis: Recurrences are used to describe the running time of recursive algorithms (e.g., the merge sort recurrence T(n)=2T(n/2)+O(n)T(n) = 2T(n/2) + O(n)T(n)=2T(n/2)+O(n)).

    2. Counting Problems: Recurrence relations are frequently used in combinatorics and discrete mathematics to count the number of objects satisfying certain conditions.

    3. Dynamic Programming: In dynamic programming, recurrence relations help solve problems by breaking them down into subproblems and reusing previously computed solutions.

    4. Biological and Physical Models: Recurrence relations are used in biology (e.g., population models) and physics (e.g., particle movement in systems with discrete time steps).


    Conclusion

    Recurrence relations are essential tools for modeling a wide variety of problems, especially those involving sequences or recursive structures. The methods for solving recurrence relations, such as iteration, substitution, and characteristic equations, provide powerful techniques for analyzing and solving these problems efficiently. Understanding recurrence relations is crucial in fields such as computer science, algorithm design, and combinatorics.

    Previous topic 22
    Partial Orderings
    Next topic 24
    Functions: Injective, Surjective, Bijective

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time14 min
      Word count2,373
      Code examples0
      DifficultyIntermediate