Problem Set 1

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

\[\mathbf{A} = \left[\begin{array} {rrr} 1 & 2 & 3 & 4 \\ -1 & 0 & 1 & 3 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \end{array}\right] \]

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

# Get the qr of Matrix A to compute the QR decomposition of the matrix type

A_qr <- qr (A)
Rank_A <- A_qr$rank
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?

When the matrix is a non-zero matrix, it contains at least one element that is not zero. Therefore, there will be at least 1 row that will have non-zero value and thus a minimum rank of 1.

(3) What is the rank of matrix B?

\[\mathbf{B} = \left[\begin{array} {rrr} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \end{array}\right] \]

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

# Get the qr of Matrix A to compute the QR decomposition of the matrix type

B_qr <- qr (B)
Rank_B <- B_qr$rank
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.

\[\mathbf{A} = \left[\begin{array} {rrr} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{array}\right] \]

\[\mathbf{det} = \left[\begin{array} {rrr} \lambda -1 & 2 & 3 \\ 0 & \lambda-4 & 5 \\ 0 & 0 & \lambda-6 \end{array}\right] \] Apply the Rules of Sarrus.

= (\(\lambda\)-1)(\(\lambda\)-4)(\(\lambda\)-6)+ (250) + (300) - (20(x-6)) - ((x-1)50) - (3(x-4)0)= 0

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

= (\(\lambda\)-1)(\(\lambda\)^2 -6\(\lambda\) - 4\(\lambda\)+24)= 0

= (\(\lambda\)-1)(\(\lambda\)^2 -10\(\lambda\) +24)= 0

= (\(\lambda\)^3 - 10\(\lambda\)^2 +24\(\lambda\) -\(\lambda\)^2 +10\(\lambda\) -24)= 0

= (\(\lambda\)^3 - 11\(\lambda\)^2 +34\(\lambda\) -24)= 0 This is the characteristic polynomial

Eigenvalues:

Using this formula (\(\lambda\)-1)(\(\lambda\)^2 -10\(\lambda\) +24)= 0

\(\lambda\)-1= 0

\(\lambda\)= 1

\(\lambda\)^2 -10\(\lambda\) +24=0

(\(\lambda\) -4)(\(\lambda\) -6)=0

\(\lambda\) = 4 and \(\lambda\) = 6

The Eigenvalues are 1, 6, 4

Eigenvector

When \(\lambda\) = 1

\[\mathbf{} = \left[\begin{array} {rrr} 1 -1 & 2 & 3 \\ 0 & 4-1 & 5 \\ 0 & 0 & 6-1 \end{array}\right] \]

\[\mathbf{} = \left[\begin{array} {rrr} 0 & 2 & 3 \\ 0 & 3 & 5 \\ 0 & 0 & 5 \end{array}\right] \] Multiply by

\[\mathbf{} \left[\begin{array} {rrr} v1 \\ v2 \\ v3 \end{array}\right] = 0 \] 5v3 = 0 , v3 = 0

v2 = -5/3, v2 = 0

Therefore, when eigenvalue lambda = 1, the eigenvetor is

\[\mathbf{} \left[\begin{array} {rrr} 1 \\ 0 \\ 0 \end{array}\right] \] When \(\lambda\) = 4

\[\mathbf{} \left[\begin{array} {rrr} 1 -4 & 2 & 3 \\ 0 & 4-4 & 5 \\ 0 & 0 & 6-4 \end{array}\right] \] \[\mathbf{} \left[\begin{array} {rrr} -3 & 2 & 3 \\ 0 & 0 & 5 \\ 0 & 0 & 2 \end{array}\right] \] Multiply by

\[\mathbf{} \left[\begin{array} {rrr} v1 \\ v2 \\ v3 \end{array}\right] = 0 \] 2v3= 0, v3= 0 v2 3/2 v1, v2 = 3/2 and v1 = 1

Therefore, when eigenvalue lambda = 4, the eigenvetor is

\[\mathbf{} \] $$

When \(\lambda\) = 6

\[\mathbf{} \left[\begin{array} {rrr} 1 -6 & 2 & 3 \\ 0 & 4-6 & 5 \\ 0 & 0 & 6-6 \end{array}\right] \]

\[\mathbf{} \left[\begin{array} {rrr} -5 & 2 & 3 \\ 0 & -2 & 5 \\ 0 & 0 & 0 \end{array}\right] \]

\[\mathbf{} \left[\begin{array} {rrr} v1 \\ v2 \\ v3 \end{array}\right] = 0 \]

2v2= 5v3 – v2= 5/2v3

2v1 = 2v2 + 3v3 ,

v1 = 2/5 * 5/2v3 + 3/2

v1= 8/5

Therefore, when eigenvalue lambda = 4, the eigenvetor is

\[\mathbf{} \left[\begin{array} {rrr} 8/5 \\ 5/2 \\ 1 \end{array}\right] \]

Finally, The Eigenvalues are : 1, 4, 6

and the eigenvectors are:

\[\mathbf{} \left[\begin{array} {rrr} 1 \\ 0 \\ 0 \end{array}\right] \],

\[\mathbf{} \left[\begin{array} {rrr} 1 \\ 3/2 \\ 0 \end{array}\right], \]

\[\mathbf{} \left[\begin{array} {rrr} 8/5 \\ 5/2 \\ 1 \end{array}\right] \]

# Verification in R
A2 <- matrix(c(1,0,0,2,4,0,3,5,6),nrow=3)
A2_Eigen <- eigen(A2)
A2check <- A2_Eigen$values
A2check
## [1] 6 4 1
eigen(A2, only.values = FALSE, EISPACK = TRUE)
## 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