Data 605 Homework 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}\] \[[r1+r2]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \end{bmatrix}\] \[[-5*r1+r4]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 1 & -2 & 1 \\ 0 & -6 & -17 & -23 \end{bmatrix}\] \[[r2/2]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 1 & -2 & 1 \\ 0 & -6 & -17 & -23 \end{bmatrix}\] \[[r3(r2-r1)]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & -4 & -5/2 \\ 0 & -6 & -17 & -23 \end{bmatrix}\] \[[6*r2+r4]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & -4 & -5/2 \\ 0 & 0 & -5 & -2 \end{bmatrix}\] \[[r3/-4]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 5/8 \\ 0 & 0 & -5 & -2 \end{bmatrix}\] \[[5*r3+r4]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 5/8 \\ 0 & 0 & 0 & 9/8 \end{bmatrix}\] \[[r4/(9/8)]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 5/8 \\ 0 & 0 & 0 & 1 \end{bmatrix}\] \[[-5/8*r4+r3]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\] \[[-7/2*r4+r2]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\] \[[-2*r3+r2]=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\] \[[-4*r4+r1][-3*r3+r1][-2*r2+r1]=\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}\]

ANSWER: Rank=4

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

echelon(A, verbose=TRUE, fractions=TRUE)
## 
## Initial matrix:
##      [,1] [,2] [,3] [,4]
## [1,]  1    2    3    4  
## [2,] -1    0    1    3  
## [3,]  0    1   -2    1  
## [4,]  5    4   -2   -3  
## 
## row: 1 
## 
##  exchange rows 1 and 4 
##      [,1] [,2] [,3] [,4]
## [1,]  5    4   -2   -3  
## [2,] -1    0    1    3  
## [3,]  0    1   -2    1  
## [4,]  1    2    3    4  
## 
##  multiply row 1 by 1/5 
##      [,1] [,2] [,3] [,4]
## [1,]    1  4/5 -2/5 -3/5
## [2,]   -1    0    1    3
## [3,]    0    1   -2    1
## [4,]    1    2    3    4
## 
##  multiply row 1 by 1 and add to row 2 
##      [,1] [,2] [,3] [,4]
## [1,]    1  4/5 -2/5 -3/5
## [2,]    0  4/5  3/5 12/5
## [3,]    0    1   -2    1
## [4,]    1    2    3    4
## 
##  subtract row 1 from row 4 
##      [,1] [,2] [,3] [,4]
## [1,]    1  4/5 -2/5 -3/5
## [2,]    0  4/5  3/5 12/5
## [3,]    0    1   -2    1
## [4,]    0  6/5 17/5 23/5
## 
## row: 2 
## 
##  exchange rows 2 and 4 
##      [,1] [,2] [,3] [,4]
## [1,]    1  4/5 -2/5 -3/5
## [2,]    0  6/5 17/5 23/5
## [3,]    0    1   -2    1
## [4,]    0  4/5  3/5 12/5
## 
##  multiply row 2 by 5/6 
##      [,1] [,2] [,3] [,4]
## [1,]    1  4/5 -2/5 -3/5
## [2,]    0    1 17/6 23/6
## [3,]    0    1   -2    1
## [4,]    0  4/5  3/5 12/5
## 
##  multiply row 2 by 4/5 and subtract from row 1 
##      [,1]  [,2]  [,3]  [,4] 
## [1,]     1     0  -8/3 -11/3
## [2,]     0     1  17/6  23/6
## [3,]     0     1    -2     1
## [4,]     0   4/5   3/5  12/5
## 
##  subtract row 2 from row 3 
##      [,1]  [,2]  [,3]  [,4] 
## [1,]     1     0  -8/3 -11/3
## [2,]     0     1  17/6  23/6
## [3,]     0     0 -29/6 -17/6
## [4,]     0   4/5   3/5  12/5
## 
##  multiply row 2 by 4/5 and subtract from row 4 
##      [,1]  [,2]  [,3]  [,4] 
## [1,]     1     0  -8/3 -11/3
## [2,]     0     1  17/6  23/6
## [3,]     0     0 -29/6 -17/6
## [4,]     0     0  -5/3  -2/3
## 
## row: 3 
## 
##  multiply row 3 by -6/29 
##      [,1]  [,2]  [,3]  [,4] 
## [1,]     1     0  -8/3 -11/3
## [2,]     0     1  17/6  23/6
## [3,]     0     0     1 17/29
## [4,]     0     0  -5/3  -2/3
## 
##  multiply row 3 by 8/3 and add to row 1 
##      [,1]   [,2]   [,3]   [,4]  
## [1,]      1      0      0 -61/29
## [2,]      0      1   17/6   23/6
## [3,]      0      0      1  17/29
## [4,]      0      0   -5/3   -2/3
## 
##  multiply row 3 by 17/6 and subtract from row 2 
##      [,1]   [,2]   [,3]   [,4]  
## [1,]      1      0      0 -61/29
## [2,]      0      1      0  63/29
## [3,]      0      0      1  17/29
## [4,]      0      0   -5/3   -2/3
## 
##  multiply row 3 by 5/3 and add to row 4 
##      [,1]   [,2]   [,3]   [,4]  
## [1,]      1      0      0 -61/29
## [2,]      0      1      0  63/29
## [3,]      0      0      1  17/29
## [4,]      0      0      0   9/29
## 
## row: 4 
## 
##  multiply row 4 by 29/9 
##      [,1]   [,2]   [,3]   [,4]  
## [1,]      1      0      0 -61/29
## [2,]      0      1      0  63/29
## [3,]      0      0      1  17/29
## [4,]      0      0      0      1
## 
##  multiply row 4 by 61/29 and add to row 1 
##      [,1]  [,2]  [,3]  [,4] 
## [1,]     1     0     0     0
## [2,]     0     1     0 63/29
## [3,]     0     0     1 17/29
## [4,]     0     0     0     1
## 
##  multiply row 4 by 63/29 and subtract from row 2 
##      [,1]  [,2]  [,3]  [,4] 
## [1,]     1     0     0     0
## [2,]     0     1     0     0
## [3,]     0     0     1 17/29
## [4,]     0     0     0     1
## 
##  multiply row 4 by 17/29 and subtract from row 3 
##      [,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
  1. Given an m x n matrix where m > n, what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?

The max rank cannot be > than ‘n’.
The min rank in this case (non-zero) is 1.

  1. What is the rank of matrix B?

\[B=\begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \end{bmatrix}\] \[[-3*r1+r2]=\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 2 & 4 & 2 \end{bmatrix}\] \[[-2*r1+r3]=\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}\] There is no need to go further. Since r2 and r3 are all zeros, the Rank of Matrix B is 1. The program can prove this.

B <- matrix(c(1,2,1,3,6,3,2,4,2), 3, 3, byrow=TRUE)
echelon(B, verbose=TRUE, fractions=TRUE)
## 
## Initial matrix:
##      [,1] [,2] [,3]
## [1,] 1    2    1   
## [2,] 3    6    3   
## [3,] 2    4    2   
## 
## row: 1 
## 
##  exchange rows 1 and 2 
##      [,1] [,2] [,3]
## [1,] 3    6    3   
## [2,] 1    2    1   
## [3,] 2    4    2   
## 
##  multiply row 1 by 1/3 
##      [,1] [,2] [,3]
## [1,] 1    2    1   
## [2,] 1    2    1   
## [3,] 2    4    2   
## 
##  subtract row 1 from row 2 
##      [,1] [,2] [,3]
## [1,] 1    2    1   
## [2,] 0    0    0   
## [3,] 2    4    2   
## 
##  multiply row 1 by 2 and subtract from row 3 
##      [,1] [,2] [,3]
## [1,] 1    2    1   
## [2,] 0    0    0   
## [3,] 0    0    0   
## 
## row: 2
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.

\[C=\begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix}\] \[C\underline { x } =\lambda \underline { x } \] \[|C-\lambda I|\underline { x } =\quad 0\] \[\begin{bmatrix} 1-\lambda & 2 & 3 \\ 0 & 4-\lambda & 5 \\ 0 & 0 & 6-\lambda \end{bmatrix}=0\] \[(1-\lambda )( 4-\lambda )(6-\lambda )=0\]

eigenvalue = \([1\quad 4\quad 6]\)

C <- matrix(c(1,2,3,0,4,5,0,0,6), 3, 3, byrow=TRUE)
charpoly(C)
## [1]   1 -11  34 -24
(e<- eigen(C))
## 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