ASSIGNMENT 3 IS 605 FUNDAMENTALS OF COMPUTATIONAL MATHEMATICS - 2014

  1. Problem set 1
  1. What is the rank of the matrix A?
library(pracma)
A <- matrix(
    c(
        1,2,3,4,
        -1,0,1,3,
        0,1,-2,1,
        5,4,-2,-3
    )
    ,
    4,4,
    byrow = TRUE
)
A
##      [,1] [,2] [,3] [,4]
## [1,]    1    2    3    4
## [2,]   -1    0    1    3
## [3,]    0    1   -2    1
## [4,]    5    4   -2   -3
Rank(A)
## [1] 4

Answer: Rank of matrix A is 4.

  1. Given an mxn matrix where m > n, what can be the maximum rank? The mini- mum rank, assuming that the matrix is non-zero? Answer: The maximum rank is equal to the number of non-zero rows in its row echelon matrix i.e. equal to m. The minimum rank is one.
  2. What is the rank of matrix B?
B <- matrix(
    c(1,2,1,
      3,6,3,
      2,4,2),
    3,3,
    byrow = TRUE
)
B
##      [,1] [,2] [,3]
## [1,]    1    2    1
## [2,]    3    6    3
## [3,]    2    4    2
Rank(B)
## [1] 1

Answer: Rank of B is 1.

  1. 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. Answer:

A <- matrix(c(
    1,2,3,
    0,4,5,
    0,0,6
), 3, 3 , byrow = TRUE)
A
##      [,1] [,2] [,3]
## [1,]    1    2    3
## [2,]    0    4    5
## [3,]    0    0    6
# install.packages("matlib")
library(matlib)
## 
## Attaching package: 'matlib'
## The following objects are masked from 'package:pracma':
## 
##     angle, inv

Eigen Value of A

ev <- eigen(A)
ev$values
## [1] 6 4 1

Eigenvector of A

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

Characteristic polynomial

Ap <- charpoly(A, info = TRUE)
## Error term: 0
Ap$cp
## [1]   1 -11  34 -24