Problem Set 1

What is the rank of the matrix A?

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

Rank is how many rows and columns are not comprised of other rows and columns. We can find this a few different ways.

The easy way:

qr(A)$rank
## [1] 4

The a slightly more involved way: finding the determinant

det(A)
## [1] 52

Because the determinant is not 0, we know that the matrix has the highest rank it can have (the number of rows or columns; whatever is smaller). Thus, this alone tells us that the rank is 4.

We could also figure out the rank by calculating the maximum number of linearly independent columns or rows.

Given an mxn matrix where m > n, what can be the maximum rank? The minimum rank, assuming that the matrix is non-zero?

The rank can’t be less than the smallest dimension. Thus, n is the upper bound. We don’t have any deterinants for non-square matricies to work with. But, becuase we know it’s not a 0 matrix, it does have a rank (1<).

Therefore: the rank is between 1 and n (inclusive)

What is the rank of matrix B?

B <- matrix(c(1,3,2,2,6,4,1,3,2), nrow = 3)
B
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    3    6    3
## [3,]    2    4    2
det(B)
## [1] 0

The rank of B is 1, becuase each row is a linear combination of other rows, and each column is a linear combination of other columns. Also, the determinant of this square matrix is 0, which hints at linear dependence.

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.

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

First, to find the eigenvalues an vectors by hand we need to solve:

Det(A - (eigenvalues * IdentityMatrix of A)) = 0

Which looks somthing like this

         [1-L, 2 , 3  ]
     det([0  ,4-L, 5  ]) = 0
         [0  , 0 , 6-L]

Which reduces to (where L is eigenvalue) (1-L)((4-L)(6-L)-0X5) - 2((6-L)X0-0X5) + 3((0X0)-(0X(4-L)))

Which after much reducing down gives us the factors: (-L + 6)(L - 4)(L - 1) Giving us eigenvalues of 6, 4, and 1.

Which also makes up the characteristic polynomial of A: -L^3 + 11L^2 - 34*L + 24

Now that we know the eigenvalues, we can plug them in to (A - L*Identity Matrix)x == 0

    [1-L, 2 , 3  ] [x1]
    [0  ,4-L, 5  ]*[x2]= 0
    [0  , 0 , 6-L] [x3]

Where L = 1 or 4 or 6

Eigenvector 1

So, for L = 1 we have:

    [0,2,3] [x1]
    [0,3,5]*[x2]= 0
    [0,0,5] [x3]

To make row reduction easier, we can also write like this

    [0,2,3|0]
    [0,3,5|0]
    [0,0,5|0]

Now, to perform row reduction, we need to use multiples of rows to subtract out matrix components so that the left most digits are 1s, and any number before the 1s are 0s (upper triangular matrix). I’ll spare you the exact steps, but the matrix for our first eigenvalue reduces to this:

    [0,1,0|0]
    [0,0,1|0]
    [0,0,0|0]
    
which also looks like this

1.) 0*x1 + 1*x2 + 0*x3 = 0
2.) 0*x1 + 0*x2 + 1*x3 = 0
3.) 0*x1 + 0*x2 + 0*x3 = 0

from row 1, we can tell that in order for the equation to hold, x2 must == 0

from row2, we can tell that x3 must == 0

If those are the case, than x1 can be anything. Thus, we can specify the eigenvector for L == 1 as:

                  [1]
eigenvector1 = x1*[0]
                  [0]
                  

Where x1 is any constant.

Now, let’s solve for the other two eigenvectors

Eigenvector 2

Same as the last time, but now we plug in L == 4, which gives us the following matrix

    [-3,2,3] [x1]
    [0 ,0,5]*[x2]= 0
    [0 ,0,2] [x3]
    
or 

    [-3,2,3|0]
    [0 ,0,5|0]
    [0 ,0,2|0]

Which reduces to somthing like this

[1,-2/3,0|0]
[0,  0 ,1|0]
[0,  0 ,0|0]

or

1.) 1*x1 - 2/3*x2 + 0*x3 = 0
2.) 0*x1 + 0*x2   + 1*x3 = 0
3.) 0*x1 + 0*x2   + 0*x3 = 0

So, from row 2 we can gather that x3 == 0

and from row 1, x1 needs to be exactly 2/3 of x2. Thus, x1 == 2*x2/3

Or one could also say that x2 == 3*x1/2

Thus, the eigen vector would look somthing like this:

                  [2/3]
eigenvector2 = x2*[ 1 ]
                  [ 0 ]

x2 is again, any constant. One might notice that the possible vectors include x2 == 3*x1/2

Eigenvector 3

And for the last eigenvalue, L=6 gives us the following matrix

    [-5,2,3] [x1]
    [0,-2,5]*[x2]= 0
    [0 ,0,0] [x3]
    
or 

    [-5,2,3|0]
    [0,-2,5|0]
    [0 ,0,0|0]

Which reduces to somthing like this

[1,0,-8/5|0]
[0,1,-5/2|0]
[0,0,  0 |0]

or

1.) 1*x1 + 0*x2  - 8/5*x3 = 0
2.) 0*x1 + 1*x2  - 5/2*x3 = 0
3.) 0*x1 + 0*x2  +   0*x3 = 0

So, from row 2 we can gather that x2 == 5/2*x3

and from row 1, we see that x1 == 8/5*x3

And becuase x3 does not have to be 0, we can simply say x3 = x3

Thus, the eigen vector would look somthing like this:

                  [8/5]
eigenvector3 = x3*[5/2]
                  [ 1 ]

x3 is again, any constant.

In summary:

the eigenvalues are 1, 4, and 6

and the corresponding eigenvectors (in the same order):

      
                  [1]
eigenvector1 = x1*[0]
                  [0]      
      
      
                  [2/3]
eigenvector2 = x2*[ 1 ]
                  [ 0 ]      
      
      
      
                  [8/5]
eigenvector3 = x3*[5/2]
                  [ 1 ]

where each vector can be followed by any constant