I will be solving Exercise DM.C22

install.packages(‘matlib’)

library(matlib)
## Warning: package 'matlib' was built under R version 3.5.1

Theorem DMST : Determinant of Matrices(A) of Size 2

det(A) = ad - bc

cat("Matrix A", "\n", "\n")
## Matrix A 
## 
(A = matrix(c(1,3,2,6), ncol = 2, byrow = TRUE))
##      [,1] [,2]
## [1,]    1    3
## [2,]    2    6

Now calculating the determinant manually:

(Manual_Det_A = (1*6 - 2*3))
## [1] 0

Manual_Det_A is 0

Now lets try using the function in R:

(Det_Using_R = det(A))
## [1] 0

Det_Using_R is also 0