This is section 7.4 in the book. We want to solve for homogeneous recurrence relation.
Definition Homogeneous recurrence relation is a recurrence of the form:
$$
h_n = a_1 h_{n-1} + a_2h_{n-2} + \ldots + a_kh_{n-k}
$$
Where
Definition The characteristic polynomial of the homogeneous linear recurrence:
$$
\begin{align*}
\frac{P(x)}{x^{n-k}} &= \frac{x^n - (a_1 x^{n-1} + a_2 x^{n-2} + \ldots + a_k x^{n-k})}{x^{n-k}}\
r(x) &= x^k - (a_1x^{k-1} + a_2x^{k-2} + \ldots + a_kx)
\end{align*}
$$
Actually, characteristic polynomial is very useful when we solve these recurrences. The root of characteristic equations gives us a hint of the solution. We will see this later.
There are some basic HRR we usually see:
- The Fibonacci sequence:
$f_n = f_{n-1} + f_{n-2}$ - The factorial sequence:
$f_n = nf_{n-1}$ - The geometric sequence:
$f_n = q h_{n-1}$
Let
of order
Let
Then, the generating function of
where we define
Note that this is slightly different from the previous definition, but this is still a homogeneous recurrence relations.
Proof is not given... I think just understanding this theorem's statement what matters.
Exercise
Find the general solution of the recurrence relation:
$$
h_n = 2h_{n-1} + 2h_{n-2}, \quad(n \geq 2)
$$
where
Solution
We try:
Example
Find the general solution of the recurrence relation:
$$
h_n = 4h_{n-1} - 4h_{n-2}
$$
where
Solution
Just like the previous one, we first try:
Putting
Then, try:
In this case, we want to know if the following equivalence holds: $$ n \cdot 2^n \overset{?}{=} 4(n-1)2^{n-1} - 4 (n-2)2^{n-2} $$
We can try from the right side:
$$
\begin{align*}
&4(n-1)2^{n-1} - 4 (n-2)2^{n-2}\
&= 2^{n-2}\cdot \left( 8(n-1) - 4(n-2) \right)\
&= 2^{n-2}(8n-8-4n+8)\
&= 2^{n-2}(4n) = n \cdot 2^n = \text{left side}
\end{align*}
$$
Yes, our guess is valid! How about the first two terms? If we let
Why taking linear combination still holds?
We need: $$ \begin{cases} h_0 = 1 = c_1\ h_1 = 3 = c_1 \cdot 2 + c_2 \cdot 1 \cdot 2 \end{cases} \implies c_2 = \frac{1}{2} $$ Conclusion:
In Brualdi's book page 237, it writes;
If, as in the preceding example, some characteristic root is repeated, we would like to find another solution associated with that root. The situation is similar to that which occurs in differential equations.
Well, I don't know how to solve for differential equations. I don't know how to solve for a differential equation, so I will try to clarify this using just the example we have seen. There are some confusing words that Brualdi used in the book. Here is my understanding:
For any equation, it can have multiple "solutions". But there is only one "general solution". The "general solution" can be the linear combination of linearly independent "solutions". Now, what are the "solutions"? I think solutions are all possible relations that satisfies our recurrence. In our case, we discovered that there are two possible solutions to the recurrence relation, but they all failed on the first two terms. But we can actually take the linear combination of them. Here is why: say we have two "solutions" at this point:
$$
\begin{align*}
&\begin{cases}
a_n = q^n\
b_n = n \cdot q^n
\end{cases}
\quad \text{where
In the last equation, we see why taking the linear combination won't affect the result. THIS IS HOMOGENEOUS, meaning the "right side" must be zero. Multiply by any constant won't change the recurrent relation, but it will only help us shif the expression to fit in the initial conditions.
Now, there is a more general theorem for what I have just discussed here.
Let
are all solutions to the recurrence.
Proof
We first need some tools:
First tool: decomposition
$$
P(x)=\left(x-q_1\right)^{i_1} \cdot\left(x-q_2\right)^{i_2} \cdots\left(x-q_d\right)^{i_d}
$$
where
Second Tool:
Let
Corollary Let
proof: by the second tool, we have:
$$
Q^{(j)}(x)=(x-r)^{i-j} \cdot P_j(x)
$$
for some polynomial
Consider $$ h_n=a_1 h_{n-1}+a_2 h_{n-2}+\cdots+a_k h_{n-k} $$
Which has characteristic polynomial:
$$
Q(x) = x^n - a_1x^{n-1} - a_2x^{n-2} - \cdots - a_kx^{n-k}
$$
We know that
If we expand