A = 1 2 3 4 −1 0 1 3 0 1 −2 1 5 4 −2 −3
#use matrix function, list values per row, top to bottom, and you specify the number of rows to build matrix in R
A <- matrix(c(1, 2, 3, 4, -1, 0, 1, 3, 0, 1, -2, 1, 5, 4, -2, -3), nrow = 4)
rankMatrix(A)
## [1] 4
## attr(,"method")
## [1] "tolNorm2"
## attr(,"useGrad")
## [1] FALSE
## attr(,"tol")
## [1] 8.881784e-16
To determine rank manually I need to get it to reduced row echelon form and then count the number of non zero rows in REF.
\[\begin{bmatrix} 1 & 2 & 3 & 4 \\ -1 & 0 & 1 & 3 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \\ \end{bmatrix}\]I was unable to use latex to create the matrix and reduce it manually in an visually appealing way, so I will just explain the steps/ key reminders: if there are any non zero rows, they are at the bottom; an example to create a 0 under the first 1, we need to eliminate the -1 (row 2 column 1), and so on.
For context, m is rows, and n is column, so the question is saying there are more rows than columns. The maximum rank is n, the number of columns due to linear independence. The minimum rank of a non zero matrix is always 1 since at least one element is not equal to 0, which can be used to build a row/ column that’s unique.
The Rank is one. Manually, multiply the first row by -2 and add it to 3rd row to get zeros in the last row ( now: matrix(c(1, 2, 1, 3, 6, 3, 0, 0, 0), nrow = 3)); then multiply the first row by -3 and add it to 2nd row to get zeros in middle row which would reduce the matrix to matrix(c(1, 2, 1, 0,0,0, 0, 0, 0), nrow = 3)); since there is only one non zero row, the rank is one.
B <- matrix(c(1, 2, 1, 3, 6, 3, 2, 4, 2), nrow = 3)
rankMatrix(B)
## [1] 1
## attr(,"method")
## [1] "tolNorm2"
## attr(,"useGrad")
## [1] FALSE
## attr(,"tol")
## [1] 6.661338e-16
You’ll need to show your work. You’ll need to write out the characteristic polynomial (CP) and show your solution. A2 = 1 2 3 0 4 5 0 0 6
A2 <- matrix(c(1, 0, 0, 2, 4, 0, 3, 5, 6), nrow = 3 )
eigen_A2 <- eigen(A2)
eigen_A2$values
## [1] 6 4 1
Context: CP is defined as |A - λI|, where λ is a scalar and I is the identity matrix.
A. subtract λ from the diagonal elements 1-λ 2 3 0 4-λ 5 0 0 6-λ
B. calculate the determinant of this matrix by taking the product of the diagonal (1-λ)(4-λ)(6-λ)
C. Rewrite & solve for lmabda making the equation equal to 0 (λ−1)(λ−4)(λ−6)=0 (λ−1)= 0; λ=1 (λ−4)= 0; λ=4 (λ−6)= 0; λ=6, as the code above confirms. It can also be expanded to (λ^2 - 10λ + 24) (1-λ)=0, which gives the same values after solving it.
To find eigenvectors plug in all 3 values of lambda and find the reduced echelon form for each new matrix; after reducing each λ matrix we need to find the null space.
#λ=1
λ_1<- matrix(c(0, 0, 0, 2, -3, 0, 3, 5, -5), nrow = 3)
λ_1
## [,1] [,2] [,3]
## [1,] 0 2 3
## [2,] 0 -3 5
## [3,] 0 0 -5
2y+3z=0 -3y+5z=0 -5z=0 x=1,y=z=0 Eigenvector: [1 , 1 , 0] top to bottom
#λ=4
λ_4<- matrix(c(-3, 0, 0, 2, 0, 0, 3, 5, 2), nrow = 3)
λ_4
## [,1] [,2] [,3]
## [1,] -3 2 3
## [2,] 0 0 5
## [3,] 0 0 2
−3x+2y+3z=0 5z=0 2z=0 x=2/3,y=1,z=0 Eigenvector:[2/3, 1, 0]
#λ=6
λ_6<- matrix(c(-5, 0, 0, 2, -2, 0, 3, 5, 0), nrow = 3)
λ_6
## [,1] [,2] [,3]
## [1,] -5 2 3
## [2,] 0 -2 5
## [3,] 0 0 0
−5x+2y+3z=0 −2y+5z=0 x=8/5,y=5/2,z=1 Eigenvector: [8/5, 5/2, 1]
eigenvectors <- eigen_A2$vectors
print(eigenvectors)
## [,1] [,2] [,3]
## [1,] 0.5108407 0.5547002 1
## [2,] 0.7981886 0.8320503 0
## [3,] 0.3192754 0.0000000 0