DATA605_w3_ Eigenvalues and Eigenvectors

David Simbandumwe

library(matlib) 
library(pracma)
## 
## Attaching package: 'pracma'
## The following objects are masked from 'package:matlib':
## 
##     angle, inv

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}\)

A = matrix(c(1,-1,0,5, 2,0,1,4, 3,1,-2,-2, 4,3,1,-3),4)
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
print('- RREF')
## [1] "- RREF"
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
print('- matrix rank')
## [1] "- matrix rank"
Rank(A)
## [1] 4
      The rank of matrix A is = 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 of the matrix is n and the minimum rank is 1




(3) What is the rank of matrix B?

\[B = \begin{bmatrix} 1&2&1 \\ 3&6&3 \\ 2&4&2 \end{bmatrix} \] | The 3 rows in the matrix are scaled equivalent there for the rank is 1

B = matrix(c(1,3,2, 2,6,4, 1,3,2),3)
B
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    3    6    3
## [3,]    2    4    2
#- RREF
rref(B)
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    0    0    0
## [3,]    0    0    0
#- matrix rank
Rank(B)
## [1] 1
      The rank of matrix A is = 1



Problem Set 2



(4)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}\)

      The eigenvalues of a triangular matrix are the diagonal 1,4,6. We can confirm that using R as follows
A <- matrix(c(1,0,0, 2,4,0, 3,5,6), 3)
A
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    0    4    5
## [3,]    0    0    6
#eigen values / vectors'
e <- eigen(A)
print(e$values)
## [1] 6 4 1

lambda 1

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

  • R3*(-1/5)
  • R2 + (5)*R3
  • R2*(-1/3)
  • R1 + (-3)R3 and R1 + (-2)R2

\[ null space \to 1\lambda \to (I - A) = \begin{bmatrix} 0&0&0 \\ 0&1&0 \\ 0&0&1 \end{bmatrix} * \begin{bmatrix} x1 \\ x2 \\ x3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

  • x1=1, x2=0, x3=0

\[ N(I-A) \to span ( s * \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}) \]

#lambda 1
A1 <- 1*diag(3) - A
A1
##      [,1] [,2] [,3]
## [1,]    0   -2   -3
## [2,]    0   -3   -5
## [3,]    0    0   -5
rref(A1)
##      [,1] [,2] [,3]
## [1,]    0    1    0
## [2,]    0    0    1
## [3,]    0    0    0

lambda 4

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

  • R3*(-1/2)
  • R2 + (5)R3 and R1 + (3)R3
  • R2*(1/3)

\[ null space \to 1\lambda \to (I - A) = \begin{bmatrix} 1&-2/3&0 \\ 0&0&0 \\ 0&0&1 \end{bmatrix} * \begin{bmatrix} x1 \\ x2 \\ x3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

  • x1=2/3, x2=1, x3=0

\[ N(I-A) \to span ( s * \begin{bmatrix} 2/3 \\ 1 \\ 0 \end{bmatrix}) \]

#lambda 4
A2 <- 4*diag(3) - A
A2
##      [,1] [,2] [,3]
## [1,]    3   -2   -3
## [2,]    0    0   -5
## [3,]    0    0   -2
rref(A2)
##      [,1]       [,2] [,3]
## [1,]    1 -0.6666667    0
## [2,]    0  0.0000000    1
## [3,]    0  0.0000000    0

lambda 6

\[ 4\lambda \to (4I - A) = \begin{bmatrix} 6-1&-2&-3 \\ 0&6-4&-5 \\ 0&0&6-6 \end{bmatrix} = \begin{bmatrix} 5&-2&-3 \\ 0&2&-5 \\ 0&0&0 \end{bmatrix} RREF \begin{bmatrix} 1&0&-8/5 \\ 0&1&-5/2 \\ 0&0&0 \end{bmatrix} \]

  • R2*(1/2)
  • R1 + (-2)*R2
  • R1*(1/5)

\[ null space \to 1\lambda \to (I - A) = \begin{bmatrix} 1&0&-8/5 \\ 0&1&-5/2 \\ 0&0&0 \end{bmatrix} * \begin{bmatrix} x1 \\ x2 \\ x3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \]

  • x1=8/5, x2=5/2, x3=1

\[ N(I-A) \to span ( s * \begin{bmatrix} 8/5 \\ 5/2 \\ 1 \end{bmatrix}) \]

#lambda 6
A3 <- 6*diag(3) - A
A3
##      [,1] [,2] [,3]
## [1,]    5   -2   -3
## [2,]    0    2   -5
## [3,]    0    0    0
rref(A3)
##      [,1] [,2] [,3]
## [1,]    1    0 -1.6
## [2,]    0    1 -2.5
## [3,]    0    0  0.0



Please show your work using an R-markdown document. Please name your assignment submission with your first initial and last name.