\[ A = \begin{bmatrix} 1 & 2 & 3 & 4 \\ -1 & 0 & 1 & 3 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \end{bmatrix} \]
Using row reduction: the rank is the number of non-zero rows after row reduction performed.
rankMatrix(A)
## [1] 4
## attr(,"method")
## [1] "tolNorm2"
## attr(,"useGrad")
## [1] FALSE
## attr(,"tol")
## [1] 8.881784e-16
Using row reduction: the rank is the number of non-zero rows after row reduction performed. Rank matrix A = 4
The maximum rank can be equal or less than n (minimum of m and n), while the minimum rank for non-zero matrix is 1.
B <- matrix(c(1,3,2,2,6,4,1,3,2), ncol = 3, nrow = 3)
B
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 3 6 3
## [3,] 2 4 2
rankMatrix(B)
## [1] 1
## attr(,"method")
## [1] "tolNorm2"
## attr(,"useGrad")
## [1] FALSE
## attr(,"tol")
## [1] 6.661338e-16
Rank matrix B = 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.
\[ C = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} \]
\[ det ( \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} - \begin{bmatrix} λ & 0 & 0 \\ 0 & λ & 0 \\ 0 & 0 & λ \end{bmatrix} ) = 0 \]
\[ det ( \begin{bmatrix} 1-λ & 2 & 3 \\ 0 & 4-λ & 5 \\ 0 & 0 & 6-λ \end{bmatrix} ) = 0 \]
(1-λ)(4-λ)(6-λ) = 0
(1-λ)(24 - 10λ + λ2) = 0
λ3 - 11λ2 +34λ - 24 = 0
Eigenvalues:
λ1 = 6
λ2 = 1
λ3 = 4
Eigenvectors:
\[ det ( \begin{bmatrix} 1-λ & 2 & 3 \\ 0 & 4-λ & 5 \\ 0 & 0 & 6-λ \end{bmatrix} ) = \begin{bmatrix} -5 & 2 & 3 \\ 0 & -2 & 5 \\ 0 & 0 & 0 \end{bmatrix} = 0 \]
v = (1, 1.6, 2.5)
1.6/sqrt((1.6)^2+(2.5)^2+(1)^2)
## [1] 0.5108407
2.5/sqrt((1.6)^2+(2.5)^2+(1)^2)
## [1] 0.7981886
1/sqrt((1.6)^2+(2.5)^2+(1)^2)
## [1] 0.3192754
\[ det ( \begin{bmatrix} 1-λ & 2 & 3 \\ 0 & 4-λ & 5 \\ 0 & 0 & 6-λ \end{bmatrix} ) = \begin{bmatrix} 0 & 2 & 3 \\ 0 & 3 & 5 \\ 0 & 0 & 5 \end{bmatrix} = 0 \]
v = (0, 0, 1)
1/sqrt(1^2)
## [1] 1
0/sqrt(1^2)
## [1] 0
0/sqrt(1^2)
## [1] 0
\[ det ( \begin{bmatrix} 1-λ & 2 & 3 \\ 0 & 4-λ & 5 \\ 0 & 0 & 6-λ \end{bmatrix} ) = \begin{bmatrix} -3 & 2 & 3 \\ 0 & 8 & 5 \\ 0 & 0 & 10 \end{bmatrix} = 0 \]
v = (0, 2/3, 1)
1/sqrt((1)^2+(2/3)^2)
## [1] 0.8320503
2/3/sqrt((1)^2+(2/3)^2)
## [1] 0.5547002
0/sqrt((1)^2+(2/3)^2)
## [1] 0
Checking results (eigenvalues and eigenvectors) with eigen().
C <- matrix(c(1, 0, 0, 2, 4, 0, 3, 5, 6), 3, 3)
eigen(C)
## 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