ASSIGNMENT 3

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 the matrix, we can perform Gaussian elimination to transform the matrix into it’s row-echelon form.

First we’ll do Row 2 + Row 1: \[\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \\ \end{bmatrix} \]

Next, we’ll do Row 4 - 5*Row 1: \[\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 1 & -2 & 1 \\ 0 & -6 & -17 & -23 \\ \end{bmatrix} \]

Now, we’ll do Row 3 - 1/2*Row 2: \[\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 0 & -4 & -2.5 \\ 0 & -6 & -17 & -23 \\ \end{bmatrix} \]

Row 4 + 3*Row 2: \[\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 0 & -4 & -2.5 \\ 0 & 0 & -5 & 5 \\ \end{bmatrix} \]

Finally, Row 4 + (-1.25*Row 3): \[\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 0 & -4 & -2.5 \\ 0 & 0 & -0 & 8.125 \\ \end{bmatrix} \]

Lastly, for interpretability, Row 3/-4: \[\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 0 & 1 & 0.625 \\ 0 & 0 & -0 & 8.125 \\ \end{bmatrix} \]

All the rows are non- zero rows so the rank of the matrix is 4.

Check our work using R:

Using R returns the same answer.

A <- matrix(c(1, 2, 3, 4,
              -1, 0, 1, 3,
              0, 1, -2, 1,
              5, 4, -2, -3), nrow = 4, byrow = TRUE)

rank_A <- qr(A)$rank

print(rank_A)
## [1] 4

(2)

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 for this matrix would be \(n\). This is due to the maximum rank being the smaller of the rows or columns. The minimum rank would be 1 due to a non-zero matrix having at least one non-zero row or column.

(3)

What is the rank of the matrix B? \[ B = \begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \\ \end{bmatrix} \]

Solving using reduced row echelon form:

Row 2 - 3*Row 1:

\[\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 2 & 4 & 2 \\ \end{bmatrix}\]

Row 3 - 2*Row 1:

\[\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix}\]

Since there is only one non-zero row, the rank of the matrix is 1

Check our work using R:

Using R returns the same answer.

B <- matrix(c(1, 2, 1,
              3 , 6, 3,
              2, 4, 2), nrow = 3, byrow = TRUE)

rank_B <- qr(B)$rank

print(rank_B)
## [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. \[AB = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0& 0 & 6 \\ \end{bmatrix} \]

To find the eigenvalues of matrix \(B\), we need to solve the characteristic equation \(\det(B - \lambda I) = 0\), where \(\lambda\) is the eigenvalue and \(I\) is the identity matrix. The characteristic equation is given by:

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

Expanding the determinant, we get:

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

So by setting the roots to zero, we can easily see the roots of the polynomial, and thus the eigenvalues of the matrix, are 1, 4 and 6.

By plugging the eigenvalues back into the equation one at a time, we can find the eigenvectors as well.

For \(\lambda = 1\):

\[ \begin{bmatrix} 1-1 & 2 & 3 \\ 0 & 4-1 & 5 \\ 0 & 0 & 6-1 \\ \end{bmatrix} = \begin{bmatrix} 0 & 2 & 3 \\ 0 & 3 & 5 \\ 0 & 0 & 5 \\ \end{bmatrix} \] Divide row 1 by 2: \[ \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 3 & 5 \\ 0 & 0 & 5 \\ \end{bmatrix} \] Row 2 - 3*row 1: \[ \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 0 & 1/2 \\ 0 & 0 & 5 \\ \end{bmatrix} \] Multiply row 2 by 2: \[ \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 0 & 1 \\ 0 & 0 & 5 \\ \end{bmatrix} \] Row 1 - row 2(3/2): \[ \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 5 \\ \end{bmatrix} \] Row 3 - row 2*5: \[ \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \\ \end{bmatrix} \] \[ \begin{aligned} x_1 &= t, \\ x_2 &= 0, \\ x_3 &= 0, \\ \mathbf{v}_1 &= \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}. \end{aligned} \]

For \(\lambda = 4\):

\[ \begin{bmatrix} 1-4 & 2 & 3 \\ 0 & 4-4 & 5 \\ 0 & 0 & 6-4 \\ \end{bmatrix} = \begin{bmatrix} -3 & 2 & 3 \\ 0 & 0 & 5 \\ 0 & 0 & 2 \\ \end{bmatrix} \] Divide row 1 by -3: \[ \begin{bmatrix} 1 & -2/3 & -1 \\ 0 & 0 & 5 \\ 0 & 0 & 2 \\ \end{bmatrix} \] Divide row 2 by 5: \[ \begin{bmatrix} 1 & -2/3 & -1 \\ 0 & 0 & 1 \\ 0 & 0 & 2 \\ \end{bmatrix} \] Row 1 + row 2: \[ \begin{bmatrix} 1 & -2/3 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 2 \\ \end{bmatrix} \] Row 3 - row 2*2: \[ \begin{bmatrix} 1 & -2/3 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \\ \end{bmatrix} \] \[ \begin{aligned} x_1 &= 2_t/3, \\ x_2 &= t, \\ x_3 &= 0, \\ \mathbf{v}_1 &= \begin{bmatrix} 2/3 \\ 1 \\ 0 \end{bmatrix}. \end{aligned} \]

For \(\lambda = 6\):

\[ \begin{bmatrix} 1-6 & 2 & 3 \\ 0 & 4-6 & 5 \\ 0 & 0 & 6-6 \\ \end{bmatrix} = \begin{bmatrix} -5 & 2 & 3 \\ 0 & -2 & 5 \\ 0 & 0 & 0 \\ \end{bmatrix} \] Divide row 1 by -5: \[\begin{bmatrix} 1 & -2/5 & -3/5 \\ 0 & -2 & 5 \\ 0 & 0 & 0 \\ \end{bmatrix} \] Divide row 2 by -2: \[\begin{bmatrix} 1 & -2/5 & -3/5 \\ 0 & 1 & -5/2 \\ 0 & 0 & 0 \\ \end{bmatrix} \] Row 1 + row 2*(2/5): \[\begin{bmatrix} 1 & 0 & -8/5 \\ 0 & 1 & -5/2 \\ 0 & 0 & 0 \\ \end{bmatrix} \] \[ \begin{aligned} x_1 &= 8_t/5, \\ x_2 &= 5_t/2, \\ x_3 &= t, \\ \mathbf{v}_1 &= \begin{bmatrix} 8/5 \\ 5/2 \\ 1 \end{bmatrix}. \end{aligned} \]

Check our work using R:

Using R returns the following results. While they might seem to be different results as the above calculations, they are just normalized and are the same results.

a = matrix(c(1,2,3,0,4,5,0,0,6), ncol = 3, nrow = 3, byrow = TRUE)

eigen(a)
## 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