DATA 605: Week 3 Assignment

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

The rank of a Matrix is the maximum number of independent rows (or, the maximum number of independent columns). A square matrix \(A_{n×n}\) is non-singular only if its rank is equal to n.

The process for computing the rank involves translating a matrix into echelon form. Putting this matrix into echelon form will be a tedious process but we will go through each and every step.

Add the first row to the second row \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 1 & -2 & 1 \\ 5 & 4 & -2 & -3 \end{bmatrix} \]

Add -5 times row 1 to row 4 \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 1 & -2 & 1 \\ 0 & -6 & -17 & -23 \end{bmatrix} \] Divide row 2 by 2 \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 1 & -2 & 1 \\ 0 & -6 & -17 & -23 \end{bmatrix} \]

subtract the second row from the first row \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & -4 & -5/2 \\ 0 & -6 & -17 & -23 \end{bmatrix} \]

6 times row 2 plus row 4 \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & -4 & -5/2 \\ 0 & 0 & -5 & -2 \end{bmatrix} \]

Divide row 3 by -4 \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 5/8 \\ 0 & 0 & -5 & -2 \end{bmatrix} \]

5 times row 3 plus row 4 \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 5/8 \\ 0 & 0 & 0 & 9/8 \end{bmatrix} \]

divide row 4 by 9/8 \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 5/8 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]

Add -5/8 row 4 to row 3 \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]

-7/2 row 4 plus row 2 \[ A=\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \] add-4 times row 1 to row 4 \[ A=\begin{bmatrix} 1 & 2 & 3 & 0 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]

-2 times row 3 plus row 2 \[ A=\begin{bmatrix} 1 & 2 & 3 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \] We can bundle the next row operations since rows 2-4 will remain unchanged -3 times row 3 to row 1 -2 times row 2 plus row 1 \[ A=\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]

The rank of matrix A is 4 since there are 4 non zero linearly independent rows

Let’s Verified

#Let's store information in Matrix
A <- matrix( 
   c(1,2,3,4,-1,0,1,3,0,1,-2,1,5,4,-2,-3), # the data elements 
   nrow=4,              # number of rows 
   ncol=4,              # number of columns 
   byrow = TRUE)        # fill matrix by rows 

qr(A)$rank
[1] 4

Answer Confirmed

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

We know that let \(rank(A_{m*n})\) = rank of matrix A, where matrix A is an m x n matrix and m>n \[ rank(A_{m*n})\le \min(m,n) \] n if all n columns are linearly independent. \[ rank(A_{m*n})\le n \] Minimum Rank for m *n where m >n is 1 as matrix is non-zero ; it will have one linear independent columns. \[ rank(A_{m*n})\ge 1 \] Thus the minimum rank of matrix A would be 1

(3) What is the rank of matrix B?

\[ B=\begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 3 \\ 2 & 4 & 2 \end{bmatrix} \] We need to follows the same procedure as problem 1 to find the rank of matrix B.

-3 times row 1 plus row 2 \[ B=\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 2 & 4 & 2 \end{bmatrix} \]

-2 times row 1 plus row 3 \[ B=\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} \] Thus, The rank of matrix B is 1

#In R
#Let's store information in Matrix
B <- matrix( 
   c(1,2,1,3,6,3,2,4,2), # the data elements 
   nrow=3,              # number of rows 
   ncol=3,              # number of columns 
   byrow = TRUE)        # fill matrix by rows 

qr(B)$rank
[1] 1

Both Answers are same

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=\begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} \] As we know \(Ax=\lambda x\\det(A-I\lambda)=0\),

\[ \begin{aligned} \begin{vmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{vmatrix} - \lambda \begin{vmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{vmatrix} &= \begin{vmatrix} 1-\lambda & 2 & 3 \\ 0 & 4-\lambda & 5 \\ 0 & 0 & 6-\lambda \end{vmatrix} \\ &=(1-\lambda)\begin{vmatrix} 4-\lambda & 5\\ 0 & 6-\lambda \end{vmatrix} -2 \begin{vmatrix} 0 & 5 \\ 0 & 6-\lambda \end{vmatrix} + 3 \begin{vmatrix} 0 & 4-\lambda \\ 0 & 0 \end{vmatrix} \\ &=(1- \lambda)((4- \lambda)(6-\lambda))+2(0-0)+3(0-0)\\ &=(1- \lambda)(4-\lambda)(6-\lambda)-0+0\\ &=(1-\lambda)(24-4\lambda-6\lambda+\lambda^{2})\\ &=(1-\lambda)(24-10\lambda+\lambda^{2})\\ &=24-10\lambda+\lambda^{2}-24\lambda+10\lambda^{2}-\lambda^{3}\\ &=-\lambda^{3}+11\lambda^{2}-34\lambda+24\\ &=\lambda^{3}-11\lambda^{2}+34\lambda-24 \end{aligned} \] Characteristic polynomial of the matrix is

\(pA(x)=x^3-11x^2+34x-24\)

Let’s Verified

#Let's store information in Matrix
A <- matrix( 
   c(1,2,3,0,4,5,0,0,6), # the data elements 
   nrow=3,              # number of rows 
   ncol=3,              # number of columns 
   byrow = TRUE)        # fill matrix by rows 

#polynomial of the matrix
charpoly(A)
[1]   1 -11  34 -24

Thus, characteristic equation is verified

Lets use R to verify our eigenvalues

#
e <- eigen(A)

#Eigen Values
e$values
[1] 6 4 1
#Eigen Vectors
e$vectors
          [,1]      [,2] [,3]
[1,] 0.5108407 0.5547002    1
[2,] 0.7981886 0.8320503    0
[3,] 0.3192754 0.0000000    0

Vinayak Patel

2019-09-15