Matrix Determinant
Overview
The matrix determinant
is a number computed from a square matrix. Geometrically, the determinant reprsents the volume of the column vectors of the matrix.
Calculation
The determinant is defined to be
{% det(A) = \sum_{\sigma \in S_n} (sgn(\sigma) \prod{a_{i,\sigma_i}}) %}
where {% \sigma %} is a permutation. (see
Permuations)
This can be shown to be equivalent to
{% det(A) = \sum_{j=1}^n a_{ij} det(cofactor_{ij}(A)) %}
where {% cofactor_{ij}(A) %} is the matrix obtained from {% A %} by removing the ith row and jth column.
Properties
{% det(AB) = det(A) \times det(B) %}
Algorithm
When implemented in code, the determinant is often computed from an
LU Decomposition
of the matrix.
{% A = LU %}
The determinant is then given by
{% det(A) = det(L) \times det(U) %}
The determinant of a triangular matrix is the product of the elements along the diagonal.
Examples
The determinant of a simple 2x2 matrix has the following form
{%
\begin{vmatrix}
a & b \\
c & d \\
\end{vmatrix} = ad - bc
%}
The determinant of a 3x3 matrix can be written as a weighted sum of the determinants of the so called cofactors of the
original matrix.
{%
\begin{vmatrix}
a & b & c \\
d & e & f\\
g & h & i \\
\end{vmatrix} = a \begin{vmatrix}
e & f \\
h & i \\
\end{vmatrix} - b \begin{vmatrix}
d & f \\
g & i \\
\end{vmatrix} + c \begin{vmatrix}
d & e \\
g & h \\
\end{vmatrix}
%}
Geometric Interpretation
The determinant is shown to be the volume of the parallelepiped spanned by the column vectors of the matrix.
Axioms
Axiom 1
{% d(...,tA_k,...) = t d(...,A_k,...) %}
Axiom 2
{% d(...,A_k+C,...) = d(...,A_k,...) + d(...,C,...) %}
Axiom 3
{% d(A_1,...,A_n) = 0 %}
if any two columns (or rows) are equal
Axiom 4
The determinant of the Identity matrix is 1.
Scripting
The linear algebra module contains a method for calculating the matrix determinant.
let la = await import('/lib/linear-albgebra/v1.0.0/linear-algebra.mjs');
let ans = la.determinant(matrix1);
Try it!