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 & -1 & 1 \\ 5 & 4 & -2 & -3 \\ \end{bmatrix}\)


Answer: I will find the reduced row-echelon form in order to determine the rank. Here I will do it by hand and then use the RREF function from pracma to confirm.

Add row 1 to row 2

A = \(\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 1 & -1 & 1 \\ 5 & 4 & -2 & -3 \\ \end{bmatrix}\)
 

Subtract (5*row1) from row 4

A = \(\begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 2 & 4 & 7 \\ 0 & 1 & -1 & 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 & -1 & 1 \\ 0 & -6 & -17 & -23 \\ \end{bmatrix}\)

 

Subtract (2*row2) from row 1

A = \(\begin{bmatrix} 1 & 0 & -1 & 3 \\ 0 & 1 & 2 & 7/2 \\ 0 & 1 & -1 & 1 \\ 0 & -6 & -17 & -23 \\ \end{bmatrix}\)

 

Subtract row 2 from row 3

A = \(\begin{bmatrix} 1 & 0 & -1 & 3 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & -3 & -5/2 \\ 0 & -6 & -17 & -23 \\ \end{bmatrix}\)

 

Add 6*row2 to row 4

A = \(\begin{bmatrix} 1 & 0 & -1 & 3 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & -3 & -5/2 \\ 0 & 0 & -5 & -2 \\ \end{bmatrix}\)
 

Divide row 3 by -3

A = \(\begin{bmatrix} 1 & 0 & -1 & 3 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 5/6 \\ 0 & 0 & -5 & -2 \\ \end{bmatrix}\)

 

Add row 3 to row 1

A = \(\begin{bmatrix} 1 & 0 & 0 & -3/16 \\ 0 & 1 & 2 & 7/2 \\ 0 & 0 & 1 & 5/6 \\ 0 & 0 & -5 & -2 \\ \end{bmatrix}\)

 

Subtract 2*row3 from row 2

A = \(\begin{bmatrix} 1 & 0 & 0 & -3/16 \\ 0 & 1 & 0 & 11/6 \\ 0 & 0 & 1 & 5/6 \\ 0 & 0 & -5 & -2 \\ \end{bmatrix}\)

 

Add 5*row3 to row4

A = \(\begin{bmatrix} 1 & 0 & 0 & -3/16 \\ 0 & 1 & 0 & 11/6 \\ 0 & 0 & 1 & 5/6 \\ 0 & 0 & 0 & 13/6 \\ \end{bmatrix}\)
 

Multiply row 4 by 6/13

A = \(\begin{bmatrix} 1 & 0 & 0 & -3/16 \\ 0 & 1 & 0 & 11/6 \\ 0 & 0 & 1 & 5/6 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix}\)
 

Add 13/6*row4 to row1

A = \(\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 11/6 \\ 0 & 0 & 1 & 5/6 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix}\)
 

Subtract row44*11/6 from row2

A = \(\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 5/6 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix}\)
 

Subtract 5/6*row4 from row3

A = \(\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix}\)
 

Thus the rank of matrix A is 4. To confirm:

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



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

In a matrix in which m>n, there are more rows than columns. The rank of a matrix can be defined as the maximum number of linearly independent rows or columns. In this case, the rank will be limited by the lesser of the two, meaning that the maximum rank is n. The minimum rank would be 1 because if the matrix is non-zero then at least one column will exist (and also be linearly independent).


3. What is the rank of the matrix B?

B = \(\begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 2 \\ 2 & 4 & 2 \\ \end{bmatrix}\)

Row3 = Row3 - 3*Row1

B = \(\begin{bmatrix} 1 & 2 & 1 \\ 3 & 6 & 2 \\ 0 & 0 & 0 \\ \end{bmatrix}\)

Row2 = Row2 - 3*Row1

B = \(\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & -1 \\ 0 & 0 & 0 \\ \end{bmatrix}\)

Row1 = Row1 + Row2

B = \(\begin{bmatrix} 1 & 2 & 0 \\ 0 & 0 & -1 \\ 0 & 0 & 0 \\ \end{bmatrix}\)

Row2 = Row2 * -1

B = \(\begin{bmatrix} 1 & 2 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \\ \end{bmatrix}\)

The rank of matrix B is 2.

B = matrix(c(1,2,1,3,6,2,2,4,2), nrow = 3, byrow = TRUE)
B
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    3    6    2
## [3,]    2    4    2
rref(B)
##      [,1] [,2] [,3]
## [1,]    1    2    0
## [2,]    0    0    1
## [3,]    0    0    0

Problem Set 2

1. 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}\)



First find the characteristic polynomial using det(A-xIn)

\(pA(x) = det \left( \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \\ \end{bmatrix} - \begin{bmatrix} x & 0 & 0 \\ 0 & x & 0 \\ 0 & 0 & x \\ \end{bmatrix} \right)\)

\(= det \left(\begin{bmatrix} 1-x & 2 & 3 \\ 0 & 4-x & 5 \\ 0 & 0 & 6-x \\ \end{bmatrix} \right)\)

\(= 1-x\cdot\begin{vmatrix} 4-x & 5 \\ 0 & 6-x \\ \end{vmatrix} - 2\cdot\begin{vmatrix} 0 & 5 \\ 0 & 6-x \\ \end{vmatrix} + 3\cdot\begin{vmatrix} 0 & 4-x \\ 0 & 0 \\ \end{vmatrix}\)

\(= (1-x)(24-10x+x^2)\)

\(= 24-10x+x^2-24x+10x^2-x^3\)

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

The characteristic polynomial is: \(-x^3+11x^2-34x+24\)

To confirm (the result of charpoly will have opposite signs than mine)

C = matrix(c(1,2,3,0,4,5,0,0,6), nrow = 3, byrow = TRUE)
C
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    0    4    5
## [3,]    0    0    6
charpoly(C)
## [1]   1 -11  34 -24

Factorizing this equation gives us the eigenvalues:

We can take a step back to use the representation of this equation that had a quadratic: \(= (1-x)(24-10x+x^2)\)

\(= (1-x)(x^2-10x+24)\)

\(= (1-x)(x-4)(x-6)\)

The eigenvalues are:

x=1

x=4

x=6

Plugging them in:

x=1

\(\left( \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \\ \end{bmatrix} - \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} \right) \cdot \begin{bmatrix} v_1 \\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

\(\begin{bmatrix} 0 & 2 & 3 \\ 0 & 3 & 5 \\ 0 & 0 & 5 \\ \end{bmatrix} \cdot \begin{bmatrix} v_1\\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

RREF gets this down to:

\(\begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \\ \end{bmatrix} \cdot \begin{bmatrix} v_1\\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

Which tells us that for the eigenvalue 1, v_1 = v_1 while v_2 and v_3 = 0.

The eigenvector:

\(\begin{bmatrix} v_1\\ 0 \\ 0 \\ \end{bmatrix}\)

x=4

\(\left( \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \\ \end{bmatrix} - \begin{bmatrix} 4 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 4 \\ \end{bmatrix} \right) \cdot \begin{bmatrix} v_1 \\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

\(\begin{bmatrix} -3 & 2 & 3 \\ 0 & 0 & 5 \\ 0 & 0 & 2 \\ \end{bmatrix} \cdot \begin{bmatrix} v_1\\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

RREF gets this down to:

\(\begin{bmatrix} 1 & -2/3 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \\ \end{bmatrix} \cdot \begin{bmatrix} v_1\\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

Which tells us that for the eigenvalue 4, v_1 = 2/3 v_2 while v_2=v_2 and v_3 = 0.

The eigenvector:

\(\begin{bmatrix} 2/3 v_2\\ v_2 \\ 0 \\ \end{bmatrix}\)

x=6

\(\left( \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \\ \end{bmatrix} - \begin{bmatrix} 6 & 0 & 0 \\ 0 & 6 & 0 \\ 0 & 0 & 6 \\ \end{bmatrix} \right) \cdot \begin{bmatrix} v_1 \\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

\(\begin{bmatrix} -5 & 2 & 3 \\ 0 & 2 & 5 \\ 0 & 0 & 0 \\ \end{bmatrix} \cdot \begin{bmatrix} v_1\\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

RREF gets this down to:

\(\begin{bmatrix} 1 & 0 & -8/5 \\ 0 & 1 & -5/2 \\ 0 & 0 & 0 \\ \end{bmatrix} \cdot \begin{bmatrix} v_1\\ v_2 \\ v_3 \\ \end{bmatrix} = 0\)

Which tells us that for the eigenvalue 6, v_1 = 8/5 v_3 while v_2=-5/2 v_3 and v_3 = v_3.

The eigenvector:

\(\begin{bmatrix} 8/5 v_3\\ -5/2 v_3 \\ v_3 \\ \end{bmatrix}\)