Problem from chapter vector spaces
C35??? Find the rank and nullity of the matrix A = [{1,1,2,-1,1} {0,2,1,0,1} {1,2,1,1,2}]
library(pracma) #using library pracma to use rank and nullpsace function## Warning: package 'pracma' was built under R version 3.4.3
Using Rank function - Provides an estimate of the number of linearly independent rows or columns of a matrix M Using nullspace - The kernel (aka null space/nullspace) of a matrix M is the set of all vectors x for which Ax=0
A <- matrix(c(1,1,2,-1,1,0,2,1,0,1,1,2,1,1,2),nrow = 5,ncol = 3)
A## [,1] [,2] [,3]
## [1,] 1 0 1
## [2,] 1 2 2
## [3,] 2 1 1
## [4,] -1 0 1
## [5,] 1 1 2
Rank(A)## [1] 3
nullspace(A)## NULL
paste0("Rank of matrix is", Rank(A))## [1] "Rank of matrix is3"
paste0("Nullity of matrix is", nullspace(A))## [1] "Nullity of matrix is"
Since nullity says null it means nullity is 0.