require(Matrix)
## Loading required package: Matrix
A <- matrix(c(1,2,3,4,-1,0,1,3,0,1,-2,1,5,4,-2,-3), ncol = 4,byrow = T)
rankMatrix(A)
## [1] 4
## attr(,"method")
## [1] "tolNorm2"
## attr(,"useGrad")
## [1] FALSE
## attr(,"tol")
## [1] 8.881784e-16
#the rank of A is 4
B <- matrix(c(1, 2, 1, 3, 6, 3, 2, 4, 2), ncol = 3, byrow = T)
rankMatrix(B)
## [1] 1
## attr(,"method")
## [1] "tolNorm2"
## attr(,"useGrad")
## [1] FALSE
## attr(,"tol")
## [1] 6.661338e-16
#the rank of matrix B is 1
Compute the eigenvalues and eigenvector of the matrix A. You’ll need to show your work. You’ll need to write out the characteristic polynomial and show your solution. Please show your work using an R-markdown document. Please name your assignment submission with your first initial and last name. + From equation \(det(A- \lambda I) = 0\), we can say that is an eignenvalue of \(A\) iff \(det(\lambda I_n - A) = 0\) +I have never used LaText prior to this I had a lot of learning to do in regards to formating and entering the formula’s correctly. I was lucky to find this tutorial that was helpful. (https://math-linux.com/latex-26/faq/latex-faq/article/how-to-write-matrices-in-latex-matrix-pmatrix-bmatrix-vmatrix-vmatrix)
\[ A = \begin{bmatrix} 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6\\ \end{bmatrix} \] \[ \lambda\, I_3 = \begin{bmatrix} \lambda & 0 & 0\\ 0 & \lambda & 0\\ 0 & 0 & \lambda\\ \end{bmatrix} \] \[ det(A- \lambda\,I_n)=0 \]
\[ \lambda\, I_3 - A = \begin{bmatrix} \lambda & 0 & 0\\ 0 & \lambda & 0\\ 0 & 0 & \lambda\\ \end{bmatrix} - \begin{bmatrix} 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6\\ \end{bmatrix} = det\,\begin{bmatrix}1-\lambda & 2 & 3 \\0 & 4-\lambda & 5 \\0 & 0 & 6-\lambda \end{bmatrix} = 0 \]
\[ (\lambda - 1) * det \begin{bmatrix} \lambda - 4 & -5 \\ 0 & \lambda - 6 \end{bmatrix} - (-2) * det \begin{bmatrix} 0 & -5 \\ 0 & \lambda - 6 \end{bmatrix} + (-3) * det \begin{bmatrix} 0 & \lambda - 4 \\ 0 & 0 \end{bmatrix} = 0 \]
\[ (\lambda - 1)((\lambda - 4)(\lambda - 6) - 0) + 2(0 - 0) - 3(0 - 0) = 0 \]
From the above we get our characteristic polynomial.
\[ \lambda^3 - 11\lambda^2 + 34\lambda - 24 = (\lambda - 1)(\lambda - 4)(\lambda - 6) = 0 \]
From the factors, we have the values needed.
\[ The\,Eigenvalues\,of\,A\,are:\] \[\lambda=1,\, \lambda=4,\, \lambda=6 \]
Now that we have our eigenvalues, we will use them to get our eigenvectors, starting with when = 1.
\[ \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} - \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} = \begin{bmatrix} 0 & 2 & 3 \\ 0 & 3 & 5 \\ 0 & 0 & 5 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} \]
Looking at the last equation of this system, we see that \[5*v_3 = 0\],telling us that \[v_3 = 0\]. Back-substituting, we get \[3*v_2 +5*0 = 0 \].Solving this, we see that \[v_2 = 0\]. Our last variable to solve for is \[v_3\]. When we plug in \[v_2\] and \[v_3\], we see that \[v_1\] = 0. When \[\lambda = 1\], \[v = \begin{pmatrix}1\\0\\0 \end{pmatrix}\].
When \[\lambda = 4\]:
\[ \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} - \begin{bmatrix} 4 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 4 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} = \begin{bmatrix} -3 & 2 & 3 \\ 0 & 0 & 5 \\ 0 & 0 & 2 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} \]
Looking at the last equation of our second system, we see that \[2*v_3 = 0\],telling us that \[v_3 = 0\]. Plugging into the second equation is not helpful at this point so we will look at the first two together. Plugging \[v_3\] in the first equation gives us \[ -3v_1 + 2v_2 + 3(0) = -3v_1 + 2v_2 = 0 \]
We see that \[v_1 = 2, v_3 = 3\]. So when \[\lambda = 4\], \[v = \begin{pmatrix}2\\3\\0 \end{pmatrix}\].
Lastly, we will compute the eigenvector for when \[\lambda = 6\].
\[ \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} - \begin{bmatrix} 6 & 0 & 0 \\ 0 & 6 & 0 \\ 0 & 0 & 6 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} = \begin{bmatrix} -5 & 2 & 3 \\ 0 & -2 & 5 \\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} \]
Our last row yields all zeros so we will be working only with the first two.
\[ -5v_1 + 2v_2 + 3v_3 = 0 \] \[ -2v_2 + 5v_3 = 0 \]
We add the two equations together and substitute for equation 1
\[ -5v_1 + 3v_3 = 0 \] \[ -2v_2 + 5v_3 = 0 \]
\[ v_1 = 5/3v_3 \] \[v_2 = 5/2v_3 \]
When \[\lambda = 6\], \[v = \begin{pmatrix}5/3\\5/2\\1 \end{pmatrix}\].
For the next assignment, I will be working on formatting my results for a cleaner appearance.