What is the rank of the matrix A? \[\begin{equation*} A = \mathbf{}\left[\begin{matrix} 1 & 2 & 3 & 4\\ -1 & 0 & 1 & 3\\ 0 & 1 & -2 & 1\\ 5 & 4 & -2 & -3 \end{matrix}\right] \end{equation*}\]
The rank is 4 because there are 4 non-zero rows in the row reduced echelon form.
A <- matrix(c(1,2,3,4,-1,0,1,3,0,1,-2,1,5,4,-2,-3),nrow=4,byrow= TRUE)
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
rref(A)
## [,1] [,2] [,3] [,4]
## [1,] 1 0 0 0
## [2,] 0 1 0 0
## [3,] 0 0 1 0
## [4,] 0 0 0 1
Given an mxn matrix where m > n, what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?
The maximum rank could be m. The minimum rank could be 1 since we’re assuming the matrix is non-zero.
What is the rank of matrix B? \[\begin{equation*}B = \mathbf{}\left[\begin{matrix} 1 & 2 & 1\\ 3 & 6 & 3\\ 2 & 4 & 2\\ \end{matrix}\right] \end{equation*}\]
The rank is 1 because there is 1 non-zero row in row reduced echelon form.
You can see that row 3 is a scalar multiple of row 1 (2*R1 = R3). You can also see that row 2 is a scalar multiple of row 1 (3*R1 = R2). That means that rows 1 & 3 are linearly depedent and rows 1 & 2 are linearly dependent. THat leaves us with one linearly indepedent row. That also shows us the rank is 1.
A <- matrix(c(1,2,1,3,6,3,2,4,2),nrow=3,byrow=TRUE)
A
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 3 6 3
## [3,] 2 4 2
rref(A)
## [,1] [,2] [,3]
## [1,] 1 2 1
## [2,] 0 0 0
## [3,] 0 0 0
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.
\[\begin{equation*}A = \mathbf{}\left[\begin{matrix} 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6\\ \end{matrix}\right] \end{equation*}\]
To find the eigenvalues we know the following is true:
Step 1 \[\begin{equation*}det(
\mathbf{}
\left[
\begin{matrix}
\lambda & 0 & 0\\ 0 & \lambda & 0\\ 0 & 0 & \lambda\\
\end{matrix}
\right]
-
\left[
\begin{matrix}
1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6\\
\end{matrix}
\right]
) = 0
\end{equation*}\]
Step 2 \[\begin{equation*}det( \mathbf{} \left[ \begin{matrix} \lambda - 1 & 2 & 3\\ 0 & \lambda - 4 & 5\\ 0 & 0 & \lambda - 6\\ \end{matrix} \right] ) = 0 \end{equation*}\]
Step 3 \[\begin{equation*}\lambda - 1 \mathbf{} \left[ \begin{matrix} \lambda - 4 & 5\\ 0 & \lambda - 6\\ \end{matrix} \right] - 2 \mathbf{} \left[ \begin{matrix} 0 & 5\\ 0 & \lambda - 6\\ \end{matrix} \right] + 3 \mathbf{} \left[ \begin{matrix} 0 & \lambda - 4 \\ 0 & 0\\ \end{matrix} \right] \end{equation*}\]
Step 4 \[\begin{equation*} (\lambda - 1)(\lambda - 4)(\lambda - 6) - (2*0*0) + (3*0*0) \end{equation*}\]
Step 5
\[\begin{equation*}
(\lambda - 1)(\lambda - 4)(\lambda - 6)
\end{equation*}\]
The eigenvalues are 1,4, and 6
Multiplying those together, we see that the characteristic polynomial is: \[\begin{equation*} (\lambda - 1)(\lambda - 4)(\lambda - 6) \end{equation*}\]
\[\begin{equation*} (\lambda^{2} - 1\lambda - 4\lambda + 4) (\lambda - 6) \end{equation*}\]
\[\begin{equation*} (\lambda^{3} - 5\lambda^{2} + 4\lambda) - (6\lambda^{2} - 30\lambda + 24) \end{equation*}\]
\[\begin{equation*} (\lambda^{3} - 11\lambda^{2} + 34\lambda - 24) \end{equation*}\]
Step 1 We know that I\(\lambda\) - A = 0, which gives us the following: \[\begin{equation*}det( \mathbf{} \left[ \begin{matrix} \lambda - 1 & 2 & 3\\ 0 & \lambda - 4 & 5\\ 0 & 0 & \lambda - 6\\ \end{matrix} \right] \end{equation*}\]
For \(\lambda\) = 1 we get:
\[\begin{equation*}
\mathbf{}
\left[
\begin{matrix}
0 & 2 & 3\\ 0 & -3 & 5\\ 0 & 0 & -5\\
\end{matrix}
\right]
\end{equation*}\]
For \(\lambda\) = 4 we get:
\[\begin{equation*}
\mathbf{}
\left[
\begin{matrix}
3 & 2 & 3\\ 0 & 0 & 5\\ 0 & 0 & -2\\
\end{matrix}
\right]
\end{equation*}\]
For \(\lambda\) = 6 we get:
\[\begin{equation*}
\mathbf{}
\left[
\begin{matrix}
5 & 2 & 3\\ 0 & 2 & 5\\ 0 & 0 & 0\\
\end{matrix}
\right]
\end{equation*}\]
Step 2 In order to get the eigen vectors, each matrix needs to be in row reduced echelon form:
For \(\lambda\) = 1 the following matrix is rref:
lambda1 <- matrix(c(0,2,3,0,-3,5,0,0,-5),nrow=3,byrow=TRUE)
rref(lambda1)
## [,1] [,2] [,3]
## [1,] 0 1 0
## [2,] 0 0 1
## [3,] 0 0 0
For \(\lambda\) = 4 the following matrix is rref:
lambda1 <- matrix(c(3,2,3,0,0,5,0,0,-2),nrow=3,byrow=TRUE)
rref(lambda1)
## [,1] [,2] [,3]
## [1,] 1 0.6666667 0
## [2,] 0 0.0000000 1
## [3,] 0 0.0000000 0
For \(\lambda\) = 6 we get:
lambda1 <- matrix(c(5,2,3,0,2,5,0,0,0),nrow=3,byrow=TRUE)
rref(lambda1)
## [,1] [,2] [,3]
## [1,] 1 0 -0.4
## [2,] 0 1 2.5
## [3,] 0 0 0.0
Step 3 Let t be a constant, this means the eigenvector is:
\(\lambda\) = 1
\[\begin{equation*}
\mathbf{}
\left[
\begin{matrix}
0 & 1 & 0\\ 0 & 0 & 1\\ 0 & 0 & 0\\
\end{matrix}
\right]
\left[
\begin{matrix}
v1\\ v2\\ v3\\
\end{matrix}
\right]
=
\left[
\begin{matrix}
0\\ 0\\ 0\\
\end{matrix}
\right]
\end{equation*}\]
\[\begin{equation*} v2 = 0 \end{equation*}\] \[\begin{equation*} v3 = 0 \end{equation*}\]
\[\begin{equation*} \left[ \begin{matrix} v1\\ v2\\ v3\\ \end{matrix} \right] = t \left[ \begin{matrix} 1\\ 0\\ 0\\ \end{matrix} \right] \end{equation*}\]
\(\lambda\) = 4
\[\begin{equation*}
\mathbf{}
\left[
\begin{matrix}
1& 2/3 & 0\\ 0 & 0 & 1\\ 0 & 0 & 0\\
\end{matrix}
\right]
\left[
\begin{matrix}
v1\\ v2\\ v3\\
\end{matrix}
\right]
=
\left[
\begin{matrix}
0\\ 0\\ 0\\
\end{matrix}
\right]
\end{equation*}\]
\[\begin{equation*} v1 + 2/3v2 = 0 \end{equation*}\] \[\begin{equation*} v3 = 0 \end{equation*}\]
\[\begin{equation*} \left[ \begin{matrix} v1\\ v2\\ v3\\ \end{matrix} \right] = t \left[ \begin{matrix} -2/3\\ 1\\ 0\\ \end{matrix} \right] \end{equation*}\]
\(\lambda\) = 6
\[\begin{equation*}
\mathbf{}
\left[
\begin{matrix}
1& 0 & -0.4\\ 0 & 1 & 2.5\\ 0 & 0 & 0\\
\end{matrix}
\right]
\left[
\begin{matrix}
v1\\ v2\\ v3\\
\end{matrix}
\right]
=
\left[
\begin{matrix}
0\\ 0\\ 0\\
\end{matrix}
\right]
\end{equation*}\]
\[\begin{equation*} v1 - 0.4v3 = 0 \end{equation*}\] \[\begin{equation*} v2 + 2.5v3 = 0 \end{equation*}\]
\[\begin{equation*} \left[ \begin{matrix} v1\\ v2\\ v3\\ \end{matrix} \right] = t \left[ \begin{matrix} 0.4\\ -2.5\\ 1\\ \end{matrix} \right] \end{equation*}\]
A <- matrix(c(1,2,3,0,4,5,0,0,6),nrow=3,byrow=TRUE)
A
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 0 4 5
## [3,] 0 0 6
The characteristic polynomial is 1\(\lambda\)3 - 11\(\lambda\)2 - 34\(\lambda\) - 24\(\lambda\).
The eigenvalues are \(\lambda\) = 6,4,and 1
charpoly <- charpoly(A,info=TRUE)
## Error term: 0
charpoly$cp
## [1] 1 -11 34 -24
roots(charpoly$cp)
## [1] 6 4 1