\[\mathbf{A} = \left[\begin{array} {rrr} 1 & 2 & 3 & 4 \\ -1 & 0 & 1 & 3 \\ 0 & 1 & 2 & 1 \\ 5 & 4 & -2 & -3 \end{array}\right]\]
#Also, tried some Quick r functions (https://www.statmethods.net/advstats/matrix.html)
#QR decomposition of A.
# Finding the rank of A
A <- matrix(c(1,2,3,4,
-1,0,1,3,
0,1,-2,1,
5,4,-2,-3), 4, byrow=T)
print(A)
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4
## [2,] -1 0 1 3
## [3,] 0 1 -2 1
## [4,] 5 4 -2 -3
#rank of A
qr(A)$rank
## [1] 4
Also, using pracma library
library(pracma)
rref(A)
## [,1] [,2] [,3] [,4]
## [1,] 1 0 0 0
## [2,] 0 1 0 0
## [3,] 0 0 1 0
## [4,] 0 0 0 1
Rank(A)
## [1] 4
If m is grater than n, the maximum rank is n. Assuming that the matrix has at least one non-xero element, its minimum rank should be 1.
\[\mathbf{A} = \left[\begin{array} {rrr} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \end{array}\right]\]
B <- matrix(c(1,2,1,
3,6,3,
2,4,2), 3, byrow=T)
print(B)
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 3 6 3
## [3,] 2 4 2
#Ranks of B
qr(B)$rank
## [1] 1
Also, using pracma library
rref(B)
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 0 0 0
## [3,] 0 0 0
#Ranks of B
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.
\[\mathbf{A} = \left[\begin{array} {rrr} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{array}\right]\]
To determine the eigenvalues of \[\lambda \space\ of\space\ A \], we initially solve for the determinant of \[A-\lambda*I=0\]
\[(1-\lambda)[(4-\lambda)(6-\lambda)-5×0]+2[0×(6-\lambda)-5×0]+3[0×0-0(6-\lambda)]=0\]
The eigenvalues are: \[(\lambda-1)(\lambda-4)(\lambda-6)=0\]
A <- matrix(c(1,2,3,
0,4,5,
0,0,6), 3, byrow=T)
print(A)
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 0 4 5
## [3,] 0 0 6
eigen(A)$values
## [1] 6 4 1
charpoly(A)
## [1] 1 -11 34 -24