A <- matrix(c(1,2,3,4,
-1,0,1,3,
0,1,-2,1,
5,4,-2,-3), 4, byrow=T)
qr(A)$rank
## [1] 4
B <- matrix(c(1,2,1,
3,6,3,
2,4,2), 3, byrow=T)
qr(B)$rank
## [1] 1
A <- matrix(c(1,2,3,
0,4,5,
0,0,6), 3, byrow=T)
Step by step approach
we will compute the characteristic polynomial of \(A\). The characteristic polynomial of a matrix \(A\) is given by \(\det(A - \lambda I)\), where \(\lambda\) represents an eigenvalue and \(I\) is the identity matrix of the same size as \(A\)
\({det}\left(A-\lambda \,I\right)\,=\,0\)
\({det}\left(\begin{bmatrix}1&2&3\\0&4&5\\0&0&6\end{bmatrix} - \begin{bmatrix}\lambda&0&0\\0&\lambda&0\\0&0&\lambda\end{bmatrix}\right)=0\)
\({det}\left(\begin{bmatrix}1-\lambda &2&3\\0&4-\lambda &5\\0&0&6-\lambda \end{bmatrix}\right)=0\)
Since this is an upper triangular matrix, the determinant is the product of the diagonal elements:
\[ \det(A - \lambda I) = (1-\lambda)(4-\lambda)(6-\lambda) \] The diagonal elements lead to the characteristic polynomial \(p(\lambda)\) which is defined as
\[ p(\lambda) = (1-\lambda)(4-\lambda)(6-\lambda) \]
Expanding this polynomial would result in a cubic equation in terms of \(\lambda\). Characteristic Polynomial: \(-\lambda^3 + 11\lambda^2 - 34\lambda + 24=0\)
Now, we need to solve this equation for \(\lambda\) to find the eigenvalues:
\[ (1-\lambda)(4-\lambda)(6-\lambda) = 0 \]
For \(\lambda_1 = 6\), we found the corresponding eigenvector by solving \((A - 6I)x = 0\). The solution led us to:
So, the eigenvector corresponding to \(\lambda_1 = 6\) can be expressed as a multiple of:
\[ \begin{bmatrix} \frac{8}{5} \\ \frac{5}{2} \\ 1 \end{bmatrix} \]
For \(\lambda_2 = 4\), after solving \((A - 4I)x = 0\), we deduced:
Thus, the eigenvector for \(\lambda_2 = 4\) is a multiple of:
\[ \begin{bmatrix} \frac{2}{3} \\ 1 \\ 0 \end{bmatrix} \]
Finally, for \(\lambda_3 = 1\), solving \((A - I)x = 0\) gave us:
Therefore, the eigenvector associated with \(\lambda_3 = 1\) is a multiple of:
\[ \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \]
In summary, the eigenvectors corresponding to the eigenvalues \(\lambda_1 = 6\), \(\lambda_2 = 4\), and \(\lambda_3 = 1\) of matrix \(A\) are proportional to \(\begin{bmatrix} \frac{8}{5} \\ \frac{5}{2} \\ 1 \end{bmatrix}\), \(\begin{bmatrix} \frac{2}{3} \\ 1 \\ 0 \end{bmatrix}\),\(\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}\), respectively.
eigen()
FunctionWe’ll compare our manually calculated eigenvectors with those
obtained from R’s eigen() function to confirm their
correctness.
For \(\lambda_1 = 6\): The original non-normalized vector we found was \(\begin{bmatrix} \frac{8}{5} \\ \frac{5}{2} \\ 1 \end{bmatrix}\). If we normalize this, we should expect the components to have the same ratio as the R output. The ratios of \(\frac{8}{5} : \frac{5}{2} : 1\) simplify to \(1.6 : 2.5 : 1\). The R output ratios are approximately \(0.51 : 0.80 : 0.32\), which, when scaled to match the last component, give \(1.6 : 2.5 : 1\), matching our original vector.
For \(\lambda_2 = 4\): The vector we calculated was \(\begin{bmatrix} \frac{2}{3} \\ 1 \\ 0 \end{bmatrix}\). The R output \(\begin{bmatrix} 0.5547002 \\ 0.8320503 \\ 0 \end{bmatrix}\) has the component ratio \(\frac{0.5547002}{0.8320503} \approx \frac{2}{3}\), which matches our calculation.
For \(\lambda_3 = 1\): Both our calculation and R’s output provide the vector \(\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}\), so they match perfectly.
eigen() Functionprint(eigen(A)$values)
## [1] 6 4 1
print(eigen(A)$vectors)
## [,1] [,2] [,3]
## [1,] 0.5108407 0.5547002 1
## [2,] 0.7981886 0.8320503 0
## [3,] 0.3192754 0.0000000 0