What is the rank of matrix A, such that \[ A = \begin{bmatrix} 1 & 2 & 3 & 4 \\ -1 & 0 & 1 & 3 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \end{bmatrix} \]
We know that this 4 x 4 matrix, can have, at most 4 linearly independent vectors. To determine how many linearly independent vectors there are, we find the row-reduced elchelon form using Gaussian Elimination. We can do this quite easily in R, using the rref() function from the pracma library.
#install.packages('pracma')
A <- matrix(c(1,2,3,4,-1,0,1,3,0,1,-2,1,5,4,-2,-3),ncol=4,nrow=4)
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
As we can see from the output, that even with row-reduction, we cannot eliminate 1 term from each column or row. Therefore, these vectors a linearly independent and the rank is 4.
The maximum rank for an \(m \times n\) where \(n < m\) is \(n\) and the minimum rank is 1 if the matrix is non-zero.
#install.packages('pracma')
A <- matrix(c(1,2,1,3,6,3,2,4,2),ncol=3,nrow=3)
library('pracma')
rref(A)
## [,1] [,2] [,3]
## [1,] 1 3 2
## [2,] 0 0 0
## [3,] 0 0 0
Although we can see it upon inspection, R makes it obvious that there is only 1 linearly independent vector in this matrix.
Let \[ A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} \] Eigenvalues of the numbers that hold a special property for a given matrix such that \[ Ax = \lambda x \] Where \(\lambda\) is a diagonal matrix and \(I\) is the identity matrix such that \[(A-\lambda I)x =0\] and \[\det \mid A-\lambda I\mid = 0\] which gives us \[ A -\lambda I = \begin{bmatrix} \lambda-1 & 2 & 3 \\ 0 & \lambda-4 & 5 \\ 0 & 0 & \lambda-6 \end{bmatrix} \] Therefore \[ \det \mid A -\lambda I\mid = \det \begin{bmatrix} \lambda-1 & 2 & 3 \\ 0 & \lambda-4 & 5 \\ 0 & 0 & \lambda-6 \end{bmatrix} \] or \[ \det \mid A -\lambda I\mid = \lambda-1 \cdot \det \begin{bmatrix} \lambda -4 & 5 \\ 0 & \lambda - 6 \end{bmatrix} - 3 \cdot \det \begin{bmatrix} 0 & 5 \\ 0 & \lambda - 6 \end{bmatrix} + 3 \cdot \det \begin{bmatrix} 0 & \lambda -4 \\ 0 & 0 \end{bmatrix} \] Which is the same as \[ \det \mid A -\lambda I\mid = \lambda-1 \cdot \det \begin{bmatrix} \lambda -4 & 5 \\ 0 & \lambda - 6 \end{bmatrix} \] or \[ \det \mid A -\lambda I\mid = (\lambda-1) \cdot (\lambda - 4) \cdot (\lambda-6) = 0 \] Which tells us that \[ \lambda_1 = 1, \lambda_2 = 4, \lambda_3 = 6 \]
We can confirm this easily using the R packages from above
A <- matrix(c(1,2,3,0,4,5,0,0,6),nrow=3,ncol=3)
eig(A)
## [1] 6 4 1