Recurrence Relations Made Easy for Discrete Mathematics Exam
Hello there, my dear students! Today we are going to learn a very important topic for your Discrete Mathematics exam — Recurrence Relations. I know many of you feel nervous when you see this topic, but I promise you, by the end of this lesson, you will feel confident. So, let us start together, step by step.
1. What is a Recurrence Relation?
Think about how you climb stairs. To reach step n, you first need to be on step n-1, right? A recurrence relation works the same way. It is an equation that tells you how to find a term in a sequence by using the previous terms.
Now, let me ask you a question. If I tell you that each term is double the previous term, and the first term is 3, can you write the next few terms? Yes! The sequence is: 3, 6, 12, 24, 48, …
Here, the recurrence relation is: \(a_n = 2a_{n-1}\) for \(n \geq 1\)
And the initial condition is: \(a_0 = 3\)
But wait — what if I ask you to find \(a_{100}\)? You do not want to multiply 100 times! That is why we also find a solution (also called a closed formula). For this example, the solution is \(a_n = 3(2^n)\). Now you can find any term directly!
Worked Example 1: Finding Terms Step by Step
Problem: Find \(a_6\) in the sequence defined by \(a_n = 2a_{n-1} – a_{n-2}\) with \(a_0 = 3\) and \(a_1 = 4\).
Solution: We need to find each term one by one:
So \(a_6 = 9\). Notice the pattern? Each term increases by 1. The closed formula is \(a_n = n + 3\). Can you verify this? Check: \(a_0 = 0 + 3 = 3\) ✓ and \(a_6 = 6 + 3 = 9\) ✓
Worked Example 2: Writing a Recurrence Relation from a Sequence
Problem: Find a recurrence relation for the sequence: 1, 5, 17, 53, 161, 485, …
Solution: Let me guide you. Look at how the numbers grow:
Do you see the pattern? Each term is 3 times the previous term, plus 2. So the recurrence relation is:
Worked Example 3: Real-World Problem — Compound Interest
Problem: A person invests 10,000 birr at 12% interest compounded annually. Set up a recurrence relation.
Solution: Let \(A_n\) = amount at the end of year \(n\). The amount after \(n\) years equals the amount after \(n-1\) years plus the interest for year \(n\):
The closed formula is \(A_n = 10000(1.12)^n\). So after 15 years: \(A_{15} = 10000(1.12)^{15}\).
2. Linear Recurrence Relations with Constant Coefficients
Now, let me introduce you to a special and very important type of recurrence relation. Not all recurrence relations are easy to solve, but linear recurrence relations with constant coefficients have a clear step-by-step method. This is what examiners love to test!
\[ a_n = c_1 a_{n-1} + c_2 a_{n-2} + \cdots + c_k a_{n-k} + f(n) \]
where \(c_1, c_2, \ldots, c_k\) are constants (not depending on \(n\)), and \(f(n)\) is a function of \(n\).
Let me break this down for you with simple words:
- Linear = no powers like \(a_{n-1}^2\), no products like \(a_{n-1} \cdot a_{n-2}\)
- Constant coefficients = the numbers in front of each term are fixed, like 2, -3, 5 (not \(n\) or \(n^2\))
- Degree \(k\) = the gap between \(a_n\) and the farthest previous term it uses
| Type | Example | Linear? | Constant Coeff.? |
|---|---|---|---|
| \(a_n = 3a_{n-1} + 2\) | Yes | Yes | ✓ Both |
| \(a_n = a_{n-1}^2 + 1\) | No (has \(a_{n-1}^2\)) | No | ✗ Not linear |
| \(a_n = n \cdot a_{n-1}\) | Yes | No (coefficient is \(n\)) | ✗ Coeff. varies |
| \(a_n = 2a_{n-1} – 3a_{n-2} + n^2\) | Yes | Yes | ✓ Both |
Two Important Categories
Every linear recurrence relation with constant coefficients falls into one of two categories:
- Homogeneous: When \(f(n) = 0\). Example: \(a_n = 2a_{n-1} – a_{n-2}\)
- Non-homogeneous: When \(f(n) \neq 0\). Example: \(a_n = 2a_{n-1} + 3\) (here \(f(n) = 3\))
A) \(a_n = a_{n-1} \cdot a_{n-2}\)
B) \(a_n = n \cdot a_{n-1} + 1\)
C) \(a_n = 3a_{n-1} – 2a_{n-2}\)
D) \(a_n = a_{n-1}^2 + a_{n-2}\)
3. Solving Homogeneous Linear Recurrence Relations
Now we reach the most important part for your exam. I will teach you the method slowly and clearly. Pay close attention because this method works for all homogeneous linear recurrence relations with constant coefficients.
Step 1: Write the characteristic equation:
\[ r^k – c_1 r^{k-1} – c_2 r^{k-2} – \cdots – c_k = 0 \]
Step 2: Find the roots of this equation.
Step 3: Write the general solution based on the type of roots (see rules below).
Step 4: Use the initial conditions to find the specific constants.
Rule for Writing the General Solution
| Root Type | What You Get in Solution |
|---|---|
| Single real root \(r\) | A term: \(A \cdot r^n\) |
| Two distinct real roots \(r_1, r_2\) | \(a_n = A \cdot r_1^n + B \cdot r_2^n\) |
| One repeated root \(r\) (multiplicity 2) | \(a_n = (A + Bn) \cdot r^n\) |
| Root \(r\) repeated \(m\) times | \(a_n = (A_1 + A_2 n + A_3 n^2 + \cdots + A_m n^{m-1}) \cdot r^n\) |
Worked Example 4: Two Distinct Real Roots
Problem: Solve \(a_n = 5a_{n-1} – 6a_{n-2}\) with \(a_0 = 1\) and \(a_1 = 2\).
Step 1: Write the characteristic equation:
Step 2: Factor and find roots:
Step 3: Since we have two distinct real roots, the general solution is:
Step 4: Use initial conditions to find \(A\) and \(B\):
From (i): \(A = 1 – B\). Substitute into (ii):
Then \(A = 1\). So the particular solution is:
Let me verify: \(a_0 = 2^0 = 1\) ✓, \(a_1 = 2^1 = 2\) ✓, \(a_2 = 5(2) – 6(1) = 4 = 2^2\) ✓. Perfect!
Worked Example 5: Repeated Root
Problem: Solve \(a_n = 4a_{n-1} – 4a_{n-2}\) with \(a_0 = 1\) and \(a_1 = 4\).
Step 1: Characteristic equation:
Step 2: Since the root \(r = 2\) has multiplicity 2, the general solution is:
Step 3: Use initial conditions:
So the solution is:
Verify: \(a_0 = 1 \cdot 1 = 1\) ✓, \(a_1 = 2 \cdot 2 = 4\) ✓, \(a_2 = 4(4) – 4(1) = 12\) and formula gives \((1+2) \cdot 4 = 12\) ✓.
Worked Example 6: Higher Degree (Third Order)
Problem: Solve \(a_n = 6a_{n-1} – 11a_{n-2} + 6a_{n-3}\) with \(a_0 = 1\), \(a_1 = 2\), \(a_2 = 0\).
Step 1: Characteristic equation:
Step 2: Find roots. Try \(r = 1\): \(1 – 6 + 11 – 6 = 0\) ✓. So \((r-1)\) is a factor:
Three distinct roots: \(r_1 = 1, r_2 = 2, r_3 = 3\).
Step 3: General solution:
Step 4: Use initial conditions:
(ii) – (i): \(B + 2C = 1\) — (iv)
(iii) – (i): \(3B + 8C = -1\) — (v)
From (iv): \(B = 1 – 2C\). Substitute into (v): \(3(1-2C) + 8C = -1 \implies 3 – 6C + 8C = -1 \implies 2C = -4 \implies C = -2\)
Then \(B = 1 – 2(-2) = 5\) and \(A = 1 – 5 – (-2) = -2\).
A) \(r^2 + 3r + 4 = 0\)
B) \(r^2 – 3r – 4 = 0\)
C) \(r^2 – 3r + 4 = 0\)
D) \(r^2 + 3r – 4 = 0\)
Characteristic equation: \(r^2 – r + 6 = 0\)
Discriminant: \(\Delta = 1 – 24 = -23 < 0\)
This gives complex roots: \(r = \frac{1 \pm \sqrt{23}\,i}{2}\)
While complex roots can be solved using trigonometric forms, in most introductory discrete math courses, if the characteristic equation has no real roots, you simply state that the solution involves complex numbers. The general form would use \(|\alpha|\) and trigonometric functions, but for exam purposes, recognizing that no real roots means the sequence oscillates is the key insight.
4. Solving Non-Homogeneous Linear Recurrence Relations
Now, my friends, we move to the second type. This is where \(f(n) \neq 0\). Do not worry — the method builds on what you already learned!
\[ a_n = \underbrace{a_n^{(h)}}_{\text{homogeneous solution}} + \underbrace{a_n^{(p)}}_{\text{particular solution}} \]
How to Find the Particular Solution \(a_n^{(p)}\)
You make an educated guess based on the form of \(f(n)\):
| If \(f(n)\) is… | Guess \(a_n^{(p)}\) as… | If this guess conflicts with homogeneous, multiply by \(n\) |
|---|---|---|
| Constant \(d\) | \(P\) (a constant) | If 1 is a root, use \(Pn\); if repeated root, use \(Pn^2\) |
| Linear \(pn + q\) | \(Pn + Q\) | If 1 is a root, use \(n(Pn + Q)\) |
| Power \(d^n\) | \(P \cdot d^n\) | If \(d\) is a root of multiplicity \(m\), use \(Pn^m \cdot d^n\) |
| \(d^n \cdot (pn+q)\) | \(d^n(Pn+Q)\) | If \(d\) is a root, multiply by \(n^m\) |
Worked Example 7: \(f(n)\) = Constant (No Conflict)
Problem: Solve \(a_n = 3a_{n-1} + 2\) with \(a_0 = 1\).
Step 1: Find the homogeneous solution. The homogeneous part is \(a_n^{(h)} = 3a_{n-1}^{(h)}\).
Characteristic equation: \(r – 3 = 0 \implies r = 3\)
So \(a_n^{(h)} = A \cdot 3^n\)
Step 2: Find a particular solution. Since \(f(n) = 2\) (a constant), guess \(a_n^{(p)} = P\).
Substitute into the original recurrence:
So \(a_n^{(p)} = -1\). (No conflict since \(-1\) is not in the homogeneous solution form.)
Step 3: General solution: \(a_n = A \cdot 3^n – 1\)
Step 4: Use initial condition: \(a_0 = A \cdot 1 – 1 = 1 \implies A = 2\)
Verify: \(a_0 = 2 – 1 = 1\) ✓, \(a_1 = 2(3) – 1 = 5\) and from recurrence: \(3(1) + 2 = 5\) ✓.
Worked Example 8: \(f(n)\) = Constant WITH Conflict
Problem: Solve \(a_n = 3a_{n-1} – 2\) with \(a_0 = 1\).
Step 1: Homogeneous: \(a_n^{(h)} = 3a_{n-1}^{(h)} \implies r = 3 \implies a_n^{(h)} = A \cdot 3^n\)
Step 2: Guess \(a_n^{(p)} = P\) (constant). Substitute: \(P = 3P – 2 \implies -2P = -2 \implies P = 1\).
This works! No conflict here because the root is 3, not 1. The conflict only happens when the constant 1 is a root of the characteristic equation.
Step 3: \(a_n = A \cdot 3^n + 1\). Using \(a_0 = 1\): \(A + 1 = 1 \implies A = 0\).
Interesting! The solution is just the constant 1. Verify: \(a_n = 1 = 3(1) – 2 = 1\) ✓. This makes sense — the sequence is constant.
Worked Example 9: Real Conflict Case
Problem: Solve \(a_n = a_{n-1} + a_{n-2} + 2\) with \(a_0 = 0\) and \(a_1 = 0\).
Step 1: Homogeneous: \(r^2 – r – 1 = 0\). Roots: \(r = \frac{1 \pm \sqrt{5}}{2}\). (These are the golden ratio numbers.)
\(a_n^{(h)} = A \left(\frac{1+\sqrt{5}}{2}\right)^n + B \left(\frac{1-\sqrt{5}}{2}\right)^n\)
Step 2: Guess \(a_n^{(p)} = P\). Substitute: \(P = P + P + 2 \implies P = 2P + 2 \implies P = -2\).
Wait — this gives \(P = -2\). Let me check: is there a conflict? The roots are \(\frac{1\pm\sqrt{5}}{2}\), not 1. So no conflict! The particular solution \(a_n^{(p)} = -2\) is valid.
Step 3: \(a_n = A \left(\frac{1+\sqrt{5}}{2}\right)^n + B \left(\frac{1-\sqrt{5}}{2}\right)^n – 2\)
Step 4: \(a_0 = 0\): \(A + B – 2 = 0 \implies A + B = 2\)
\(a_1 = 0\): \(A\left(\frac{1+\sqrt{5}}{2}\right) + B\left(\frac{1-\sqrt{5}}{2}\right) – 2 = 0\)
This gives a system we can solve, but the key point is the method.
Worked Example 10: \(f(n) = d^n\) Type
Problem: Solve \(a_n = 5a_{n-1} – 6a_{n-2} + 2^n\) with \(a_0 = 1\) and \(a_1 = 0\).
Step 1: Homogeneous part: \(r^2 – 5r + 6 = 0 \implies (r-2)(r-3) = 0 \implies r_1 = 2, r_2 = 3\)
\(a_n^{(h)} = A \cdot 2^n + B \cdot 3^n\)
Step 2: Particular solution. Here \(f(n) = 2^n\), so normally we guess \(a_n^{(p)} = P \cdot 2^n\). BUT — \(r = 2\) is already a root of the characteristic equation! This is a conflict. So we multiply by \(n\):
Guess: \(a_n^{(p)} = Pn \cdot 2^n\)
Substitute into the original recurrence:
So \(a_n^{(p)} = -2n \cdot 2^n\)
Step 3: General solution: \(a_n = A \cdot 2^n + B \cdot 3^n – 2n \cdot 2^n\)
Step 4: Initial conditions:
From (i): \(A = 1 – B\). Substitute into (ii): \(2(1-B) + 3B = 4 \implies 2 + B = 4 \implies B = 2\), then \(A = -1\).
A) \(P \cdot 3^n\)
B) \(P\)
C) \(Pn\)
D) \(P \cdot 2^n\)
Homogeneous: \(r^2 – r – 2 = 0 \implies (r-2)(r+1) = 0 \implies r_1 = 2, r_2 = -1\)
\(a_n^{(h)} = A \cdot 2^n + B \cdot (-1)^n\)
Particular: \(f(n) = 2\) (constant). Guess \(a_n^{(p)} = P\). Neither 2 nor -1 equals 1, so no conflict.
\(P = P + 2P + 2 \implies P = 3P + 2 \implies -2P = 2 \implies P = -1\)
General: \(a_n = A \cdot 2^n + B \cdot (-1)^n – 1\)
Initial conditions:
\(a_0 = 0\): \(A + B – 1 = 0 \implies A + B = 1\) — (i)
\(a_1 = 1\): \(2A – B – 1 = 1 \implies 2A – B = 2\) — (ii)
Adding (i) and (ii): \(3A = 3 \implies A = 1\), then \(B = 0\).
\[\boxed{a_n = 2^n – 1}\]
Verify: \(a_0 = 1 – 1 = 0\) ✓, \(a_1 = 2 – 1 = 1\) ✓, \(a_2 = 1 + 0 + 2 = 3\) and \(2^2 – 1 = 3\) ✓.
5. Classic Exam Problem: Bit Strings Without Consecutive Zeros
This is one of the most frequently asked problems in discrete mathematics exams. Let me walk you through it carefully.
Worked Example 11: Bit Strings Problem
Problem: Find a recurrence relation and initial conditions for the number of bit strings of length \(n\) that do NOT have two consecutive 0s. How many such strings of length 5?
Solution: Let \(a_n\) = number of bit strings of length \(n\) with no two consecutive 0s.
Think about how a valid string of length \(n\) can start:
So the recurrence relation is: \(a_n = a_{n-1} + a_{n-2}\) for \(n \geq 2\)
Initial conditions: \(a_0 = 1\) (the empty string) and \(a_1 = 2\) (strings: 0, 1)
Now find \(a_5\): \(a_2 = 3, a_3 = 5, a_4 = 8, a_5 = 13\)
So there are 13 bit strings of length 5 with no two consecutive 0s.
Bonus: Can you solve this recurrence? The characteristic equation is \(r^2 – r – 1 = 0\) (same as Fibonacci!). The roots are \(r = \frac{1 \pm \sqrt{5}}{2}\). Using initial conditions, you get the closed formula.
A) 1, 2, 3, 5, 8, 13, …
B) 1, 1, 2, 3, 5, 8, …
C) 0, 1, 1, 2, 3, 5, …
D) 2, 3, 5, 8, 13, 21, …
6. Quick Summary of All Methods
| Step | Homogeneous | Non-Homogeneous |
|---|---|---|
| 1. Write characteristic eqn | Yes | Yes (ignore \(f(n)\)) |
| 2. Find roots | Yes | Yes |
| 3. Write homogeneous solution | Yes (this IS the answer form) | Yes (this is part of the answer) |
| 4. Find particular solution | Not needed | Yes — guess based on \(f(n)\), check for conflict |
| 5. Combine | Just use step 3 | \(a_n = a_n^{(h)} + a_n^{(p)}\) |
| 6. Use initial conditions | Find constants | Find constants |
1. Always write the characteristic equation correctly — watch the signs!
2. For non-homogeneous, ALWAYS check if your guess conflicts with the homogeneous solution.
3. When you have repeated roots, remember to multiply by \(n, n^2, \ldots\) accordingly.
4. Verify your answer by plugging back into the original recurrence relation.
5. For bit string problems, think about cases based on how the string starts.
Challenge Conceptual Exam Questions
Test your deep understanding with these questions. They are designed to match the difficulty level of real exam questions.
Multiple Choice Questions
A) \(a_n = 2a_{n-1} – a_{n-2}\)
B) \(a_n = a_{n-1} + 2n – 1\)
C) Both A and B
D) Neither A nor B
Check A: \(2a_{n-1} – a_{n-2} = 2(n-1)^2 – (n-2)^2 = 2(n^2 – 2n + 1) – (n^2 – 4n + 4) = 2n^2 – 4n + 2 – n^2 + 4n – 4 = n^2 – 2 = ?\) Wait — this gives \(n^2 – 2\), not \(n^2\). Let me recheck.
Actually: \(2(n-1)^2 – (n-2)^2 = 2n^2 – 4n + 2 – n^2 + 4n – 4 = n^2 – 2\). This is NOT \(n^2\). So A is wrong.
Check B: \(a_{n-1} + 2n – 1 = (n-1)^2 + 2n – 1 = n^2 – 2n + 1 + 2n – 1 = n^2\). ✓ So B is correct.
Correction: Answer is B only. This question teaches you to always verify by substitution!
A) \(A \cdot 2^n + B \cdot 2^n + C \cdot 2^n\)
B) \((A + Bn + Cn^2) \cdot 2^n\)
C) \(A \cdot 2^n + B \cdot n \cdot 2^n\)
D) \(A \cdot 2^{3n}\)
A) \(Pn + Q\)
B) \(n(Pn + Q)\)
C) \(n^2(Pn + Q)\)
D) \(P \cdot 2^n + Qn\)
A) 1
B) 2
C) 3
D) 4
A) \(a_n = 2^n\)
B) \(a_n = 3^n\)
C) Both A and B
D) Neither A nor B
Check A: \(4(2^{n-1}) – 3(2^{n-2}) = 2^{n-2}(8 – 3) = 5 \cdot 2^{n-2}\). But \(2^n = 4 \cdot 2^{n-2}\). Since \(5 \neq 4\), this does NOT work. Let me recheck carefully.
\(4 \cdot 2^{n-1} = 2^2 \cdot 2^{n-1} = 2^{n+1}\) and \(3 \cdot 2^{n-2} = 3 \cdot 2^{n-2}\). So \(2^{n+1} – 3 \cdot 2^{n-2} = 2^{n-2}(8 – 3) = 5 \cdot 2^{n-2}\). But \(a_n = 2^n = 4 \cdot 2^{n-2}\). Not equal!
Check B: \(4 \cdot 3^{n-1} – 3 \cdot 3^{n-2} = 3^{n-2}(12 – 3) = 9 \cdot 3^{n-2} = 3^n\) ✓
Correction: Answer is B only. Always verify carefully — \(2^n\) is NOT a solution here. The characteristic equation is \(r^2 – 4r + 3 = (r-1)(r-3) = 0\), so roots are 1 and 3. Solutions are \(A \cdot 1^n + B \cdot 3^n = A + B \cdot 3^n\). Only \(3^n\) works (when \(A = 0\)).
True / False Questions
Fill in the Blank Questions
Short Answer / Workout Questions
Characteristic equation: \(r^2 – 3r + 2 = 0 \implies (r-1)(r-2) = 0 \implies r_1 = 1, r_2 = 2\)
General solution: \(a_n = A \cdot 1^n + B \cdot 2^n = A + B \cdot 2^n\)
Initial conditions:
\(a_0 = 2\): \(A + B = 2\) — (i)
\(a_1 = 3\): \(A + 2B = 3\) — (ii)
(ii) – (i): \(B = 1\), then \(A = 1\)
\[\boxed{a_n = 1 + 2^n}\]
Verify: \(a_0 = 1 + 1 = 2\) ✓, \(a_1 = 1 + 2 = 3\) ✓, \(a_2 = 3(3) – 2(2) = 5\) and \(1 + 4 = 5\) ✓.
Homogeneous: \(r^2 – 2r + 1 = (r-1)^2 = 0\). Root \(r = 1\) with multiplicity 2.
\(a_n^{(h)} = (A + Bn) \cdot 1^n = A + Bn\)
Particular: \(f(n) = 6n\) (linear). Normal guess: \(Pn + Q\). But \(r = 1\) IS a root (multiplicity 2), so there is a conflict. Multiply by \(n^2\):
Guess: \(a_n^{(p)} = n^2(Pn + Q) = Pn^3 + Qn^2\)
Substitute: \(Pn^3 + Qn^2 = 2[P(n-1)^3 + Q(n-1)^2] – [P(n-2)^3 + Q(n-2)^2] + 6n\)
Expanding and comparing coefficients:
Coefficient of \(n^3\): \(P = 2P – P = P\) ✓ (identity, gives no info)
Coefficient of \(n^2\): \(Q = 2(-3P + Q) – (-6P + Q) = -6P + 2Q + 6P – Q = Q\) ✓ (identity)
Coefficient of \(n^1\): \(0 = 2(3P – 2Q) – (12P – 4Q) + 6 = 6P – 4Q – 12P + 4Q + 6 = -6P + 6\)
So \(-6P + 6 = 0 \implies P = 1\)
Coefficient of \(n^0\): \(0 = 2(-P + Q) – (-8P + 4Q) = -2P + 2Q + 8P – 4Q = 6P – 2Q\)
So \(6(1) – 2Q = 0 \implies Q = 3\)
\(a_n^{(p)} = n^3 + 3n^2\)
General: \(a_n = A + Bn + n^3 + 3n^2\)
Initial conditions:
\(a_0 = 1\): \(A = 1\)
\(a_1 = 2\): \(1 + B + 1 + 3 = 2 \implies B + 5 = 2 \implies B = -3\)
\[\boxed{a_n = 1 – 3n + 3n^2 + n^3}\]
Verify: \(a_0 = 1\) ✓, \(a_1 = 1 – 3 + 3 + 1 = 2\) ✓, \(a_2 = 1 – 6 + 12 + 8 = 15\) and from recurrence: \(2(2) – 1 + 12 = 15\) ✓.
Let \(A_n\) = amount at end of year \(n\).
Each year: the previous amount grows by 8%, plus 1000 is added.
\[ A_n = 1.08 \, A_{n-1} + 1000, \quad A_0 = 5000 \]
Homogeneous: \(r – 1.08 = 0 \implies r = 1.08\)
\(A_n^{(h)} = A \cdot (1.08)^n\)
Particular: Guess \(A_n^{(p)} = P\). \(P = 1.08P + 1000 \implies -0.08P = 1000 \implies P = -12500\)
(No conflict since 1 is not the root; 1.08 is the root.)
General: \(A_n = A \cdot (1.08)^n – 12500\)
Initial condition: \(A_0 = 5000 = A – 12500 \implies A = 17500\)
\[\boxed{A_n = 17500 \cdot (1.08)^n – 12500}\]
This formula lets you find the amount after any number of years without computing year by year!
Let \(a_n\) = number of ways to climb \(n\) stairs.
To reach step \(n\), your last move is either:
– 1 step from step \(n-1\): \(a_{n-1}\) ways
– 2 steps from step \(n-2\): \(a_{n-2}\) ways
So: \(a_n = a_{n-1} + a_{n-2}\) for \(n \geq 2\)
Initial conditions: \(a_0 = 1\) (stay where you are), \(a_1 = 1\) (only one 1-step)
Compute: \(a_2 = 2, a_3 = 3, a_4 = 5, a_5 = 8, a_6 = 13\)
There are 13 ways to climb 6 stairs. This is the Fibonacci sequence! The closed formula is the same as the Fibonacci closed form (Binet’s formula).
Homogeneous: \(r – 1 = 0 \implies r = 1\). So \(a_n^{(h)} = A \cdot 1^n = A\).
Particular: \(f(n) = 2\) (constant). Guess \(P\). But \(r = 1\) IS a root! So we have a conflict. Multiply by \(n\): guess \(a_n^{(p)} = Pn\).
Substitute: \(Pn = P(n-1) + 2 \implies Pn = Pn – P + 2 \implies P = 2\)
So \(a_n^{(p)} = 2n\).
General: \(a_n = A + 2n\)
Initial condition: \(a_0 = 5 = A + 0 \implies A = 5\)
\[\boxed{a_n = 5 + 2n}\]
Verification:
– Initial condition: \(a_0 = 5 + 0 = 5\) ✓
– Recurrence: \(a_n = 5 + 2n\) and \(a_{n-1} + 2 = 5 + 2(n-1) + 2 = 5 + 2n – 2 + 2 = 5 + 2n = a_n\) ✓
This confirms the solution is correct. Notice how the conflict rule was essential here — without multiplying by \(n\), we would have gotten a wrong answer.