Problem Set 1

(1) What is the rank of the matrix \(A\)?

\[ A = \begin{bmatrix} 1 & 2 & 3 & 4 \\ -1 & 0 & 1 & 3 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \end{bmatrix} \]

To find the rank of a matrix you can transform the matrix to reduced row echelon form then simply count the number of non-zero rows.

To transform \(A\) to reduced row echelon form we can perform the following row operations RREF Calculator:

\[ R_1 + R_2 \rightarrow R_2 \\ -5R_1 + R_4 \rightarrow R_4 \\ \frac{1}{2} R_2 \rightarrow R_2 \\ -1R_2 + R_3 \rightarrow R_3 \\ 6R_2 + R_4 \rightarrow R_4 \\ \frac{1}{4} R_3 \rightarrow R_3 \\ 5R_3 + R_4 \rightarrow R_4 \\ \frac{8}{9} R_4 \rightarrow R_4 \\ \frac{-5}{8} R_4 + R_3 \rightarrow R_3 \\ \frac{-7}{2} R_4 + R_2 \rightarrow R_2 \\ -4R_4 + R_1 \rightarrow R_1 \\ -2R_3 + R_2 \rightarrow R_2 \\ -3R_3 + R_1 \rightarrow R_1 \\ -2R_2 + R_1 \rightarrow R_1 \\ \]

This results in an identy matrix in \({\rm I\!R}^4\)

\[ A' = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]

Since there are 4 non-zero rows, the rank of \(A\) is 4.

We can check this in R using the rref function from the pracma package and the Rank funciton in pracma or the qr function from base R

library(pracma)
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
Rank(A)
## [1] 4
qr(A)$rank
## [1] 4

(2) Given an \(m \times n\) matrix where \(m > n\), what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?

The maximum rank would be equal to \(n\) since the maximum rank is the lesser of either the number of rows or the number of columns. Since in this case \(n\) is less than \(m\), \(n\) is the maximum rank. The minimum rank of any non-zero matrix is 1.

(3) What is the rank of matrix \(B\)?

\[ \text{If } B = \begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \end{bmatrix} \]

We can easily see that rows 2 ad 3 of matrix \(B\) are just multiples of row one and so will be zeroed out during the process of row reduction, so the rank of matrix B is 1, but let’s go through the steps anyway just to show the process.

To transform \(A\) to reduced row echelon form we can perform the following row operations:

\[ -3R_1 + R_2 \rightarrow R_2 \\ -2R_1 + R_3 \rightarrow R_3 \\ \]

This results in the following matrix:

\[ B' = \begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} \] Since there is only one non-zero row, the rank of \(B\) is 1.

We can check this in R using the rref function from the pracma package and the Rank funciton in pracma or the qr function from base R

library(pracma)
B <- matrix(c(1,2,1,3,6,3,2,4,2), nrow=3, byrow=TRUE)
B
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    3    6    3
## [3,]    2    4    2
rref(B)
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    0    0    0
## [3,]    0    0    0
Rank(B)
## [1] 1
qr(B)$rank
## [1] 1


Problem Set 2

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.

\[ A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} \]

To find the eigenvalues and eigenvectors of \(A\) we need to set up our equation. By definition an eigenvalue of \(A\) (\(\lambda\)) and it’s corresponding eigenvector (\(\vec{x}\)) are such that:

\[ A\vec{x} = \lambda \vec{x} \]

We can multiply \(\lambda\) by the identity matrix to get:

\[ A\vec{x} = \lambda I_3 \vec{x} \\ A\vec{x} - \lambda I_3 \vec{x} = 0 \\ (A - \lambda I_3) \vec{x} = 0 \\ \]

To find the non-trivial solutions to we need to solve:

\[ det(A - \lambda I_3) = 0 \]

First find \(A - \lambda I_3\):

\[ A - \lambda I_3 = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} - \begin{bmatrix} \lambda & 0 & 0 \\ 0 & \lambda & 0 \\ 0 & 0 & \lambda \end{bmatrix} = \begin{bmatrix} (1-\lambda) & 2 & 3 \\ 0 & (4-\lambda) & 5 \\ 0 & 0 & (6-\lambda) \end{bmatrix} \]

To find the determinant I’m using the “Shortcut Method” from Linear Algebra with Applications Second Edition by Jeffrey Holt (page 211)

\[ a_{11} a_{22} a_{33} + a_{12} a_{23} a_{31} + a_{13} a_{21} a_{32} - a_{13} a_{22} a_{31} - a_{11} a_{23} a_{32} - a_{12} a_{21} a_{33} \]

\[ \begin{align} det(A - \lambda I_3) &= det \left( \begin{bmatrix} (1-\lambda) & 2 & 3 \\ 0 & (4-\lambda) & 5 \\ 0 & 0 & (6-\lambda) \end{bmatrix} \right) \\ det(A - \lambda I_3) &= {\small (1-\lambda) (4-\lambda) (6-\lambda) + (2 \times 5 \times 0) + (3 \times 0 \times 0) - (3 (4-\lambda) \times 0) - ((1-\lambda) \times 5 \times 0) - (2 \times 0 \times (6-\lambda)) }\\ &= (1-\lambda) (4-\lambda) (6-\lambda) \\ &= (\lambda^2 - 5\lambda + 4) (6-\lambda)\\ &= (-\lambda^3 + 11 \lambda^2 - 34 \lambda + 24) \end{align} \]

So our characteristic polynomial is:

\[ -\lambda^3 + 11 \lambda^2 - 34 \lambda + 24 \]

In order to find our Eigenvalues we now need to solve our characteristic equation:

\[ -\lambda^3 + 11 \lambda^2 - 34 \lambda + 24 = 0 \]

Since we know from a previous step in our calculations that:

\[ -\lambda^3 + 11 \lambda^2 - 34 \lambda + 24 \]

can be factored out to:

\[ (1-\lambda) (4-\lambda) (6-\lambda) \]

we know our eigenvalues must be:

\[ \lambda_1 = 1\\ \lambda_2 = 4\\ \lambda_3 = 6 \]

Using these values we can now solve for the corresponding eigenvectors (\(\vec{x}\)) in our original equation:

\[ (A - \lambda I_3) \vec{x} = 0 \\ \]

For \(\lambda_1 = 1\):

\[ (A - I_3)\vec{x} = \left( \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} - \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \right) \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

\[ \begin{bmatrix} 0 & 2 & 3 \\ 0 & 3 & 5 \\ 0 & 0 & 5 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

We can use R to put the matrix in reduced row echelon form:

A <- matrix(c(0,2,3,0,3,5,0,0,5), nrow=3, byrow=TRUE)
A
##      [,1] [,2] [,3]
## [1,]    0    2    3
## [2,]    0    3    5
## [3,]    0    0    5
rref(A)
##      [,1] [,2] [,3]
## [1,]    0    1    0
## [2,]    0    0    1
## [3,]    0    0    0

\[ \varepsilon_A(1) = \mathcal{N}(A - 1I_3) = \left\langle\left\{ \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \right\} \right\rangle \]

For \(\lambda_1 = 4\):

\[ (A - 4I_3)\vec{x} = \left( \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} - 4\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \right) \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

\[ \begin{bmatrix} -3 & 2 & 3 \\ 0 & 0 & 5 \\ 0 & 0 & 2 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

A <- matrix(c(-3,2,3,0,0,5,0,0,2), nrow=3, byrow=TRUE)
A
##      [,1] [,2] [,3]
## [1,]   -3    2    3
## [2,]    0    0    5
## [3,]    0    0    2
rref(A)
##      [,1]       [,2] [,3]
## [1,]    1 -0.6666667    0
## [2,]    0  0.0000000    1
## [3,]    0  0.0000000    0

\[ \varepsilon_A(4) = \mathcal{N}(A - 4I_3) = \left\langle\left\{ \begin{bmatrix} \frac{2}{3} \\ 1 \\ 0 \end{bmatrix} \right\} \right\rangle = \left\langle\left\{ \begin{bmatrix} 2 \\ 3 \\ 0 \end{bmatrix} \right\} \right\rangle \]

For \(\lambda_1 = 6\):

\[ (A - 6I_3)\vec{x} = \left( \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} - 6\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \right) \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

\[ \begin{bmatrix} -5 & 2 & 3 \\ 0 & -2 & 5 \\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

A <- matrix(c(-5,2,3,0,-2,5,0,0,0), nrow=3, byrow=TRUE)
A
##      [,1] [,2] [,3]
## [1,]   -5    2    3
## [2,]    0   -2    5
## [3,]    0    0    0
rref(A)
##      [,1] [,2] [,3]
## [1,]    1    0 -1.6
## [2,]    0    1 -2.5
## [3,]    0    0  0.0

\[ \varepsilon_A(6) = \mathcal{N}(A - 6I_3) = \left\langle\left\{ \begin{bmatrix} \frac{8}{5} \\ \frac{5}{2} \\ 1 \end{bmatrix} \right\} \right\rangle = \left\langle\left\{ \begin{bmatrix} 16 \\ 25 \\ 10 \end{bmatrix} \right\} \right\rangle \]