1. What is the rank of the matrix A? 1, -1, 0, 5, 2, 0, 1, 4, 3, 1, -2, -2, 4, 3, 1, 3

The Matix Rank is the number of non zero rows in the reduce row echelon of a Matrix

library(matlib)
A<- matrix(c(1,-1,0,5,2,0,1,4,3,1,-2,-2,4,3,1,3),4,4,byrow=FALSE)
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
echelon(A, reduce=FALSE)
##      [,1] [,2]      [,3]      [,4]
## [1,]    1  0.8 -0.400000 0.6000000
## [2,]    0  1.0  2.833333 2.8333333
## [3,]    0  0.0  1.000000 0.3793103
## [4,]    0  0.0  0.000000 1.0000000
A.rank<-R(A)

In this example the rank of matrix A is 4

  1. Given an mxn matrix where m > n, what can be the maximum rank? The mini- mum rank, assuming that the matrix is non-zero?

The Maximum rank for an mxn matrix number of linearly independent non-zero m columns in the matrix = n when n < m or = m when n > m. The minimum rank will be the min(m, n). If m<n min rank is m, if n<m min rank is n.

  1. What is the rank of matrix B? B = 1, 3, 2, 2, 6, 4, 1, 3, 2
A<- matrix(c(1,2,1,3,6,3,2,4,2),3,3,byrow=TRUE)
A
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    3    6    3
## [3,]    2    4    2
echelon(A, reduce=FALSE)
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    0    0    0
## [3,]    0    0    0
A.rank<-R(A)

In this example the rank of matrix A is 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 = 1, 0, 0, 2, 4, 0, 3, 5, 6

#The Matrix
A<- matrix(c(1,2,3,0,4,5,0,0,6),3,3,byrow=TRUE)
A
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    0    4    5
## [3,]    0    0    6

The eigen values of A are:

#Get eigen values and vectors

e<-eigen(A)
e.values<-e$value
e.values
## [1] 6 4 1

The eigen vectors of A are:

e.vectors<-e$vector
e.vectors
##           [,1]      [,2] [,3]
## [1,] 0.5108407 0.5547002    1
## [2,] 0.7981886 0.8320503    0
## [3,] 0.3192754 0.0000000    0

The polynomial equation derived from eigen values is:

-6\(\mathbf\lambda^3\) - (-4) \(\mathbf\lambda^2\) + (-1) \(\mathbf\lambda\) - 24

Testing Eigen values Null Space

#Create identity matrix 
B<-matrix(c(1,0,0,0,1,0,0,0,1),3,3,byrow=TRUE)
B
##      [,1] [,2] [,3]
## [1,]    1    0    0
## [2,]    0    1    0
## [3,]    0    0    1
#get determinate of  Identity matrix minus A 
(A[1,1]*(A[2,2]*A[3,3]))-(A[2,1]*(A[1,3]*A[3,3]))+(A[1,3]*(A[2,1]*A[3,2]))
## [1] 24
det(B-A)
## [1] 0
det(A)
## [1] 24
B-A
##      [,1] [,2] [,3]
## [1,]    0   -2   -3
## [2,]    0   -3   -5
## [3,]    0    0   -5
#Test eigen values

#Test first eigen value minus A
C1<-A
C1[1,1]<-e.values[1]-C1[1,1]
C1[2,2]<-e.values[1]-C1[2,2]
C1[3,3]<-e.values[1]-C1[3,3]
C1
##      [,1] [,2] [,3]
## [1,]    5    2    3
## [2,]    0    2    5
## [3,]    0    0    0
#Reduced row echelon of eigen vector
C1.e<-echelon(C1, reduced =FALSE)
C1.e
##      [,1] [,2] [,3]
## [1,]    1  0.4  0.6
## [2,]    0  1.0  2.5
## [3,]    0  0.0  0.0
#Eigen value minus vector A to confirm determinant equals 0
C1.v<-C1-A
C1.v
##      [,1] [,2] [,3]
## [1,]    4    0    0
## [2,]    0   -2    0
## [3,]    0    0   -6
#Test vector multiplied by eigen vector values

C1.v*C1.e - C1.v
##      [,1] [,2] [,3]
## [1,]    0    0    0
## [2,]    0    0    0
## [3,]    0    0    6
#Test second eigen value minus A
C2<-A
C2[1,1]<-e.values[2]-C2[1,1]
C2[2,2]<-e.values[2]-C2[2,2]
C2[3,3]<-e.values[2]-C2[3,3]
C2
##      [,1] [,2] [,3]
## [1,]    3    2    3
## [2,]    0    0    5
## [3,]    0    0   -2
#Reduced row echelon of eigen vector
C2.e<-echelon(C1, reduced =FALSE)
C2.e
##      [,1] [,2] [,3]
## [1,]    1  0.4  0.6
## [2,]    0  1.0  2.5
## [3,]    0  0.0  0.0
#Eigen value minus vector A to confirm determinant equals 0
C2.v<-C2-A
C2.v
##      [,1] [,2] [,3]
## [1,]    2    0    0
## [2,]    0   -4    0
## [3,]    0    0   -8
#Test vector multiplied by eigen vector values

C2.v*C2.e - C2.v
##      [,1] [,2] [,3]
## [1,]    0    0    0
## [2,]    0    0    0
## [3,]    0    0    8
#Test third eigen value minus A
C3<-A
C3[1,1]<-e.values[3]-C3[1,1]
C3[2,2]<-e.values[3]-C3[2,2]
C3[3,3]<-e.values[3]-C3[3,3]
C3
##      [,1] [,2] [,3]
## [1,]    0    2    3
## [2,]    0   -3    5
## [3,]    0    0   -5
#Reduced row echelon of eigen vector
C3.e<-echelon(C1, reduced =FALSE)
C3.e
##      [,1] [,2] [,3]
## [1,]    1  0.4  0.6
## [2,]    0  1.0  2.5
## [3,]    0  0.0  0.0
#Eigen value minus vector A to confirm determinant equals 0
C3.v<-C3-A
C3.v
##      [,1] [,2] [,3]
## [1,]   -1    0    0
## [2,]    0   -7    0
## [3,]    0    0  -11
#Test vector multiplied by eigen vector values

C3.v*C3.e - C3.v
##      [,1] [,2] [,3]
## [1,]    0    0    0
## [2,]    0    0    0
## [3,]    0    0   11