(a) Eigenvalue with eigenvector
and eigenvalue
with eigevector
(b) Eigenvalue with eigenvector
and eigenvalue
with eigenvector
.
(c) The matrix is deffective with eigenvalue and eigenvector
.
(d) The eigenvalues are
,
and
with corresponding eigenvectors
,
and
.
(e) Eigenvalues are
,
and
with corresponding
eigenvectors
,
and
.
(f)Eigenvalues are
,
and 0 with eigenvectors
,
and
.
It is easier to work with or
matrix first
to gain intuition.
For example, type in matlab
In what follow, we assume that is even.
To find eigenvalues, write
. To calculate
this determinant, expand it in the first raw. The second
determinant should be expanded in the last raw. The result is
To calculate eigenvectors, write
in components.
The eigenvectors corresponding to
are
The eigenvector corresponding to
is
Similarly, the eigenvector corresponding to
is
(a) Let
. Then
.
The product of matrices
and
is given by
(b) Denote the eigenvector to be
and using Rayleigh quontient, we write
(c) The eigenvalues of
are
. We showed in (b) that
are positive, and since
is assumed to be postive, the sum is positive. Therefore the eigenvalues of
are positive.
(d) We now write the Rayleigh quontient in vector form, substituting
so that
| (45) |
(e) If columns of are linearly independent, then there
are no
such that
. Then due to (b) above
all eigenvalues are positive, and thus the
are positive
definite.
(a) The power will fail since it will not be able to “decide”
whether to converge to eigenvector corresponding to eigenvalue
or
. The resulting vector will therefore converge to the
linear combination of the two eigenvectors corresponding to
eigenvalue
and
.
(b) Consider the matrix
, and use power method and inverse
power method to compute eigenvalues
and
.
(c) Consider the eigenvalues and
. Their ratio is
and
adding any positive
would decrease the ratio to
. Now consider the eigenvalues
and
. Their
absolute ratio is
. Adding any positive
will make the ratio
to be
. Any
smaller than
would decrease the
ratio from one to zero. So adding
makes one ratio worse, and
another better. The optimum is where both ratios are as small as
possible, i.e. they are equal, that is
This is a cool problem. The code that implements power iterations, inverse power iterations and power iterations with a shift is given below.
Note that for the million times million matrix one does not need to form the
matrix . Instead, it is enough to store the vector
and perform
operations on the
and
elements.
%First Question of this problem is to write power method for this matrix
n=100;format long;
MainDiagonal=linspace(1,n,n);
MainDiagonal(n)=pi*n;
SuperDiagonal=ones(n-1,1);
A = diag(MainDiagonal,0)+diag(SuperDiagonal,1)+diag(SuperDiagonal,-1);
x =rand(n,1);
yold=ones(n,1);
ynew=10*yold;
Counter=1;
while norm(yold-ynew)>1e-100
yold=ynew;Counter=Counter+1;
ynew=A*yold;
lambda=ynew'*A*ynew/(ynew'*ynew);
%fprintf("Counter=%d Lambda= %f old = %f new=%f \n",Counter,lambda,norm(yold),norm(ynew))
ynew=ynew/norm(ynew,2);
end
fprintf("Largest Eigenvalue is given by = %f\n",lambda);
%Second Question of this problem is to write INVERSE power method for this matrix
ynew=10*yold;
while norm(yold-ynew)>1e-100
yold=ynew;Counter=Counter+1;
ynew=A\yold;
lambda=ynew'*A*ynew/(ynew'*ynew);
%fprintf("Counter=%d Lambda= %f old = %f new=%f \n",Counter,lambda,norm(yold),norm(ynew))
ynew=ynew/norm(ynew,2);
end
fprintf("Smallest Eigenvalue is given by = %f\n",lambda);
yold=ones(n,1);
ynew=10*yold;
B = A -100*eye(n,n);
Counter=1;
while Counter<10
yold=ynew;Counter=Counter+1;
ynew=B\yold;
lambda=ynew'*B*ynew/(ynew'*ynew);
%fprintf("Counter=%d Lambda= %f old = %f new=%f \n",Counter,lambda,norm(yold),norm(ynew))
ynew=ynew/norm(ynew,2);
end
fprintf("Eigenvalue closest to 100 is given by = %f\n",lambda+100);
%Fourth question is to consider 10^6 times 10^6 matrix
n = 10^6;
y0 = rand(10^6,1);
yold=ones(n,1);
ynew=10*yold;
Counter=1;
while norm(yold-ynew)>1e-100
yold=ynew;Counter=Counter+1;
ynew(1) = yold(1)+yold(2);
ynew(n) = yold(n-1)+pi*n*yold(n);
for k = 2:n-1
ynew(k) = k*yold(k) + yold(k-1)+yold(k+1);
end
lambda=yold'*ynew/(yold'*yold);
%fprintf("Counter=%d Lambda= %f old = %f new=%f \n",Counter,lambda,norm(yold),norm(ynew))
ynew=ynew/norm(ynew,2);
end
fprintf("Million Over Million Largest Eigenvalue is given by = %f\n",lambda);
(a)
(b) Power method will fail since four eigenvalues are very close to
each other, and
, which is very
close to 1
(c) If you do a shift, and , then the dominant eigenvalue
is
(d) The next biggest eigenvalue in the shifted matrix will be ,
so the error will be reduced each time by
Now solve
(e) To converge to
one can choose
.
Then the eigenvalue
will be the dominant one,
so power method will converge to it.