1. What is the rank of matrix A?
\(\begin{bmatrix} 1 & 2 & 3 & 4\\ -1 & 0 & 1 & 3\\ 0 & 1 & -2 & 1\\ 5 & 4 & -2 & -3 \end{bmatrix}\)
First we want to put the matrix into its reduced row echelon form to see how many pivot columns or non - zero rows we have.
Steps to get RREF
Arref <- A
Arref[2,] = Arref[2,] + Arref[1,]
Arref[4,] = Arref[4,] - (5 * Arref[1,])
Arref[2,] = Arref[2,] / 2
Arref[1,] = Arref[1,] - (2 * Arref[2,])
Arref[3,] = Arref[3,] - Arref[2,]
Arref[4,] = (6 * Arref[2,]) + Arref[4,]
Arref[3,] = Arref[3,] / -4
Arref[1,] = Arref[1,] + Arref[3,]
Arref[2,] = Arref[2,] - (2 * Arref[3,])
Arref[4,] = (5 * Arref[3,]) + Arref[4,]
Arref[4,] = (8/9 * Arref[4,])
Arref[1,] = Arref[1,] + (19/8 * Arref[4,])
Arref[2,] = Arref[2,] + ((-1 * 4/9) * Arref[4,])
Arref[3,] = Arref[3,] - (5/8 * Arref[4,])
Since we have four pivot columns and all rows are non zero the rank of matrix A is 4. We could have also found the determinant of matrix A. For a square matrix, if the determinant is not 0 and thus invertible then the rank is the same as the dimensions of the matrix. The determinant of A is -9
2. Given an m x n matrix where m > n, what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?
In a rectangular matrix where the rows are greater than then columns, the maximum rank will be no greater than the columns \(n\) of the matrix. Assuming a non - zero matrix the minimum rank will be 1.
3. What is the rank of matrix B?
\(\begin{bmatrix} 1 & 2 & 1\\ 3 & 6 & 3\\ 2 & 4 & 2 \end{bmatrix}\)
B <- matrix(c(1,2,1,3,6,3,2,4,2), nrow = 3, byrow = T)
Using the det() function we can find that the determinant of matrix B is 0. Since the det(B) \(=\) 0, the rank of matrix B is equal to 1 as it only has one pivot column.
\(\begin{bmatrix} 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6 \end{bmatrix}\)
C <- matrix(c(1,2,3,0,4,5,0,0,6), nrow = 3, byrow = T)
C
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 0 4 5
## [3,] 0 0 6
\(\begin{bmatrix} \lambda & 0 & 0\\ 0 & \lambda & 0\\ 0 & 0 & \lambda \end{bmatrix} - \begin{bmatrix} 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6 \end{bmatrix} = \begin{bmatrix} \lambda - 1 & -2 & -3\\ 0 & \lambda - 4 & -5\\ 0 & 0 & \lambda - 6 \end{bmatrix}\)
\((\lambda - 1) * (\lambda - 4) * (\lambda - 6) + (-2 * -5 * 0) + (-3 * 0 * 0)\)
\(-\)
\((-2 * 0 * \lambda - 6) + (\lambda - 1 * -5 * 0) + (-3 * \lambda - 4 * 0)\)
Evaluates to:
\((\lambda - 1) * (\lambda - 4) * (\lambda - 6)\)
\(\lambda^3 - 11\lambda^2 + 34\lambda - 24 = 0\)
Our eigenvalues are:
eigen_result <- eigen(C)
eigen_result$values
## [1] 6 4 1
\(\begin{bmatrix} 6 & 0 & 0\\ 0 & 6 & 0\\ 0 & 0 & 6 \end{bmatrix} - \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}\)
Bring to RREF \(R_1 = R_1 / 5 = \begin{bmatrix} 1 & -2/5 & -3/5\\ 0 & 2 & -5\\ 0 & 0 & 0 \end{bmatrix}\)
\(R_2 = R_2 / 2 = \begin{bmatrix} 1 & -2/5 & -3/5\\ 0 & 1 & -5/2\\ 0 & 0 & 0 \end{bmatrix}\)
\(R_1 = 2/5R_2 + R_1 = \begin{bmatrix} 1 & 0 & -8/5\\ 0 & 1 & -5/2\\ 0 & 0 & 0 \end{bmatrix}\)
\(v_1 - 8/5v_3 = 0\) \(v_2 - 5/2v_3 = 0\) \(v_3 = t\)
\(E_\lambda = 6 = \begin{bmatrix} 8/5\\ 5/2\\ 1 \end{bmatrix}\)
We can check that using the formula \(\lambda * I_3 - matrix_C = \begin{bmatrix} 0\\ 0\\ 0 \end{bmatrix}\)
I <- matrix(c(1,0,0,0,1,0,0,0,1), nrow = 3, byrow = T)
v <- matrix(c((8/5),(5/2),1), nrow = 3, byrow = T)
((6 * I) - C) %*% v
## [,1]
## [1,] 0
## [2,] 0
## [3,] 0
\(\begin{bmatrix} 4 & 0 & 0\\ 0 & 4 & 0\\ 0 & 0 & 4 \end{bmatrix} - \begin{bmatrix} 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6 \end{bmatrix} = \begin{bmatrix} 3 & -2 & -3\\ 0 & 0 & -5\\ 0 & 0 & -2 \end{bmatrix}\)
Bring to RREF
\(R_1 = R_1 / 3 = \begin{bmatrix} 1 & -2/3 & -1\\ 0 & 0 & -5\\ 0 & 0 & -2 \end{bmatrix}\)
\(R_2 = R_2 / -5 = \begin{bmatrix} 1 & -2/3 & -1\\ 0 & 0 & 1\\ 0 & 0 & -2 \end{bmatrix}\)
\(R_1 = R_1 + R_2 = \begin{bmatrix} 1 & -2/3 & 0\\ 0 & 0 & 1\\ 0 & 0 & -2 \end{bmatrix}\)
\(R_3 = 2*R_2 + R_3 = \begin{bmatrix} 1 & -2/3 & 0\\ 0 & 0 & 1\\ 0 & 0 & 0 \end{bmatrix}\)
\(v_1 - 2/3v_2 = 0\) \(v_2 = t\) \(v_3 = 0\)
\(E_\lambda = 4 = \begin{bmatrix} 2/3\\ 1\\ 0 \end{bmatrix}\)
We can check that using the formula \(\lambda * I_3 - matrix_C = \begin{bmatrix} 0\\ 0\\ 0 \end{bmatrix}\)
I <- matrix(c(1,0,0,0,1,0,0,0,1), nrow = 3, byrow = T)
v_4 <- matrix(c((2/3),1,0), nrow = 3, byrow = T)
((4 * I) - C) %*% v_4
## [,1]
## [1,] 0
## [2,] 0
## [3,] 0
\(\begin{bmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{bmatrix} - \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}\)
Bring to RREF
\(R_1 = R_1 / -2 = \begin{bmatrix} 0 & 1 & 3/2\\ 0 & -3 & -5\\ 0 & 0 & -5 \end{bmatrix}\)
\(R_2 = 3*R_1 + R_2 = \begin{bmatrix} 0 & 1 & 3/2\\ 0 & 0 & -1/2\\ 0 & 0 & -5 \end{bmatrix}\)
\(R_2 = -2*R_2 = \begin{bmatrix} 0 & 1 & 3/2\\ 0 & 0 & 1\\ 0 & 0 & -5 \end{bmatrix}\)
\(R_1 = -3/2*R_2 + R_1 = \begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ 0 & 0 & -5 \end{bmatrix}\)
\(R_3 = 5*R_2 + R3 = \begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ 0 & 0 & 0 \end{bmatrix}\)
\(v_1 = t\) \(v_2 = 0\) \(v_3 = 0\)
\(E_\lambda = 4 = \begin{bmatrix} 1\\ 0\\ 0 \end{bmatrix}\)
We can check that using the formula \(\lambda * I_3 - matrix_C = \begin{bmatrix} 0\\ 0\\ 0 \end{bmatrix}\)
I <- matrix(c(1,0,0,0,1,0,0,0,1), nrow = 3, byrow = T)
v_1 <- matrix(c(1,0,0), nrow = 3, byrow = T)
((1 * I) - C) %*% v_1
## [,1]
## [1,] 0
## [2,] 0
## [3,] 0