Let B and A be a 2 by 2 matrix and ‘a’ a numeric constant as following.
Note: function runif(n, min, max), generates n numbers of random values using uniform distribution in max and min boundary.
A <- matrix(runif(2*2, min=0, max=10), ncol=2)
B <- matrix(runif(2*2, min=0, max=10), ncol=2)
a <- runif(1)
print(A)
## [,1] [,2]
## [1,] 6.0 8.0
## [2,] 8.7 3.8
print(B)
## [,1] [,2]
## [1,] 1.7 2.5
## [2,] 1.3 6.4
print(a)
## [1] 0.85
all.equal(det(A), det(t(A)))
## [1] TRUE
all.equal(det(a*A), (a^nrow(A))*det(A))
## [1] TRUE
Note: %*% represents matrix multiplication.
all.equal(det(A%*%B), det(A)*det(B))
## [1] TRUE
For evaluating last theorem, we need to construct a complex matrix.
Lets sum A and a complex matrix which only contains imaginary values.
A <- A + matrix(1i*runif(2*2, min=0, max=10), ncol=2)
print(A)
## [,1] [,2]
## [1,] 6.0+0.1i 8.0+4.3i
## [2,] 8.7+0.3i 3.8+9.9i
Since R does not have H(x) function, knowing that \(H(A) = Conj(t(A))\), we can construct:
H <- function(x){
Conj(t(x))
}
# r-base::det function does not defined for complex matrices
# thus we need to use Det function from 'complexplus' package
suppressMessages(require(complexplus))
all.equal(Det(A), Conj(Det(H(A))))
## [1] TRUE