From homogeneous recursive relation to Matrices and Linear Algebra

87 Views Asked by At

After the lesson in recursive relations in the university, I realised that we can transform a homogeneous recursive relation to a linear algebra problem. Let $f_{n}-2f_{n-1}+f_{n-2}=0$, with $f_{0}=7, f_{1}=15$.

We can write this recursive relation in terms of matrices as:

\begin{align*} \left[\begin{array}{ccc} 1 &0 &0 &0 &... \\ 0 &1 &0 &0 &... \\ 1 &-2 &1 &0 &... \\ 0 &1 &-2 &1 &... \\ ... &...&...&...&...\\ \end{array}\right] \begin{bmatrix} f_{0} \\ f_{1} \\ \vdots \\ \vdots \\ \end{bmatrix} \\ {} = \begin{bmatrix} 7 \\ 15 \\ \vdots\\ \vdots\\ \end{bmatrix} \end{align*}

Therefore, our initial problem has now the form of $$A\vec{v}=\vec{w}$$

My question here is what can we obtain if we calculate the inverse of the matrix $A$ and what is the general formula for the inverse of $A$ for any homogeneous recursive relation. In this specific problem I think that it might be the matrix \begin{bmatrix} 1 & 0 & 0 & 0 & ...\\ 0 & 1 & 0 & 0 & ...\\ -1 & 3 & 1 & 0 & ...\\ -3 & 8 & 3 & 1 & ...\\ ... & ... & ... & ... & ... \end{bmatrix}

2

There are 2 best solutions below

1
On BEST ANSWER

While you're right that we could think about inverting the matrix, Jean is right in saying that infinite matrices are difficult to work with. This might be overkill for what you're asking, but building off your comment of Jean Marie's answer, you mention that you've seen how a sequence space can be a vector space. Using this and the idea of spanning and linear independence, you can get closed-form solutions to any linear recursive sequence. Take for example finding the n'th term of any sequence defined by $f(n+2)=f(n+1)+f(n)$. First consider the set $$ W = \{f: \mathbb{N}\rightarrow \mathbb{R} \; | \; f(n+2)= f(n+1)+f(n)\} $$ This is certainly a vector space (consisting of real-valued sequences), and if you think about it for a bit, you'll realize that any sequence in $W$ is going to be completely determined by it's first two values. Specifically we can say that $W$ is spanned by any sequences characterized by $$ w_0(0)=1, \; w_0(1)=0 \text{ and } w_1(0)=0, \; w_1(1)=1 $$ If you write out the terms of these recursive sequences, they seem to grow exponentially, so it's conceivable to construct elements of $W$ in the form $$ w(n) = \alpha^n = (1,\alpha,\alpha^2,\alpha^3,...) $$ It's definitely not the case that this form is true for any $\alpha$, but if we use our recurrence relation, $$ w(n+2)=w(n+1)+w(n) \text{ or } \alpha^{n+2}=\alpha^{n+1}+\alpha^n $$ This gives us a quadratic of the form $\alpha^2= \alpha+1$ which has solutions $\alpha = \frac{1 \pm \sqrt{5}}{2}$. Now Let $\tau_+ = \frac{1 + \sqrt{5}}{2}$ and $\tau_- = \frac{1 - \sqrt{5}}{2}$, so we have that $w_+(n) = \tau_+^n$ and $w_-(n) = \tau_-^n$ are both elements of $W$.

The claim now is that span$ \{w_+,w_-\} = W$. We already saw that $w_0$ and $w_1$ span $W$ so it suffices to show that $w_0$ and $w_1$ are both in span$\{w_+,w_-\}$. So consider $w_1$; we want to find some scalars $c_+$ and $c_-$ such that $$ w_1(n) = c_+w_+(n)+c_-w_-(n), \; \forall n \in \mathbb{N} $$ I.e it should be pointwise. But in particular we need \begin{align*} w_1(0) &= c_+w_+(0)+c_-w_-(0) \\ w_1(1) &= c_+w_+(1)+c_-w_-(1) \end{align*} Then from our characterization of $w_1$ and definitions of $w_+$ and $w_-$ we get \begin{align*} 0 &= c_+1+c_-1 \\ 1 &= c_+\tau_++c_-\tau_- \end{align*} Which is a linear system of 2 equations in 2 unknowns, and we can solve for $c_+$ and $c_-$ to get $c_+ = \frac{1}{\sqrt{5}}$ and $c_-= \frac{-1}{\sqrt5}$. So just for the cases where $n=0,1$, we have that \begin{align*} w_1(0) &= \frac{1}{\sqrt{5}}w_+(0)-\frac{1}{\sqrt{5}}w_-(0) \\ w_1(1) &= \frac{1}{\sqrt{5}}w_+(1)-\frac{1}{\sqrt{5}}w_-(1) \end{align*} But from this we can actually conclude that they are equal pointwise. Let $$ v = w_1-\left(\frac{1}{\sqrt{5}}w_+-\frac{1}{\sqrt{5}}w_- \right) $$ We can do this because $W$ is a vector space; hence closed under linear combinations. But by construction we have $v(0)=0$ and $v(1)=0$, therefore $v= (0)$ (the zero sequence). Therefore we can conclude that $$ w_1 = \frac{1}{\sqrt{5}}w_+ -\frac{1}{\sqrt{5}}w_-, \, \forall \, n $$ And so $$ w_1(n) = \frac{\tau_+^n-\tau_-^n}{\sqrt{5}}, \, \forall \, n $$ (This is the closed form solution for the Fibonacci sequence.) We could continue in a similar fashion and write $w_0$ as an linear combination of $w_+$ and $w_-$, and this would give us a general solution for any linear recurrence relation defined by $f(n+2)=f(n+1)+f(n)$!

Following the exact same procedure (with a smidge more algebra), we can write $w_0$ as $$ w_0(n) = \frac{5-\sqrt{5}}{10}\tau_+^n+\frac{5+\sqrt{5}}{10}\tau_-^n, \; \forall \, n $$ Therefore any sequence $(\phi_n) \in W$ with $\phi_0=a$ and $\phi_1=b$ has closed form solution $$ \phi(n) = a \left(\frac{\tau_+^n-\tau_-^n}{\sqrt{5}} \right) + b \left(\frac{5-\sqrt{5}}{10}\tau_+^n+\frac{5+\sqrt{5}}{10}\tau_-^n \right),\, \forall \, n $$

2
On

In fact, dealing with infinite matrices is cumbersome.

A much simpler linear algebra approach amounts to describe the relationship as being between consecutive terms in this way:

$$\begin{pmatrix}f_n\\f_{n-1}\end{pmatrix}=\begin{pmatrix}2&-1\\1&0\end{pmatrix}\begin{pmatrix}f_{n-1}\\f_{n-2}\end{pmatrix} \ \text{with} \ \begin{pmatrix}f_1\\f_{0}\end{pmatrix}=\begin{pmatrix}15\\7\end{pmatrix}$$

finally giving :

$$\begin{pmatrix}f_n\\f_{n-1}\end{pmatrix}=\begin{pmatrix}2&-1\\1&0\end{pmatrix}^{n-1}\begin{pmatrix}15\\7\end{pmatrix}$$