0

If the recurrence relation $r_{n+1}=r_n+r_{n-1}$ is used with starting values $r_0=1$ and $r_1=(1-\sqrt{5})/2$, what is the theoretically correct value of $r_n$ ($n\geq 2$)? Can the recurrence relation provide a stable means for computing $r_n$ in this case?

Answer: The general solution for the relation, $r_{n+1}=r_n+r_{n-1}$ is $$r_n=A\left(\dfrac{1+\sqrt{5}}{2}\right)^n+B\left(\dfrac{1-\sqrt{5}}{2}\right)^n.$$ We want to find the theoretically correct value of $r_n$, when $n\geq 2$, given $r_0=1$ and $r_1=(1-\sqrt{5})/2$.

With the starting values $r_0=1$ and $r_1=(1-\sqrt{5})/2$, we get the following system of equations: \begin{cases} 1=r_0=A+B \\ \dfrac{1-\sqrt{5}}{2}=r_1=A\left(\dfrac{1+\sqrt{5}}{2}\right)+B\left(\dfrac{1-\sqrt{5}}{2}\right) \end{cases}

Multiply the first equation by $\dfrac{1-\sqrt{5}}{2}$. \begin{cases} \dfrac{1-\sqrt{5}}{2}=r_0=A\left(\dfrac{1-\sqrt{5}}{2}\right)+B\left(\dfrac{1-\sqrt{5}}{2}\right) \\ \dfrac{1-\sqrt{5}}{2}=r_1=A\left(\dfrac{1+\sqrt{5}}{2}\right)+B\left(\dfrac{1-\sqrt{5}}{2}\right) \end{cases} Next, subtract equation (1) from equation (2), which results with $$0=A\left[\left(\dfrac{1-\sqrt{5}}{2}\right)-\left(\dfrac{1+\sqrt{5}}{2}\right)\right] \iff A=0.$$ Furthermore $B=1.$ Hence, the general solution for the relation is $$r_n =\left(\dfrac{1-\sqrt{5}}{2}\right)^n=r_1^n.$$

How do I determine whether or not the relation provides a stable means for computing $r_n$?

  • What do you mean "stable"? The closed formula gives an exact value for $r_n$. What more do you want? – lulu Sep 09 '17 at 18:47
  • Let me ask more precisely: in my work, I am often concerned with numerical stability. I have to model complex systems and parametrize the models using data which is itself often uncertain. It is a frequent headache that the models one would like to use vary unstably with the data...so minor changes in the data produce annoyingly different parameter sets. Are you asking something like that here? Are your recursion coefficients (or the initial conditions) uncertain in some way? – lulu Sep 09 '17 at 18:55
  • According to my notes, If small changes in the initial data only cause small changes in the final results, then the algorithm is said to be stable. Otherwise, it is unstable. – Username Unknown Sep 09 '17 at 19:17
  • 1
    Ok. But here, small changes in the initial set up produce dramatic effects. For example, in your solution $r_n$ tends to $0$ for large $n$, but if you change the initial condition so that $r_0=1.0001$ you will pick up the conjugate term so $r_n$ will go to infinity. – lulu Sep 09 '17 at 19:19
  • 1
    Is there a mathematical way to show this? other than producing iterations – Username Unknown Sep 09 '17 at 19:35
  • It's obvious. As you correctly remark, the general solution to your recursion has the form $A(\lambda_+)^n+B(\lambda_-)^n$. To get $r_n$ to go to $0$ for large $n$ we require $A=0$ which means $r_0=B, r_1=B\times \lambda_-$. Thus you need $\frac {r_1}{r_0}=\lambda_-$. Any initial conditions that fail to pass that very unstable test will have $A\neq 0 $ and then $r_n$ will tend to either $\pm\infty$ depending on the sign of $A$. – lulu Sep 09 '17 at 19:40

3 Answers3

2

We have the recurrence $r_{n+1}=r_n+r_{n-1}$, with $r_0$ and $r_1$ given. We would like to know if the computational error in computing the values of $r_n$ from the recurrence is stable or can be expected to grow wildly.

Let's say the actual computed values are $c_n$, which are computed with some error from the formula $c_{n+1} = c_n + c_{n-1}$. If we define $\epsilon_n = r_n - c_n$, then subtracting the equations for $r_{n+1}$ and $c_{n+1}$, we have $$\epsilon_{n+1} = \epsilon_n + \epsilon_{n-1}$$ which is a linear difference equation. Equations of this form have elementary solutions of the form $\epsilon_n = \rho^n$. Substituting in the previous equation, $$\rho^{n+1}=\rho^n + \rho^{n-1}$$ so $$\rho^2 = \rho + 1$$ which is a quadratic with two real roots $\rho_1 \approx 1.62$ and $\rho_2 \approx -0.62$. The error $\epsilon_n$ is therefore $$\epsilon_n = A \rho_1^n + B \rho_2^n$$ for some constants $A$ and $B$.

Since $\rho_1 > 1$, we can expect the error to grow wildly with large $n$.

awkward
  • 15,626
  • So in general, what I should be doing is finding the approximate values for the characteristic equation corresponding to the recurrence relation and then take the limit of $A\rho_1^n+B\rho_2^n$? – Username Unknown Sep 10 '17 at 04:20
  • 1
    That's essentially correct, but it might be better to say that the key is whether the absolute values of $\rho_1$ and $\rho_2$ are greater than or less than 1. Having both values less than or equal to 1 implies stability, otherwise you have instability. – awkward Sep 10 '17 at 12:57
0

You'd better include the relevant parts of what you mean into your question, instead of referring to unknown parts of a whole theory. In exact arithmetic, there is no problem, since all your numbers are of the form $(a+b\sqrt{5})/2$ with interger $a,b$, so everybody who knows anything in algorithms would work with pairs $(a,b)$, without numerical problems. If you have to work with floats, and the given recurrence instead of the closed formula (what you neglected to mention in your question), things are obviously different: practically, due to rounding errors, you'd only get $A\approx0$, and the error would multiply with a rapidly growing sequence, rendering your numerical results useless, quite soon.
The remedy is well known: you start with $R_N=0$ and $R_{N-1}=1$, work backwards, i.e. $R_{n-1}=R_{n+1}-R_n$, and in the end, you do $r_n=R_n/R_0$ to guarantee $r_0=1$. If you don't believe that works, just try it out. Lots of algorithms use the idea, e.g. to compute values of the Bessel function from recurrence relations.

0

Using the methods described here, it can be readily shown that the solution to the sequence $f_{n}=f_{n-1}+f_{n-2}$ with arbitrary initial conditions $f_0,~f_1$ can be written as

$${{f}_{n}}=\frac{\left( {{f}_{1}}-{{f}_{0}}\psi \right)\,{{\varphi }^{n}}-\left( {{f}_{1}}-{{f}_{0}}\varphi \right)\,{{\psi }^{n}}}{\varphi -\psi}\\ \varphi,\psi=\frac{1\pm\sqrt{5}}{2} $$

With $f_0=1 ~\& ~f_1=\frac{1-\sqrt{5}}{2}=\psi$, we can readily show that

$$f_n=\psi^n\quad \text{or}\quad r_n=r_1^n$$

as in the OP.

I have verified this result numerically.

Cye Waldman
  • 8,196