Why is MATLAB giving me these weird eigenvectors?

1.9k Views Asked by At

I am doing a problem which involves finding the eigenvalues and eigenvectors of the matrix $$ M=\begin{bmatrix} 0 & 1/2 & 1/2 \\ 1/2 & 0 & 1/2 \\ 1/2 & 1/2 & 0 \end{bmatrix}$$

When I compute by hand, I get eigenvalues of 1, -1/2, -1/2 with corresponding eigenvectors $\begin{bmatrix}1\\1\\1\end{bmatrix},\begin{bmatrix}-1\\1\\0\end{bmatrix},\begin{bmatrix}-1\\0\\1\end{bmatrix}$, but when I try to compute in MATLAB I get

>>[A B] = eig(M)

A =

   -0.7152    0.3938    0.5774
    0.0166   -0.8163    0.5774
    0.6987    0.4225    0.5774


B =

   -0.5000         0         0
         0   -0.5000         0
         0         0    1.0000

The last eigenvector makes sense, but the first two aren't scalar multiples of the ones I got, which I figured they should be. Why are these also eigenvectors?

3

There are 3 best solutions below

1
On BEST ANSWER

You have a repeated eigenvalue. The vectors $$\begin{bmatrix}-1\\1\\0\end{bmatrix},\begin{bmatrix}-1\\0\\1\end{bmatrix}$$ form a basis for the eigenspace associated to the eigenvalue $-\frac{1}{2}$. If you check the first two eigenvectors that matlab has given you then you will find that they are also a basis for this space. At least they would be if they were calculated exactly. There's going to be some rounding error.

0
On

The eigenvectors are normalized to have a norm of 1 and are chosen to be orthogonal. They will be unique (up to scalar multiplication) only if they have different eigenvalues.

Here you have two eigenvectors that share the same eigenvalue.

0
On

Try and convince yourself $M=A*B*A'$. This is because of the repeated eigenvalue $(-1/2)$. Thus the eigenspace corresponding to this eigenvalue has a dimension of $2$. Thus it can have any two orthogonal vectors from that space as the basis. You found one of them, MATLAB found a different one.