Source files: [https://github.com/djlofland/DATA605_S2020/tree/master/]

Problem Set 1

  1. What is the rank of matrix \(A\)?

\[A = \left[\begin{array}\\ 1 & 2 & 3 & 4\\ -1 & 0 & 1 & 3\\ 0 & 1 & -2 & 1\\ 5 & 4 & -2 & -3\\\end{array}\right]\]

Rank: 4 since it is a square matrix and no rows are scalar equivalents or can be formed by combining other rows

# Verify my answer
library(Matrix)
a <- matrix(c(1,2,3,4,-1,0,1,3,0,1,-2,1,5,4,-2,-3), nrow=4, byrow=TRUE)
rankMatrix(a)
## [1] 4
## attr(,"method")
## [1] "tolNorm2"
## attr(,"useGrad")
## [1] FALSE
## attr(,"tol")
## [1] 8.881784e-16
  1. Given an \(m \text{x} n\) matrix where \(m > n\), what can be the maximum rank? THe minimum rank, assuming that the matrix is non-zero?

Max rank is \(n\), the smaller value; the minimum rank is 1 assuming all the rows are scalar equivalents

  1. What is the rank of matrix \(B\)?

\[B = \left[\begin{array}\\ 1 & 2 & 1\\ 3 & 6 & 3\\ 2 & 4 & 2\\\end{array}\right]\]

Rank: 1 since all 3 rows are scalar equivalents

# Verify my answer
a <- matrix(c(1,2,1,3,6,3,2,4,2), nrow=3, byrow=TRUE)
rankMatrix(a)
## [1] 1
## attr(,"method")
## [1] "tolNorm2"
## attr(,"useGrad")
## [1] FALSE
## attr(,"tol")
## [1] 6.661338e-16

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 = \left[\begin{array}\\ 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6\\\end{array}\right]\]

Please show your work using R-markdown document. Please name your assignment submission with your first initial and last name.

\[\begin{align} p_{A} (x) &= det (A -xI{_n})\\ p_{A} (x) &= \left|\begin{array}\\(1-x) & 2 & 3\\0 & (4-x) & 5\\0 & 0 & (6-x)\\\end{array} \right|\\ p_{A} (x) &= (1-x)(4-x)(6-x) - (2)0 + (3)(0)\\ &= (4-4x+x^2)(6-x)\\ &= 24-24x+6x^2-4x+4x^2-x^3\\ &= -x^3 + 10x^2 - 28x + 24 \end{align}\]\

Characteristic polynomial: \(-x^3 + 10x^2 - 28x + 24\)

Eigenvalues are: x=1, x=4 and x=6

\[\begin{align} x=1\text{: }A - 1I_3 = \left[\begin{array}\\ 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6\\\end{array}\right] - 1\left[\begin{array}\\ 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\\\end{array}\right] = \left[\begin{array}\\ 0 & 2 & 3\\ 0 & 3 & 5\\ 0 & 0 & 5\\\end{array}\right]\\ \left[\begin{array}\\ 0 & 2 & 3\\ 0 & 3 & 5\\ 0 & 0 & 5\\\end{array}\right] \xrightarrow[\text{ }]{\text{R1/2}} \left[\begin{array}\\ 0 & 1 & \frac{3}{2}\\ 0 & 3 & 5\\ 0 & 0 & 5\\\end{array}\right] \xrightarrow[\text{ }]{\text{R2-3R1}} \left[\begin{array}\\ 0 & 1 & \frac{3}{2}\\ 0 & 0 & \frac{1}{2}\\ 0 & 0 & 5\\\end{array}\right] \xrightarrow[\text{ }]{\text{R1-3R2}} \left[\begin{array}\\ 0 & 1 & 0\\ 0 & 0 & \frac{1}{2}\\ 0 & 0 & 5\\\end{array}\right] \xrightarrow[\text{ }]{\text{R3-10R2}} \left[\begin{array}\\ 0 & 1 & 0\\ 0 & 0 & \frac{1}{2}\\ 0 & 0 & 0\\\end{array}\right] \xrightarrow[\text{ }]{\text{2R2}} \left[\begin{array}\\ 0 & 1 & 0\\ 0 & 0 & 1\\ 0 & 0 & 0\\\end{array}\right]\\ x=4\text{: }A - 4I_3 = \left[\begin{array}\\ 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6\\\end{array}\right] - 4\left[\begin{array}\\ 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\\\end{array}\right] = \left[\begin{array}\\ -3 & 2 & 3\\ 0 & 0 & 5\\ 0 & 0 & 2\\\end{array}\right]\\ \left[\begin{array}\\ -3 & 2 & 3\\ 0 & 0 & 5\\ 0 & 0 & 2\\\end{array}\right] \xrightarrow[\text{ }]{\text{R1/-3}} \left[\begin{array}\\ 1 & -\frac{2}{3} & 1\\ 0 & 0 & 5\\ 0 & 0 & 2\\\end{array}\right] \xrightarrow[\text{ }]{\text{R2/5}} \left[\begin{array}\\ 1 & -\frac{2}{3} & 0\\ 0 & 0 & 1\\ 0 & 0 & 2\\\end{array}\right] \xrightarrow[\text{ }]{\text{R3-2R2}} \left[\begin{array}\\ 1 & -\frac{2}{3} & 0\\ 0 & 0 & 1\\ 0 & 0 & 0\\\end{array}\right]\\ x=6\text{: }A - 6I_3 = \left[\begin{array}\\ 1 & 2 & 3\\ 0 & 4 & 5\\ 0 & 0 & 6\\\end{array}\right] - 6\left[\begin{array}\\ 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\\\end{array}\right] = \left[\begin{array}\\ -5 & 2 & 3\\ 0 & -2 & 5\\ 0 & 0 & 0\\\end{array}\right]\\ \left[\begin{array}\\ -5 & 2 & 3\\ 0 & -2 & 5\\ 0 & 0 & 0\\\end{array}\right] \xrightarrow[\text{ }]{\text{R1=R1+R2}} \left[\begin{array}\\ -5 & 0 & 8\\ 0 & -2 & 5\\ 0 & 0 & 0\\\end{array}\right] \xrightarrow[\text{ }]{\text{R1/-5}} \left[\begin{array}\\ 1 & 0 & -\frac{8}{5}\\ 0 & -2 & 5\\ 0 & 0 & 0\\\end{array}\right] \xrightarrow[\text{ }]{\text{R2/-2}} \left[\begin{array}\\ 1 & 0 & -\frac{8}{5}\\ 0 & 1 & -\frac{5}{2}\\ 0 & 0 & 0\\\end{array}\right]\\ x=1, \left[\begin{array}\\ 1\\ 1\\ 1\\\end{array}\right];\ \ \ x=4, \left[\begin{array}\\ \frac{2}{3}\\ 1\\ 1\\\end{array}\right];\ \ \ x=6, \left[\begin{array}\\ \frac{8}{5}\\ \frac{5}{2}\\ 1\\\end{array}\right]\\\end{align}\]

# verify reduced eschelon forms for each eigenvalue
library(pracma)
## 
## Attaching package: 'pracma'
## The following objects are masked from 'package:Matrix':
## 
##     expm, lu, tril, triu
a <- matrix(c(0,2,3,0,3,5,0,0,5), nrow=3, byrow=TRUE)
rref(a)
##      [,1] [,2] [,3]
## [1,]    0    1    0
## [2,]    0    0    1
## [3,]    0    0    0
a <- matrix(c(-3,2,3,0,0,5,0,0,2), nrow=3, byrow=TRUE)
rref(a)
##      [,1]       [,2] [,3]
## [1,]    1 -0.6666667    0
## [2,]    0  0.0000000    1
## [3,]    0  0.0000000    0
a <- matrix(c(-5,2,3,0,-2,5,0,0,0), nrow=3, byrow=TRUE)
rref(a)
##      [,1] [,2] [,3]
## [1,]    1    0 -1.6
## [2,]    0    1 -2.5
## [3,]    0    0  0.0