ASSIGNMENT 3 IS 605 FUNDAMENTALS OF COMPUTATIONAL MATHEMATICS - 2014

  1. Problem set 1
  1. What is the rank of the matrix A?

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

Answer:

A <- as.matrix(data.frame(c(1,-1,0,5),c(2,0,1,4),c(3,1,-2,-2),c(4,3,1,-3)))
A
##      c.1...1..0..5. c.2..0..1..4. c.3..1...2...2. c.4..3..1...3.
## [1,]              1             2               3              4
## [2,]             -1             0               1              3
## [3,]              0             1              -2              1
## [4,]              5             4              -2             -3
# let's calculate the eigenvalues and eigenvectors
e <- eigen(A)
e$values
## [1] -6.5370158  4.9160628 -2.2548449 -0.1242021
e$vectors
##             [,1]       [,2]       [,3]       [,4]
## [1,]  0.30157231 -0.7824404  0.1529780 -0.6391760
## [2,]  0.42172776 -0.2140361 -0.4181690  0.6770151
## [3,]  0.09436848 -0.1138837 -0.6736565  0.1973298
## [4,] -0.84987906 -0.5735906  0.5898469 -0.3068642

After calculating the eigenvalues adn eigenvectors, we can say that Rank of matrix A is 4 because the reduced matrix has 4 pivots.

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

Answer:

Here, since in matrix m x n, m > n, the maximum row-rank should be the value of n because the maximum number of linear independent is always equal to the row vectors of the n.

If m < n, the the maximum row-rank should be the value of m. And if there has no elements the rank of the element would be 0.

So, if there is even 1 element in the matrix, its rank would be 1.

  1. What is the rank of matrix B?

Answer:

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

B <- as.matrix(data.frame(c(1,3,2),c(2,6,4),c(1,3,2)))

B
##      c.1..3..2. c.2..6..4. c.1..3..2..1
## [1,]          1          2            1
## [2,]          3          6            3
## [3,]          2          4            2
# trying to get the rank and omitting the zeros
B<- matrix(c(1,2,1,0,0,0,2,4,2), nrow=3, ncol=3, byrow=TRUE)
B
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    0    0    0
## [3,]    2    4    2
#Multiply the 1st row by 2 and subtract it from the 3rd row
B<- matrix(c(1,2,1,0,0,0,0,0,0), nrow=3, ncol=3, byrow=TRUE)
B
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    0    0    0
## [3,]    0    0    0

From the above calculations we can say that Rank of matrix B is 1.

  1. Problem set 2 Compute the eigenvalues and eigenvectors of the matrix X. You’ll need to show your work. You’ll need to write out the characteristic polynomial and show your solution. \[\mathbf{X} = \left[\begin{array} {rrr} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \\ \end{array}\right] \]

I changed the A to X matrix, otherwise it will take the old A value.

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

X <- as.matrix(data.frame(c(1,0,0),c(2,4,0),c(3,5,6)))

X
##      c.1..0..0. c.2..4..0. c.3..5..6.
## [1,]          1          2          3
## [2,]          0          4          5
## [3,]          0          0          6
# let's calculate the eigenvalues and eigenvectors
e <- eigen(X)
e$values
## [1] 6 4 1

Here, eigen values are 6 4 and 1

# eigen vectors are
e$vectors
##           [,1]      [,2] [,3]
## [1,] 0.5108407 0.5547002    1
## [2,] 0.7981886 0.8320503    0
## [3,] 0.3192754 0.0000000    0