Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
36 views2 pages

Recurrence Relation Examples

The document provides examples of solving various types of recurrence relations, including first-order linear homogeneous, linear non-homogeneous, second-order linear homogeneous, and the Fibonacci sequence. It also includes a solution using the Master Theorem for divide-and-conquer recurrences and an arithmetic type recurrence. Each example includes the recurrence relation, initial conditions, and the corresponding solution.

Uploaded by

Thep Williams
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

Recurrence Relation Examples

The document provides examples of solving various types of recurrence relations, including first-order linear homogeneous, linear non-homogeneous, second-order linear homogeneous, and the Fibonacci sequence. It also includes a solution using the Master Theorem for divide-and-conquer recurrences and an arithmetic type recurrence. Each example includes the recurrence relation, initial conditions, and the corresponding solution.

Uploaded by

Thep Williams
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Recurrence Relations - Example Questions

1. Basic Linear Homogeneous

Q: Solve the recurrence relation:

a_n = 2a_{n-1}, a_0 = 3

Type: First-order linear homogeneous

Solution: a_n = 3 * 2^n

2. Linear Non-Homogeneous

Q: Solve:

a_n = 3a_{n-1} + 4, a_0 = 2

Solution: a_n = 4 * 3^n - 2

3. Second-Order Linear Homogeneous

Q: Solve:

a_n = 4a_{n-1} - 4a_{n-2}, a_0 = 1, a_1 = 4

Solution: Characteristic equation: r^2 - 4r + 4 = 0 => (r - 2)^2

a_n = (A + Bn) * 2^n

4. Fibonacci Sequence

Q: Find the nth term of:

F_0 = 0, F_1 = 1, F_n = F_{n-1} + F_{n-2}

Solution (Closed-form):

F_n = (1/sqrt(5)) * [((1 + sqrt(5))/2)^n - ((1 - sqrt(5))/2)^n]

5. Divide-and-Conquer
Recurrence Relations - Example Questions

Q: Solve using the Master Theorem:

T(n) = 2T(n/2) + n, T(1) = 1

Solution: a = 2, b = 2, f(n) = n => T(n) = Theta(n log n)

6. Arithmetic Type

Q: Solve:

a_n = a_{n-1} + 5, a_0 = 2

Solution: a_n = 2 + 5n

You might also like