Eigen values & eigen vectors of a 3 by 3..
Hello,
Suppose one has the matrix A:
[2 0 -1;
0 3 0;
-1 0 2]
i found eigenvalues: 1 & 3 using the ABC formula. For 1 im getting the eigenvectors:
q1=1/√(2) & q3=1/√(2) (q2 ending up equal to 0), for 3 im getting: q1=-1/√(2), q2=0, q3=-1/√(2).
Matlab gives me:
3 eigen values: 1, 3 & 3.
And the following, wich i believe are supposed to be the eigen vectors:
(>> [VA,DD]=eig(A) <---matlab command)
VA =
[-0.7071 -0.7071 0;
0 0 1.0000;
-0.7071 0.7071 0]
(1/√(2)=0.7071) it gives 3 eigen vectors with a - sign, while im getting 2 with a - sign.
-Why is matlab giving 3 eigen values? should a 3 by 3 matrix always have 3 eigenvalues?
-Why is the last eigen vector 0 1 0 according to matlab? What am i doing wrong?
I was only taught to compute eigen values/vectors of 2 by 2's.
Please help me out.
Kind regards,
Moljka
P.S. please forgive me for not displaying the matrices properly in this message.
Re: Eigen values & eigen vectors of a 3 by 3..
Quote:
Originally Posted by
moljka
Hello,
Suppose one has the matrix A:
[2 0 -1;
0 3 0;
-1 0 2]
i found eigenvalues: 1 & 3 using the ABC formula. For 1 im getting the eigenvectors:
q1=1/√(2) & q3=1/√(2) (q2 ending up equal to 0), for 3 im getting: q1=-1/√(2), q2=0, q3=-1/√(2).
Matlab gives me:
3 eigen values: 1, 3 & 3.
And the following, wich i believe are supposed to be the eigen vectors:
(>> [VA,DD]=eig(A) <---matlab command)
VA =
[-0.7071 -0.7071 0;
0 0 1.0000;
-0.7071 0.7071 0]
(1/√(2)=0.7071) it gives 3 eigen vectors with a - sign, while im getting 2 with a - sign.
-Why is matlab giving 3 eigen values? should a 3 by 3 matrix always have 3 eigenvalues?
-Why is the last eigen vector 0 1 0 according to matlab? What am i doing wrong?
I was only taught to compute eigen values/vectors of 2 by 2's.
Please help me out.
Kind regards,
Moljka
P.S. please forgive me for not displaying the matrices properly in this message.
You solve for the eigenvalues by solving
for
...
![\displaystyle \begin{align*} \mathbf{A} &= \left[\begin{matrix}\phantom{-}2&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3&\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2\end{matrix}\right] \\ \mathbf{A} - \lambda \mathbf{I} &= \left[\begin{matrix}\phantom{-}2 - \lambda&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3 - \lambda &\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2 - \lambda \end{matrix}\right] \\ \left|\mathbf{A} - \lambda \mathbf{I}\right| &= \left|\begin{matrix}\phantom{-}2 - \lambda&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3 - \lambda &\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2 - \lambda \end{matrix}\right| \\ &= (2 - \lambda)\left|\begin{matrix}3-\lambda & 0 \\ 0 & 2-\lambda\end{matrix}\right| - 0\left|\begin{matrix}\phantom{-}0&0\\-1&2-\lambda\end{matrix}\right| + (-1)\left|\begin{matrix}\phantom{-}0&3-\lambda\\ -1 & 0\end{matrix}\right| \\ &= (2-\lambda)(3-\lambda)(2-\lambda) - (3-\lambda) \\ &= (3 - \lambda)\left[(2 - \lambda)^2 - 1\right] \end{align*}](http://latex.codecogs.com/png.latex?\displaystyle \begin{align*} \mathbf{A} &= \left[\begin{matrix}\phantom{-}2&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3&\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2\end{matrix}\right] \\ \mathbf{A} - \lambda \mathbf{I} &= \left[\begin{matrix}\phantom{-}2 - \lambda&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3 - \lambda &\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2 - \lambda \end{matrix}\right] \\ \left|\mathbf{A} - \lambda \mathbf{I}\right| &= \left|\begin{matrix}\phantom{-}2 - \lambda&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3 - \lambda &\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2 - \lambda \end{matrix}\right| \\ &= (2 - \lambda)\left|\begin{matrix}3-\lambda & 0 \\ 0 & 2-\lambda\end{matrix}\right| - 0\left|\begin{matrix}\phantom{-}0&0\\-1&2-\lambda\end{matrix}\right| + (-1)\left|\begin{matrix}\phantom{-}0&3-\lambda\\ -1 & 0\end{matrix}\right| \\ &= (2-\lambda)(3-\lambda)(2-\lambda) - (3-\lambda) \\ &= (3 - \lambda)\left[(2 - \lambda)^2 - 1\right] \end{align*})
And since
, that means
![\displaystyle \begin{align*} (3 - \lambda)\left[(2 - \lambda)^2 - 1\right] &= 0 \\ 3 - \lambda = 0 \textrm{ or }(2 - \lambda)^2 - 1 &= 0 \\ \lambda = 3 \textrm{ or }(2 - \lambda)^2 &= 1 \\ \lambda = 3 \textrm{ or } 2 - \lambda &= \pm 1 \\ \lambda = 3 \textrm{ or }\lambda = 1 \textrm{ or }\lambda &= 3 \end{align*}](http://latex.codecogs.com/png.latex?\displaystyle \begin{align*} (3 - \lambda)\left[(2 - \lambda)^2 - 1\right] &= 0 \\ 3 - \lambda = 0 \textrm{ or }(2 - \lambda)^2 - 1 &= 0 \\ \lambda = 3 \textrm{ or }(2 - \lambda)^2 &= 1 \\ \lambda = 3 \textrm{ or } 2 - \lambda &= \pm 1 \\ \lambda = 3 \textrm{ or }\lambda = 1 \textrm{ or }\lambda &= 3 \end{align*})
So I agree with your eigenvalues, of course making note that
is a repeated eigenvalue.
Now for the eigenvectors, we need to solve
, where ![\displaystyle \mathbf{x} = \left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right]](http://latex.codecogs.com/png.latex?\displaystyle \mathbf{x} = \left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right])
Case 1: 
![\displaystyle \begin{align*}\mathbf{A}\mathbf{x} &= \lambda \mathbf{x} \\ \left[\begin{matrix}\phantom{-}2&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3&\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2\end{matrix}\right]\left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] &= 1 \left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] \\ \left[\begin{matrix}\phantom{-}2x_1&\phantom{-}0&-x_3\\ \phantom{-}0&\phantom{-}3x_2&\phantom{-}0\\-x_1&\phantom{-}0&\phantom{-}2x_3\end{matrix}\right] &= \left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] \end{align*}](http://latex.codecogs.com/png.latex?\displaystyle \begin{align*}\mathbf{A}\mathbf{x} &= \lambda \mathbf{x} \\ \left[\begin{matrix}\phantom{-}2&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3&\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2\end{matrix}\right]\left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] &= 1 \left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] \\ \left[\begin{matrix}\phantom{-}2x_1&\phantom{-}0&-x_3\\ \phantom{-}0&\phantom{-}3x_2&\phantom{-}0\\-x_1&\phantom{-}0&\phantom{-}2x_3\end{matrix}\right] &= \left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] \end{align*})
Row 1: 
Row 2: 
Row 3: 
So setting
we find that the corresponding eigenvector to the eigenvalue
is
, where you can let
be any value you like.
Case 2: 
![\displaystyle \begin{align*}\mathbf{A}\mathbf{x} &= \lambda \mathbf{x} \\ \left[\begin{matrix}\phantom{-}2&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3&\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2\end{matrix}\right]\left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] &= 3 \left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] \\ \left[\begin{matrix}\phantom{-}2x_1&\phantom{-}0&-x_3\\ \phantom{-}0&\phantom{-}3x_2&\phantom{-}0\\-x_1&\phantom{-}0&\phantom{-}2x_3\end{matrix}\right] &= \left[\begin{matrix}3x_1 \\ 3x_2 \\ 3x_3\end{matrix}\right] \end{align*}](http://latex.codecogs.com/png.latex?\displaystyle \begin{align*}\mathbf{A}\mathbf{x} &= \lambda \mathbf{x} \\ \left[\begin{matrix}\phantom{-}2&\phantom{-}0&-1\\ \phantom{-}0&\phantom{-}3&\phantom{-}0\\-1&\phantom{-}0&\phantom{-}2\end{matrix}\right]\left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] &= 3 \left[\begin{matrix}x_1 \\ x_2 \\ x_3\end{matrix}\right] \\ \left[\begin{matrix}\phantom{-}2x_1&\phantom{-}0&-x_3\\ \phantom{-}0&\phantom{-}3x_2&\phantom{-}0\\-x_1&\phantom{-}0&\phantom{-}2x_3\end{matrix}\right] &= \left[\begin{matrix}3x_1 \\ 3x_2 \\ 3x_3\end{matrix}\right] \end{align*})
Row 1: 
Row 2:
where
can be any value you like.
Row 3: 
So set
where
can be any value you like, and you find that the eigenvector corresponding to
is ![\displaystyle \left[\begin{matrix}-r \\ \phantom{-}s \\ \phantom{-}r\end{matrix}\right]](http://latex.codecogs.com/png.latex?\displaystyle \left[\begin{matrix}-r \\ \phantom{-}s \\ \phantom{-}r\end{matrix}\right])
It is common practice to have the same number of eigenvectors as eigenvalues, and to give a value to your parameters. This is what MatLab has done.
Re: Eigen values & eigen vectors of a 3 by 3..
Thank you for your help!
I see that i missed the (3-λ) part when solving |A-λI|=0 so i only had 3 eigen values. The - signs Matlab gives are different for some reason.
I must obtain a matrix Q consisting of the eigenvectors. Q must be orthogonal, satisfying: Q*Transpose(Q)=I. (A is symmetric)
Creating a matrix Q from the column vectors [t 0 t] , [-r 0 r] & Matlab's [0 1 0] gives a matrix Q:
t -r 0
0 0 1
t r 0
r & t are both: 1/√(2) (||q||=1 euclidean distance condition)
This satisfies Q=transpose(Q).
But it leaves me with 1 question, how was i supposed to obtain the last column (eigen?)vector [0 1 0]? Is there some rule that provides a fast solution?
Thank you for helping me out.
Regards,
Moljka
Re: Eigen values & eigen vectors of a 3 by 3..
we can write (-r,s,r) as r(-1,0,1) + s(0,1,0).
since (-1,0,1) and (0,1,0) are linearly independent, we are free to choose r and s ....independently (ha!).
since we desire an orthogonal matrix, we need r(-1,0,1) to be a unit vector, which is how you got r = 1/√2.
since (0,1,0) is already a unit vector, we can take s = 1.
Re: Eigen values & eigen vectors of a 3 by 3..
You "split" (-r s r) to obtain the 3rd column (0 1 0) of Q. Is (0 1 0) considered an eigenvector too? For instance, if i am asked to get the eigen vectors of A do i mention (0 1 0) in a case like this? or do i only mention it when im asked to get the matrix Q?
Thank you very much for helping me out.
Regards,
Moljka
Re: Eigen values & eigen vectors of a 3 by 3..
an eigenvalue may have more than one eigenvector. in this case both (-1/√2,0,1/√2) and (0,1,0) are eigenvectors corresponding to the (repeated) eigenvalue 3.
one of the reasons for finding eigenvectors is to find an eigenbasis, that is, an invertible matrix that diagonalizes your original one. as you need all three vectors to obtain this eigenbasis, you should list all 3.