Problem 1

1) What is the rank of the matrix A?

library("matlib")
# Defining matrix
(A<- matrix(c(1,-1,0,5,2,0,1,4,3,1,-2,-2,4,3,1,-3), 4,4, byrow = F))
##      [,1] [,2] [,3] [,4]
## [1,]    1    2    3    4
## [2,]   -1    0    1    3
## [3,]    0    1   -2    1
## [4,]    5    4   -2   -3
# Check  for determinent  
(det(A)) != 0
## [1] TRUE
# Finding rank
(rank_A<- R(A))
## [1] 4

2)Given an mxn matrix where m > n, what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?

Rank for mxn matrix:

1) Maxmimum rank will be less than or equal to n(R<=n).

2) Minimum rank will be greater than or equal to 1(R>=1).

3)What is the rank of matrix B?

library(pracma)
## 
## Attaching package: 'pracma'
## The following objects are masked from 'package:matlib':
## 
##     angle, inv
# Defining matrix
(B <- matrix(c(1,2,1,3,6,3,2,4,2), 3,3, byrow = T))
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    3    6    3
## [3,]    2    4    2
# Check  for determinent 
(det(B)== 0)
## [1] TRUE
#Finding rank of sub matrix
qr(B)
## $qr
##            [,1]      [,2]      [,3]
## [1,] -3.7416574 -7.483315 -3.741657
## [2,]  0.8017837  0.000000  0.000000
## [3,]  0.5345225  0.000000  0.000000
## 
## $rank
## [1] 1
## 
## $qraux
## [1] 1.267261 0.000000 0.000000
## 
## $pivot
## [1] 1 2 3
## 
## attr(,"class")
## [1] "qr"

Since det of matrix B is ZERO,the det of sub matrix is also ZERO. hence rank is 1.

Problem-2

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. Please show your work using an R-markdown document

library(pracma)
#Defining matrix
(A <- matrix(c(1,0,0,2,4,0,3,5,6), 3,3,byrow = F))
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    0    4    5
## [3,]    0    0    6
#characteristic polynomial
charpoly(A)
## [1]   1 -11  34 -24
#eigen values and vectors
(eigen_A<- eigen(A))
## 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