Find the rank of the folowing matrix.
A <- matrix(c(1,2,3,4,-1,0,1,3,0,1,-2, 1, 5,4,-2,-3), byrow = TRUE, ncol = 4)
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
A1 <- A; A1[2,] <- A[3,]; A1[3,] <- A[2,]
A1
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4
## [2,] 0 1 -2 1
## [3,] -1 0 1 3
## [4,] 5 4 -2 -3
A2 <- A1; A2[3,] <- A1[3,] + A1[1,]
A2
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4
## [2,] 0 1 -2 1
## [3,] 0 2 4 7
## [4,] 5 4 -2 -3
A3 <- A2; A3[4,] <- A2[4,] -5 * A2[1]
A3
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4
## [2,] 0 1 -2 1
## [3,] 0 2 4 7
## [4,] 0 -1 -7 -8
A4 <- A3; A4[3,] <- A3[3,] - 2 * A3[2,]
A4
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4
## [2,] 0 1 -2 1
## [3,] 0 0 8 5
## [4,] 0 -1 -7 -8
A5 <- A4; A5[4,] <- A4[4,] + A4[2,]
A5
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4
## [2,] 0 1 -2 1
## [3,] 0 0 8 5
## [4,] 0 0 -9 -7
A6 <- A5; A6[4,] <- A5[4,] + 9/8 * A5[3,]
A6
## [,1] [,2] [,3] [,4]
## [1,] 1 2 3 4.000
## [2,] 0 1 -2 1.000
## [3,] 0 0 8 5.000
## [4,] 0 0 0 -1.375
Since the the number of non linearly dependant rows of A is 4, the rank is 4. # 2 (2) Given an mxn matrix where m > n, what can be the maximum rank? The mini- mum rank, assuming that the matrix is non-zero?
A matrix’s rank is given by the number of linearly independant rows that it contains. Thus, the max rank of an nxn matrix is n.
If the matrix is not square, it can have rank of min(n,m) becase a wide (n < m) matrix will have n < m rows which can be independant, thus limiting the rank. If a matrix is long, (n > m) it will have have rows that cancel to zero or be indeterminate.
Find the rank of C
\[ C = \begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2&4&2 \end{bmatrix} \]
C <- matrix(c(1,2,1,3,6,3,2,4,2), nrow = 3, byrow = TRUE)
C
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 3 6 3
## [3,] 2 4 2
C1 <- C; C1[2,] <- C[2,] - 3 * C[1,]
C1
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 0 0 0
## [3,] 2 4 2
C2 <- C1; C2[3,] <- C1[3,] - 2*C1[1,]
C2
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 0 0 0
## [3,] 0 0 0
Since there is only one linearly non-dependant row, the rank is 1.
Find the eigenvectors and values of A
\[ A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} \\ \\ eigen = det(A - \lambda I) = 0 \\ \\ eigen = det \Bigg( \begin{bmatrix} 1-\lambda & 2 & 3 \\ 0 & 4 - \lambda & 5 \\ 0 & 0 & 6 - \lambda \end{bmatrix} \Bigg) \]
Since the determinant of a square matrix is given by it’s
$$ eigen = det ( \[\begin{bmatrix} 1-\lambda & 2 & 3 \\ 0 & 4 - \lambda & 5 \\ 0 & 0 & 6 - \lambda \end{bmatrix}\])
\ (1-)(4 - )(6 - ) \
$$
We can see taht the values for lambda are 1, 4, 6.
A <- matrix(c(1, 2, 3, 0, 4, 5, 0, 0, 6), byrow = T, nrow = 3)
I <- diag(3)
I
## [,1] [,2] [,3]
## [1,] 1 0 0
## [2,] 0 1 0
## [3,] 0 0 1
A
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 0 4 5
## [3,] 0 0 6
temp <- A - 4 * I # for lambda = 4
temp
## [,1] [,2] [,3]
## [1,] -3 2 3
## [2,] 0 0 5
## [3,] 0 0 2
\[ \begin{bmatrix} 1-4 & 2 & 3 \\ 0 & 4 - 4 & 5 \\ 0 & 0 & 6 - 4 \end{bmatrix} = \begin{bmatrix} -3 & 2 & 3 \\ 0 & 0 & 5 \\ 0 & 0 & 2 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \] For \(\lambda = 4\) We then solve the matrix: