7. Applied and Discrete Math

Recurrence

Analyze recursive definitions, solve linear recurrence relations, and apply to counting and algorithmic contexts.

Recurrence Relations

Hey students! šŸ‘‹ Welcome to one of the most fascinating topics in mathematics - recurrence relations! In this lesson, you'll discover how mathematicians describe patterns in sequences where each term depends on the ones that came before it. By the end of this lesson, you'll be able to identify recursive patterns, solve linear recurrence relations, and see how they apply to everything from population growth to computer algorithms. Get ready to unlock the secrets of mathematical sequences! šŸ”

What Are Recurrence Relations?

Imagine you're tracking the population of rabbits in a field 🐰. If you know that each month, the rabbit population doubles from the previous month, you can write this pattern as a mathematical relationship. This is exactly what a recurrence relation does - it's an equation that expresses any term in a sequence as a function of one or more previous terms.

A recurrence relation has two essential components: the recursive formula (which shows how terms relate to previous ones) and the initial conditions (which give us starting values). For example, if we say $a_n = 2a_{n-1}$ with $a_1 = 5$, we're describing a sequence where each term is twice the previous term, starting with 5.

Let's look at a real-world example: the famous Fibonacci sequence, which appears in nature from flower petals to spiral shells 🌻. The Fibonacci sequence follows the recurrence relation $F_n = F_{n-1} + F_{n-2}$ with initial conditions $F_1 = 1$ and $F_2 = 1$. This means each term is the sum of the two preceding terms: 1, 1, 2, 3, 5, 8, 13, 21, 34...

Recurrence relations are incredibly powerful because they allow us to describe complex patterns with simple rules. Instead of trying to find a direct formula for the nth term (which can be very difficult), we can work with the relationship between consecutive terms.

Types of Recurrence Relations

Not all recurrence relations are created equal! students, let's explore the main types you'll encounter, starting with the most manageable ones.

Linear Recurrence Relations are the most common type you'll work with in high school. These have the form $a_n = c_1a_{n-1} + c_2a_{n-2} + ... + c_ka_{n-k}$ where the coefficients $c_1, c_2, ..., c_k$ are constants. The "order" of the recurrence is determined by how many previous terms we need - so $a_n = 3a_{n-1} + 2a_{n-2}$ is a second-order linear recurrence relation.

Homogeneous vs. Non-homogeneous recurrences differ in whether they have an extra term that doesn't depend on previous sequence values. A homogeneous recurrence like $a_n = 5a_{n-1} - 6a_{n-2}$ only involves previous terms of the sequence. A non-homogeneous recurrence like $a_n = 5a_{n-1} - 6a_{n-2} + 3^n$ has an additional function (in this case, $3^n$) that doesn't depend on the sequence itself.

Consider this practical example: if you deposit $100 into a savings account each month, and the account earns 1% interest monthly, your balance follows the recurrence $B_n = 1.01 \cdot B_{n-1} + 100$ with $B_0 = 0$. This is a first-order linear non-homogeneous recurrence relation! šŸ’°

Solving Linear Recurrence Relations

Now comes the exciting part, students - actually solving these relations! The method depends on the type of recurrence we're dealing with.

For first-order linear homogeneous recurrences of the form $a_n = ca_{n-1}$, the solution is straightforward: $a_n = c^n \cdot a_0$. If you start with $a_0 = 2$ and have $a_n = 3a_{n-1}$, then $a_n = 2 \cdot 3^n$.

For second-order linear homogeneous recurrences like $a_n = c_1a_{n-1} + c_2a_{n-2}$, we use the characteristic equation method. We assume a solution of the form $a_n = r^n$ and substitute into our recurrence relation. This gives us the characteristic equation $r^2 = c_1r + c_2$, or $r^2 - c_1r - c_2 = 0$.

Let's solve $a_n = 5a_{n-1} - 6a_{n-2}$ with $a_0 = 1$ and $a_1 = 2$. Our characteristic equation becomes $r^2 - 5r + 6 = 0$, which factors as $(r-2)(r-3) = 0$. So our roots are $r_1 = 2$ and $r_2 = 3$.

When we have two distinct roots, the general solution is $a_n = A \cdot 2^n + B \cdot 3^n$. Using our initial conditions: $a_0 = A + B = 1$ and $a_1 = 2A + 3B = 2$. Solving this system gives us $A = 1$ and $B = 0$, so $a_n = 2^n$.

What happens when the characteristic equation has repeated roots? If $r^2 - c_1r - c_2 = 0$ has a double root $r$, then the general solution becomes $a_n = (A + Bn) \cdot r^n$. This accounts for the fact that we need two linearly independent solutions.

Applications in Counting and Algorithms

Recurrence relations aren't just abstract mathematical concepts - they're incredibly useful tools for solving real problems! Let's explore some fascinating applications that show up everywhere from computer science to biology.

Counting Problems often lead naturally to recurrence relations. Consider the classic "tiling problem": in how many ways can you tile a $2 \times n$ rectangle using $1 \times 2$ dominoes? 🧩 Let $T_n$ represent the number of ways to tile a $2 \times n$ rectangle. You can either place a vertical domino (leaving a $2 \times (n-1)$ rectangle) or place two horizontal dominoes (leaving a $2 \times (n-2)$ rectangle). This gives us $T_n = T_{n-1} + T_{n-2}$ with $T_1 = 1$ and $T_2 = 2$ - it's the Fibonacci sequence shifted by one position!

Tower of Hanoi is another classic example that demonstrates the power of recurrence relations in algorithm analysis. With $n$ disks, if $H_n$ represents the minimum number of moves needed, then $H_n = 2H_{n-1} + 1$ with $H_1 = 1$. This is because to move $n$ disks, you must first move the top $n-1$ disks to an auxiliary peg ($H_{n-1}$ moves), then move the largest disk (1 move), then move the $n-1$ disks from the auxiliary peg to the destination ($H_{n-1}$ moves again).

Population Dynamics in biology frequently use recurrence relations. The logistic growth model, used to describe population growth with limited resources, can be expressed as $P_{n+1} = rP_n(1 - P_n/K)$, where $r$ is the growth rate and $K$ is the carrying capacity of the environment. This model explains why populations don't grow exponentially forever - they level off as resources become scarce.

In computer science, recurrence relations help analyze algorithm efficiency. The famous merge sort algorithm has a time complexity described by $T(n) = 2T(n/2) + n$ with $T(1) = 1$. This tells us that to sort $n$ elements, we recursively sort two halves (each taking $T(n/2)$ time) and then merge them (taking $n$ time). The solution to this recurrence is $T(n) = n \log n$, explaining why merge sort is so efficient! šŸ’»

Conclusion

Recurrence relations are powerful mathematical tools that help us understand patterns in sequences by expressing each term in relation to previous ones. We've explored linear recurrence relations, learned how to solve them using characteristic equations, and seen their applications in counting problems, algorithm analysis, and population modeling. These concepts form a bridge between algebra and more advanced topics in mathematics and computer science, showing how simple recursive rules can describe complex phenomena in the real world.

Study Notes

• Recurrence Relation: An equation expressing any term as a function of previous terms, requires initial conditions

• Linear Recurrence: Form $a_n = c_1a_{n-1} + c_2a_{n-2} + ... + c_ka_{n-k}$ where coefficients are constants

• Order: Number of previous terms needed (e.g., $a_n = 3a_{n-1} + 2a_{n-2}$ is second-order)

• Homogeneous: Only involves previous sequence terms (no additional functions)

• Non-homogeneous: Includes additional function not depending on sequence terms

• First-order solution: $a_n = ca_{n-1}$ has solution $a_n = c^n \cdot a_0$

• Characteristic equation: For $a_n = c_1a_{n-1} + c_2a_{n-2}$, solve $r^2 - c_1r - c_2 = 0$

• Distinct roots: General solution is $a_n = Ar_1^n + Br_2^n$

• Repeated root: General solution is $a_n = (A + Bn)r^n$

• Fibonacci sequence: $F_n = F_{n-1} + F_{n-2}$ with $F_1 = F_2 = 1$

• Tower of Hanoi: $H_n = 2H_{n-1} + 1$ with $H_1 = 1$, solution is $H_n = 2^n - 1$

Practice Quiz

5 questions to test your understanding

Recurrence — High School Integrated Math | A-Warded