Use eigendecomposition to compute number in modified Fibonacci sequence

3 views (last 30 days)
I constructed the following code to compute x13:
clear all
close all
clc
f(1) = 3;
f(2) = 5;
for i = 3 : 13
f(i) = (f(i-1) + f(i-2))-4;
end
Unfortunately, the desired response is: Use the method of eigendecomposition to compute x13 for this Fibonacci Cat sequence. What is the largest eigenvalue? What is the eigenvector corresponding to this largest eigenvalue?
I was able to use a for-loop to figure out x13, but I do not know how to use the eigendecomposition to compute this value. Thanks!

Answers (1)

Roger Stafford
Roger Stafford on 11 Aug 2014
First, you can convert the recursion to
y_(k+1) = y_k + y_(k-1)
where y_k = x_k - 4. Then you can write
[y_(k+2);y_(k+1)] = A * [y_(k+1);y_k]
where A = [1,1;1,0]. Then find the eigenvalues and eigenvectors of A.
[V,D] = eig(A);
Hence you would have
[y_13; y_12] = A^11*[y_2;y_1] = (V*D^11*V')*[y_2;y_1]
where D^11 is merely the eleventh power of the diagonal eigenvalues. This expresses the value of y_13 (and therefore x_13) directly in terms of y_2 and y_1 without any iterated steps.
The Wikipedia article at:
http://en.wikipedia.org/wiki/Fibonacci_number
describes this procedure in their section 5 - Matrix Form.
  1 Comment
Nicolas
Nicolas on 13 Aug 2014
Edited: Nicolas on 13 Aug 2014
Thank you for your response.
I have attempted to utilize the code you provided, but am receiving errors when trying to run it.
This is what I am trying to run:
clear all
close all
clc
y_k = x_k - 4;
A = [1,1;1,0];
y_(k+1) = y_k + y_(k-1);
[y_(k+2);y_(k+1)] = A * [y_(k+1);y_k];
[V,D] = eig(A);
[y_13; y_12] = A^11*[y_2;y_1] = (V*D^11*V')*[y_2;y_1];
I am receiving the error message:
Error: File: hw5exercise3.m Line: 10 Column: 8
Multiple left-hand sides must be separated by commas.
Do you know how I can resolve this problem?
Thanks!

Sign in to comment.

Categories

Find more on Linear Algebra in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!