Different eigenvalues with power method?

71 Views Asked by At

I have matrix $A=$ \begin{pmatrix} 4 & 1 & -2\\ 2 & 3 & -2\\ 2 & 2 & -1 \end{pmatrix} When I run the power method with initial vector $(2,3,4)$ I get eigenvalue 3 and eigenvector to it $(1,1,1)$ which are correct, but when I run it with vector $(-1,2,1)$ I get eigenvalue 4 and eigenvector to it $(-1,-0.25,-0.3125)$. Shouldn't it be the same result? Why is it different? When I try vector $(-8,2,1)$ I get eigenvalue 3 and eigenvector to it $(-1,-1,-1)$, this is correct because the vector is just multiplied by $-1$, but why I get that incorrect eigenvalue 4?

Matlab code:

A=[4 1 -2; 2 3 -2; 2 2 -1];
x = [-1; 2; 1];
xx = [2; 3; 4];
n=length(x);
v=zeros(n,1);
eps=input('\n Error tollerance: ');
err=10;m1=1;m2=1;
 while err>eps
   v=A*x; 
   m2=max(abs(v));
   x=v/m2;
   err=abs(m1-m2);
   m1=m2;
 end
fprintf('\n Biggest eigenvalue: %5.5f\n',m1);
disp('Its vector:');
fprintf('\n %5.5f',x);