Data 605 Assignment 3

Problem Set One

Question 1

Each row is independent therefore the rank of the matrix is 4, the rank is the the number of pivots that the matrix has and can be no greater than the smaller of the row or column dimension

library(pracma)

A <- cbind(c(1,-1,0,5),c(2,0,1,4), c(3,1,-2,-2),c(4,3,1,-3))
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
Matrixinfo <- qr(A)
RankA <- Matrixinfo$rank
RankA
## [1] 4

Question 2

For a mxn matrix if m > n, the maximum rank is n. Assuming the matrix is non-zero, the minimum rank is 1

Question 3

B <- cbind(c(1,3,2), c(2,6,4), c(1,3,2))
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
MatrixB_info <- qr(B)
RankB <- MatrixB_info$rank
RankB
## [1] 1

Problem Set Two

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 = matrix(c( 1, 0, 0, 2, 4, 0, 3, 5, 6), nrow = 3, ncol = 3)
A
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    0    4    5
## [3,]    0    0    6

Eigenvalues

\[ det(\lambda I_{3} - A)=0\]

\[ det \Bigg\{ \begin{pmatrix} \lambda & 0 & 0 \\ 0 & \lambda & 0 \\ 0 & 0 & \lambda \\\end{pmatrix} - \begin{pmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{pmatrix} \Bigg\} =0\]

\[det(\lambda I_{3} - A) = (\lambda - 1) [ (\lambda - 4)(\lambda - 6 ) - (0*-5)] - (-2 [ 0*(\lambda - 6 ) - (0*-5)]) - (-3 [ (\lambda - 4)*0 - 0*0])\]

In order to find the eigenvalues we must set \[det(\lambda I_{3} -A)=0\]

Characteristic Polynomial

\[det(\lambda I_{3} - A) = \lambda^3 - 11\lambda^2 + 34\lambda -24 = 0\]

this can be rewritten as:

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

This means that are eigenvalues are \[\lambda = 1,\lambda = 4,\lambda = 6\]

Eigenvectors

To find our eigenvectors we need to solve the following equation for all of the eigenvalues:

\[\left[ \begin{array}{ccc} \lambda - 1 & -2 & -3 \\ 0 & \lambda -4 & -5 \\ 0 & 0 & \lambda -6 \end{array}\right] \vec{v} = \vec{0}\]

We will use eigenvalue of One first:

Lambda = One

\[\lambda = 1, \left[ \begin{array}{ccc} (1 - 1) & -2 & -3 \\ 0 & (1 - 4) & -5 \\ 0 & 0 & (1 - 6) \end{array}\right] \vec{v} = \vec{0}\]

Using Back substitution solve to figure out that:

\[{ E }_{ \lambda =1 }={span( }\left[ \begin{matrix} 1 \\ 0 \\ 0 \end{matrix} \right] )\]

Lambda = Six

\[\lambda = 1, \left[ \begin{array}{ccc} (6 - 1) & -2 & -3 \\ 0 & (6 - 4) & -5 \\ 0 & 0 & (6 - 6) \end{array}\right] \vec{v} = \vec{0}\]

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

\[{ E }_{ \lambda =6 }={span( }\left[ \begin{matrix}\frac { 8 }{ 5 } \\ \frac { 5 }{ 2 } \\ 1 \end{matrix} \right])\]

convert to unit vector

\[\sqrt { { \left( \frac { 8 }{ 5 } \right) }^{ 2 }+{ \left( \frac { 5 }{ 2 } \right) }^{ 2 }+{ 1 }^{ 2 } } =\quad 3.1321\]

\[{ E }_{ \lambda =6 }=span(\left[ \begin{matrix} 0.5108 \\ 0.7982 \\ 0.3193 \end{matrix} \right] )\]

Lambda = Four

\[\lambda = 1, \left[ \begin{array}{ccc} (4 - 1) & -2 & -3 \\ 0 & (4 - 4) & -5 \\ 0 & 0 & (4 - 6) \end{array}\right] \vec{v} = \vec{0}\]

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

Using back substituion we figure the span to be

\[{ E }_{ \lambda =4 }={span( }\left[ \begin{matrix}\frac { 2 }{ 3 } \\ 1\\ 0 \end{matrix} \right])\]

convert to unit vector

\[{ E }_{ \lambda =4 }={span( }\left[ \begin{matrix}0.5547 \\ 0.8321\\ 0 \end{matrix} \right])\]

Calculated Eigenvectors for eigenvalues of one, six, and four

\[\left[ \begin{matrix} 1 \\ 0 \\ 0 \end{matrix} \right] ,\left[ \begin{matrix} 0.5108 \\ 0.7982 \\ 0.3193 \end{matrix} \right] ,\left[ \begin{matrix} 0.5547 \\ 0.8321 \\ 0 \end{matrix} \right]\]

Using the R function to compute eigenvalues and eigenvectors, Verify Results

A <- matrix(c(1,2,3,0,4,5,0,0,6),3,3,byrow=TRUE)  
A
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    0    4    5
## [3,]    0    0    6
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

Corey Arnouts

February 17, 2019