library(pracma)
## Warning: package 'pracma' was built under R version 4.3.2
I will show my method for Reduced Row Echelon Form and then double check my solution using the pracma Rank() function.
\[ A = \begin{bmatrix} 1 & 2 & 3 & 4\\ -1 & 0 & 1 & 3\\ 0 & 1 & -2 & 1\\ 5 & 4 & -2 & -3 \end{bmatrix} \]
\(R_{2}=R_{1}+R_{2}\)
\[ A = \begin{bmatrix} 1 & 2 & 3 & 4\\ 0 & 2 & 4 & 7\\ 0 & 1 & -2 & 1\\ 5 & 4 & -2 & -3 \end{bmatrix} \]
\(R_{4}=R_{4}-5R_{1}\)
\[ A = \begin{bmatrix} 1 & 2 & 3 & 4\\ 0 & 2 & 4 & 7\\ 0 & 1 & -2 & 1\\ 0 & -6 & -17 & -23 \end{bmatrix} \]
\(R_{3}=R_{3}-\frac{R_{2}}{2}\)
\[ A = \begin{bmatrix} 1 & 2 & 3 & 4\\ 0 & 2 & 4 & 7\\ 0 & 0 & -4 & \frac{5}{2}\\ 0 & 0 & -5 & -2 \end{bmatrix} \]
\(R_{4}=R_{4}-\frac{5R_{3}}{4}\)
\[ A = \begin{bmatrix} 1 & 2 & 3 & 4\\ 0 & 2 & 4 & 7\\ 0 & 0 & -4 & -\frac{5}{2}\\ 0 & 0 & 0 & \frac{9}{8} \end{bmatrix} \]
Looking at each row I can tell that there are four linearly independent rows \(p(A)=4\)
I can also check it using the Rank() function from the pracma package.
A = matrix(c(1,2,3,4,-1,0,1,3,0,1,-2,1,5,4,-2,-3), nrow = 4, byrow = T)
Rank(A)
## [1] 4
In a matrix where m>n the highest rank the matrix can have will be limited by n. If the rank of a matrix is determined by the number linearly independent rows or columns then the lowest of the two(m or n) will be the limiting factor.
If the matrix is non-zero, the lowest rank it can have is 1 (one row or column being independent).
\[ B = \begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \end{bmatrix} \]
\(R_{1}=R_{1}*3\)
\[ B = \begin{bmatrix} 3 & 6 & 3 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \end{bmatrix} \]
\(R_{2}=R_{2}-R_{1}\)
\[ B = \begin{bmatrix} 3 & 6 & 3 \\ 0 & 0 & 0 \\ 2 & 4 & 2 \end{bmatrix} \] \(R_{1}=R_{1}/3\)
Restoring R1 in a way, making the last few matrix operations easier.
\[ B = \begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 2 & 4 & 2 \end{bmatrix} \] \(R_{1}=R_{1}*2\) \[ B = \begin{bmatrix} 2 & 4 & 2 \\ 0 & 0 & 0 \\ 2 & 4 & 2 \end{bmatrix} \] Lastly \(R_{3}=R_{3}-R_{1}\) \[ B = \begin{bmatrix} 2 & 4 & 2 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} \] After resetting \(R_{1}\) row echelon form looks like:
\[ B = \begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} \]
As a result this matrix only has 1 linearly independent (non-zero) row. Making the Rank 1
\(p(B) = 1\)
B <- matrix(c(1,2,1,3,6,3,2,4,2), nrow = 3, byrow = T)
Rank(B)
## [1] 1
Compute the eigenvalues and eigenvectors of the matrix A. You’ll need to show your work. You’ll need to write out the characteristic polynomial and show your solution.
A <- matrix(c(1,2,3,0,4,5,0,0,6), nrow = 3, byrow = T)
##Eigenvalue of A
\[ A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} \] \[\text{det}(\lambda I - A) = 0\]
\[A - \lambda I = \begin{bmatrix} 1 - \lambda & -2 & -3\\ 0 & 4 - \lambda & -5\\ 0 & 0 & 6 - \lambda \end{bmatrix}\]
Since A is a triangular matrix the Eigenvalues are along the diagonal, allowing me to skip the full breakdown into the p(A)
\[\text{So here the eigenvalues are:} \lambda = 1, \lambda = 4, \lambda = 6\]
##Eigenvector of A
Solving when \(\lambda = 1\)
l1 <- matrix(c(0,-2,-3,0,3,-5,0,0,5), nrow = 3, byrow = T)
rref(l1)
## [,1] [,2] [,3]
## [1,] 0 1 0
## [2,] 0 0 1
## [3,] 0 0 0
With the row reduction of \(\lambda = 1\) the eigenvectors can be derived:
After solving
\(E_{\lambda = 1}\) = \(\begin{bmatrix} 1 \\ 0\\0\end{bmatrix}\)
Now I will solve for when \(\lambda = 4\)
l2 <- matrix(c(-3,-2,-3,0,0,-5,0,0,-2), nrow = 3, byrow = T)
rref(l2)
## [,1] [,2] [,3]
## [1,] 1 0.6666667 0
## [2,] 0 0.0000000 1
## [3,] 0 0.0000000 0
With the row reduction of \(\lambda = 4\) the eigenvectors can be derived:
After solving
\(E_{\lambda = 4}\) = \(\begin{bmatrix} 0.55 \\ 0.83\\0\end{bmatrix}\)
Solving when \(\lambda = 6\)
l3 <- matrix(c(5,-2,-3,0,2,-5,0,0,0), nrow = 3, byrow = T)
rref(l3)
## [,1] [,2] [,3]
## [1,] 1 0 -1.6
## [2,] 0 1 -2.5
## [3,] 0 0 0.0
With the row reduction of \(\lambda = 6\) the eigenvectors can be derived:
After solving
\(E_{\lambda = 6}\) = \(\begin{bmatrix} 0.51 \\ 0.798\\ 0.319\end{bmatrix}\)
These eigenvectors can be checked with the eigen function.
A <- matrix(c(1,2,3,0,4,5,0,0,6), nrow=3, byrow = T)
egv <- eigen(A)
egv
## eigen() decomposition
## $values
## [1] 6 4 1
##
## $vectors
## [,1] [,2] [,3]
## [1,] 0.5108407 0.5547002 1
## [2,] 0.7981886 0.8320503 0
## [3,] 0.3192754 0.0000000 0