Data 605 Assignment 3
library(knitr)
library(rmdformats)
## Global options
options(max.print="31")
# opts_chunk$set(echo=FALSE,
# cache=TRUE,
# prompt=FALSE,
# tidy=TRUE,
# comment=NA,
# message=FALSE,
# warning=FALSE)
opts_knit$set(width=31)
library(Matrix)Problem Set 1
1.1
What is the rank of the matrix A? \[\begin{equation*} \begin{split} A = \begin{bmatrix} 1 & 2 & 3 & 4\\ -1 & 0 & 1 & 3\\ 0 & 1 & -2 & 1\\ 5 & 4 & -2 & -3 \end{bmatrix} \end{split} \end{equation*}\]
## [1] 4
Ans: Rank of matrix A is 4.
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?
Ans: The maximum rank of the given matrix with dimension m x n where m > n is n. The maximum number of linearly independent rows in a matrix is called row rank where column rank corresponds to the linearly independent columns in a matrix. So, by definition, the maximum rank is the minimum between the m and n, i.e. n.
If the matrix is non-zero, the minimum rank is 1 as there is, at least, one lineary independent column vector or row vector in the matrix.
Problem set 2
Compute the eigenvalues and eigenvectors of the matrix A.
\[\begin{equation*} \begin{split} A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix} \end{split} \end{equation*}\]
Ans: To find the eigenvalue of matrix A, we solve for det(\(\lambda I_3\) - A) = 0
\[\begin{equation*} \begin{split} \lambda I_3 - A &= \begin{bmatrix} \lambda -1 & -2 & -3 \\ 0 & \lambda -4 & -5 \\ 0 & 0 & \lambda -6 \end{bmatrix} \\ det(\lambda I_3 - A) & = (\lambda - 1)(\lambda - 4)(\lambda - 6)+ (-2)(-5)(0) + (-3)(0)(0) - (0)(\lambda - 4)(-3) - (0)(-5)(\lambda - 5) - (\lambda-6)(0)(-2) \\ & = (\lambda - 1)(\lambda - 4)(\lambda - 6) \\ & = \lambda^3 - 11 \lambda^2 + 34 \lambda -24 \end{split} \end{equation*}\]
All the possible eigenvalues are then = 1, = 4, = 6
Therefore, the characteristic polynomial of matrix A is \(p_{A}(x)=x^3−11x^2+34x−24\).
Finally, let’s solve for all the eigenvectors for each eigenvalue of A.
To solve for eigenvcectors, we try to get the matrix transformed to its reduced row echelon form.
Definition RREF: Reduced Row-Echelon Form. A matrix is in reduced row-echelon form if it meets all of the following conditions:
1. If there is a row where every entry is zero, then this row lies below any other row that contains a nonzero entry.
2. The leftmost nonzero entry of a row is equal to 1.
3. The leftmost nonzero entry of a row is the only nonzero entry in its column.
4. Consider any two different leftmost nonzero entries, one located in row i, column j and the other located in row s, column t. If s > i, theb t > j.
Eigenvectors
lambda = 1
\[\begin{multline*} \begin{split} (\lambda I_3 - A) \vec{v} & = 0 \\ \\ For \space \lambda = 1, \space \begin{bmatrix} 1-1 & -2 & -3 \\ 0 & 1-4 & -5 \\ 0 & 0 & 1 - 6 \end{bmatrix}\vec{v} & = 0\\ \begin{bmatrix} 0 & -2 & -3 \\ 0 & -3 & -5 \\ 0 & 0 & -5 \end{bmatrix}\vec{v} & = 0\\ Multiplying \space the \space 1st \space row \space by \space -1/2, \space \begin{bmatrix} 0 & -2 & -3 \\ 0 & -3 & -5 \\ 0 & 0 & -5 \end{bmatrix} & \longrightarrow \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & -3 & -5 \\ 0 & 0 & -5 \end{bmatrix} \\ Adding \space 3 \space times \space the \space 1st \space row \space to \space the \space 2nd\space row, \space \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & -3 & -5 \\ 0 & 0 & -5 \end{bmatrix} & \longrightarrow \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 0 & -1/2 \\ 0 & 0 & -5 \end{bmatrix} \\ Multiplying \space the \space 2nd \space row \space by \space -2, \space \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 0 & -1/2 \\ 0 & 0 & -5 \end{bmatrix} & \longrightarrow \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 0 & 1 \\ 0 & 0 & -5 \end{bmatrix} \\ Adding \space 5 \space times \space the \space 2nd \space row \space to \space the \space 3rd \space row, \space \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 0 & 1 \\ 0 & 0 & -5 \end{bmatrix} & \longrightarrow \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} \\ Adding \space -3/2 \space times \space the \space \space 2nd \space row \space to \space the \space 1st \space row, \space \begin{bmatrix} 0 & 1 & 3/2 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} & \longrightarrow \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} \\ \\ \\ \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} & = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \end{split} \end{multline*}\]
\(v_1\) = t | t \(\in \mathbb{R}, v_2 = 0, v_3 = 0\)
\(\therefore\) eigenvector, \(\vec{v}_{\lambda=1} = \begin{bmatrix}1 \\ 0 \\ 0 \end{bmatrix}\)
lambda = 4
\[\begin{multline*} \begin{split} (\lambda I_3 - A) \vec{v} & = 0 \\ \\ For \space \lambda = 4, \space \begin{bmatrix} 4-1 & -2 & -3 \\ 0 & 4-4 & -5 \\ 0 & 0 & 4 - 6 \end{bmatrix}\vec{v} & = 0\\ \begin{bmatrix} 3 & -2 & -3 \\ 0 & 0 & -5 \\ 0 & 0 & -2 \end{bmatrix}\vec{v} & = 0\\ Multiplying \space the \space 1st \space row \space by \space 1/3, \space \begin{bmatrix} 3 & -2 & -3 \\ 0 & 0 & -5 \\ 0 & 0 & -2 \end{bmatrix} & \longrightarrow \begin{bmatrix} 1 & -2/3 & -1 \\ 0 & 0 & -5 \\ 0 & 0 & -2 \end{bmatrix} \\ Multiplying \space the \space 2nd \space row \space by \space -1/5, \space \begin{bmatrix} 1 & -2/3 & -1 \\ 0 & 0 & -5 \\ 0 & 0 & -2 \end{bmatrix} & \longrightarrow \begin{bmatrix} 1 & -2/3 & -1 \\ 0 & 0 & 1 \\ 0 & 0 & -2 \end{bmatrix} \\ Adding \space 2 \space times \space 2nd \space row \space to \space the \space 3rd \space row, \space \begin{bmatrix} 1 & -2/3 & -1 \\ 0 & 0 & 1 \\ 0 & 0 & -2 \end{bmatrix} & \longrightarrow \begin{bmatrix} 1 & -2/3 & -1 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} \\ Adding \space 2nd \space row \space to \space 1st \space row, \space \begin{bmatrix} 1 & -2/3 & -1 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} & \longrightarrow \begin{bmatrix} 1 & -2/3 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} \\ \\ \\ \begin{bmatrix} 1 & -2/3 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} & = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \end{split} \end{multline*}\]
\(v_1 = \frac{2}{3} v_2 = t \space | \space t \in \mathbb{R}, v_3 = 0\)
\(\therefore\) eigenvector, \(\vec{v}_{\lambda=4} = \begin{bmatrix}1 \\ 1.5 \\ 0 \end{bmatrix}\)
lambda = 6
\[\begin{multline*} \begin{split} (\lambda I_3 - A) \vec{v} & = 0 \\ \\ For \space \lambda = 6, \space \begin{bmatrix} 6-1 & -2 & -3 \\ 0 & 6-4 & -5 \\ 0 & 0 & 6 - 6 \end{bmatrix}\vec{v} & = 0\\ \begin{bmatrix} 5 & -2 & -3 \\ 0 & 2 & -5 \\ 0 & 0 & 0 \end{bmatrix}\vec{v} & = 0\\ Multiplying \space the \space 1st \space row \space by \space 1/5, \space \begin{bmatrix} 5 & -2 & -3 \\ 0 & 2 & -5 \\ 0 & 0 & 0 \end{bmatrix} & \longrightarrow \begin{bmatrix} 1 & -2/5 & -3/5 \\ 0 & 2 & -5 \\ 0 & 0 & 0 \end{bmatrix} \\ Multiplying \space the \space 2nd \space row \space by \space 1/2, \space \begin{bmatrix} 1 & -2/5 & -3/5 \\ 0 & 2 & -5 \\ 0 & 0 & 0 \end{bmatrix} & \longrightarrow \begin{bmatrix} 1 & -2/5 & -3/5 \\ 0 & 1 & -5/2 \\ 0 & 0 & 0 \end{bmatrix} \\ Adding \space 2/5 \space times \space 2nd \space row \space to \space the \space 1st \space row, \space \begin{bmatrix} 1 & -2/5 & -3/5 \\ 0 & 1 & -5/2 \\ 0 & 0 & 0 \end{bmatrix} & \longrightarrow \begin{bmatrix} 1 & 0 & -8/5 \\ 0 & 1 & -5/2 \\ 0 & 0 & 0 \end{bmatrix} \\ \\ \\ \begin{bmatrix} 1 & 0 & -8/5 \\ 0 & 1 & -5/2 \\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} & = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \end{split} \end{multline*}\]
\(v_1 = \frac{8}{5} v_3, \space v_2 = \frac{5}{2} v_3, \space v_3 = t \space | \space t \in \mathbb{R}\)
\(\therefore\) eigenvector, \(\vec{v}_{\lambda=6} = \begin{bmatrix}1.6 \\ 2.5 \\ 1 \end{bmatrix}\)