Differences between revisions 10 and 17 (spanning 7 versions)
Revision 10 as of 2025-09-24 16:29:03
Size: 4512
Comment: Added name
Revision 17 as of 2026-01-21 16:26:27
Size: 4992
Comment: Link
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The '''determinant''' is a number that embeds most information about a square matrix. Chiefly, for a matrix used to transform [[LinearAlgebra/Basis#Change_of_Basis|bases]], the determinant is the scaling factor of space in the transformation. The '''determinant''' is a number that embeds most information about a matrix, much like the [[LinearAlgebra/Trace|trace]]. Most importantly it is the scaling factor of a [[LinearAlgebra/LinearMapping|transformation]].
Line 13: Line 13:
The determinant is the product of [[LinearAlgebra/EigenvaluesAndEigenvectors|eigenvalues]]: ''Π,,i,, λ,,i,,''.

There is an important connection between determinants and [[LinearAlgebra/Elimination|elimination]]. A matrix does not need to be eliminated to arrive at the determinant, but if a matrix ''cannot'' be eliminated into an upper triangular matrix, it is '''singular''' and '''degenerate''' and '''non-invertible''' and the determinant is 0. This generally only happens if there is multicolinearity. This does lead to a convenient test for [[LinearAlgebra/Invertibility|invertibility]].
Line 15: Line 19:
The determinant of any non-square matrix is 0.
Line 17: Line 20:
Given a matrix of shape 2 by 2, the determinant is calculated like:
=== Simple Case ===

Given a matrix of shape ''2 x 2'', the determinant is calculated like:
Line 24: Line 30:
There is an important connection between determinants and [[LinearAlgebra/Elimination|elimination]]. A matrix does not need to be eliminated to arrive at the determinant, but if a matrix ''cannot'' be eliminated into an upper triangular matrix, it is '''singular''' and '''degenerate''' and '''non-invertible''' and the determinant is 0. This generally only happens if there is multicolinearity. This does lead to a convenient test for [[LinearAlgebra/Invertability|invertability]].

Line 31: Line 34:
The determinant of any non-square matrix is 0.
Line 33: Line 38:
The determinant of the [[LinearAlgebra/Invertability|inverse]] is the inverse of the determinant: ''|'''A'''^-1^| = 1/|'''A'''|''. The determinant of the [[LinearAlgebra/Invertibility|inverse]] is the inverse of the determinant: ''|'''A'''^-1^| = 1/|'''A'''|''.
Line 35: Line 40:
[[LinearAlgebra/Transposition|Transposition]] does not change the determinent: ''|'''A'''^T^| = |'''A'''|''.

Exchanging rows flips the sign of the determinant. This is the intuitive explanation for the determinant of the [[LinearAlgebra/SpecialMatrices#Permutation_Matrices|permutation matrix]] as noted above. If '''''U''' = '''PA''''', then ''|'''U'''| = |'''P'''| |'''A'''|''.

Multiplying a ''single row'' of a matrix by some factor simply means that the determinant was multiplied by the same factor.

{{{
    ┌ ┐ ┌ ┐
    │ ta tb│ │ a b│
det │ c d│ = t * det │ c d│
    └ ┘ └ ┘
}}}

Multiplying ''every row'' of a matrix by some factor means that the determinant was multiplied by the same factor to the ''n''th power.

{{{
    ┌ ┐ ┌ ┐ ┌ ┐
    │ ta tb│ │ a b│ │ a b│
det │ tc td│ = t * det │ tc td│ = t * t * det | c d|
    └ ┘ └ ┘ └ ┘
}}}

Adding to or subtracting from a ''single row'' of a matrix means that the determinant is the sum of the determinants of the two factored-out matrices.

{{{
    ┌ ┐ ┌ ┐ ┌ ┐
    │ a+x b+y│ │ a b│ │ x y│
det │ c d│ = det │ c d│ + det │ c d│
    └ ┘ └ ┘ └ ┘
}}}

Furthermore, elimination does not change the determinant at all.

{{{
    ┌ ┐ ┌ ┐ ┌ ┐ ┌ ┐ ┌ ┐ ┌ ┐
    │ a b│ │ a b│ │ a b│ │ a b│ │ a b│ │ a b│
det │ c-ma d-mb│ = det │ c d│ - det │ ma mb│ = det │ c d│ - m * det │ a b│ = det │ c d│ - m * 0
    └ ┘ └ ┘ └ ┘ └ ┘ └ ┘ └ ┘
}}}
[[LinearAlgebra/Transposition|Transposition]] does not change the determinant: ''|'''A'''^T^| = |'''A'''|''.
Line 81: Line 48:
For the [[LinearAlgebra/SpecialMatrices#Identity_Matrix|identity matrix]], the determinant is 1. The determinant of the [[LinearAlgebra/SpecialMatrices#Identity_Matrix|identity matrix]] is 1.
Line 83: Line 50:
For a [[LinearAlgebra/SpecialMatrices#Permutation_Matrices|permutation matrix]], the determinant is 1 if there are an even number of row exchanges in the matrix or -1 if there are an odd number of row exchanges. The determinant of a [[LinearAlgebra/SpecialMatrices#Permutation_Matrices|permutation matrix]] is 1 or -1; 1 if there are an even number of row exchanges; and -1 if there are an odd number.
Line 85: Line 52:
For an [[LinearAlgebra/Orthogonality#Matrices|orthogonal matrix]], the determinant is 1 or -1. The determinant of an [[LinearAlgebra/Orthogonality#Matrices|orthogonal matrix]] is 1 or -1.
Line 87: Line 54:
For an [[LinearAlgebra/SpecialMatrices#Upper_Triangular_Matrices|upper triangular matrix]], the determinant is the product of the diagonal.

For a [[LinearAlgebra/SpecialMatrices#Diagonal_Matrices|diagonal matrix]], the determinant is the product of the [[LinearAlgebra/EigenvaluesAndEigenvectors|eigenvalues]]. If a matrix cannot be [[LinearAlgebra/Diagonalization|diagonalized]], it is '''defective''' and one of the eigenvalues is zero. It may still be invertible.

Large matrices, especially with mostly zeros, can be broken up.
Large, sparse matrices can be broken up.
Line 102: Line 65:
----



== Elimination ==

[[LinearAlgebra/Elimination|Elimination]] does not necessarily change the determinant. More specifically, elimination of '''''A''''' into '''''U''''' is often characterized as '''''U''' = '''EA'''''; left multiplication by one or more elimination matrices. It follows from the above properties that ''|'''U'''| = |'''E'''| |'''A'''|''. If the determinant of '''''E''''' is 1, then clearly elimination does not change the determinant.

Adding (or subtracting) a linear combination of one row to another does not change the determinant. The example [[LinearAlgebra/Elimination|here]] featured only transformations like this ("subtracting a multiple of the pivot row from the targeted row"), and it can be shown that the determinant is unchanged.

{{{
julia> using LinearAlgebra

julia> A = [1 2 1; 3 8 1; 0 4 1]
3×3 Matrix{Int64}:
 1 2 1
 3 8 1
 0 4 1

julia> det(A)
10.0

julia> B = [1 2 1; 0 2 -2; 0 4 1]
3×3 Matrix{Int64}:
 1 2 1
 0 2 -2
 0 4 1

julia> det(B)
10.0
}}}

To prove this, consider the following:

{{{
    ┌ ┐ ┌ ┐ ┌ ┐ ┌ ┐ ┌ ┐ ┌ ┐
    │ a b│ │ a b│ │ a b│ │ a b│ │ a b│ │ a b│
det │ c-ma d-mb│ = det │ c d│ - det │ ma mb│ = det │ c d│ - m * det │ a b│ = det │ c d│ - m * 0
    └ ┘ └ ┘ └ ┘ └ ┘ └ ┘ └ ┘
}}}

More generally, adding (or subtracting) to one row of a matrix changes the determinant in a manner that can look like 'factoring out' the addition.

{{{
    ┌ ┐ ┌ ┐ ┌ ┐
    │ a+x b+y│ │ a b│ │ x y│
det │ c d│ = det │ c d│ + det │ c d│
    └ ┘ └ ┘ └ ┘
}}}

Multiplying ''one'' row of a matrix by some scalar multiplies the determinant by the same scalar. Or more flexibly, multiplying ''n'' rows by some scalar ''t'' also multiplies the determinant by ''t^n^''.

{{{
    ┌ ┐ ┌ ┐
    │ ta tb│ │ a b│
det │ c d│ = t * det │ c d│
    └ ┘ └ ┘

    ┌ ┐ ┌ ┐ ┌ ┐
    │ ta tb│ │ a b│ │ a b│
det │ tc td│ = t * det │ tc td│ = t * t * det | c d|
    └ ┘ └ ┘ └ ┘
}}}

A row exchange is characterized by a [[LinearAlgebra/SpecialMatrices#Permutation_Matrices|permutation matrix]] with a determinant of -1. Therefore the determinant's sign is flipped for every row exchange.

Determinants

The determinant is a number that embeds most information about a matrix, much like the trace. Most importantly it is the scaling factor of a transformation.


Definition

The determinant is the product of eigenvalues: Πi λi.

There is an important connection between determinants and elimination. A matrix does not need to be eliminated to arrive at the determinant, but if a matrix cannot be eliminated into an upper triangular matrix, it is singular and degenerate and non-invertible and the determinant is 0. This generally only happens if there is multicolinearity. This does lead to a convenient test for invertibility.

The determinant of A is notated as |A|.

Simple Case

Given a matrix of shape 2 x 2, the determinant is calculated like:

    | a b |
det | c d | = ad - bc

Properties

The determinant of any non-square matrix is 0.

Determinants can be factored: |AB| = |A| |B|.

The determinant of the inverse is the inverse of the determinant: |A-1| = 1/|A|.

Transposition does not change the determinant: |AT| = |A|.


Special Matrices

The determinant of the identity matrix is 1.

The determinant of a permutation matrix is 1 or -1; 1 if there are an even number of row exchanges; and -1 if there are an odd number.

The determinant of an orthogonal matrix is 1 or -1.

Large, sparse matrices can be broken up.

    ┌        ┐
    | 2 0 0 0|           ┌    ┐
    | 0 a b 0|           │ a b│
det | 0 c d 0| = 2 * det │ c d│ * 3
    | 0 0 0 3|           └    ┘
    └        ┘


Elimination

Elimination does not necessarily change the determinant. More specifically, elimination of A into U is often characterized as U = EA; left multiplication by one or more elimination matrices. It follows from the above properties that |U| = |E| |A|. If the determinant of E is 1, then clearly elimination does not change the determinant.

Adding (or subtracting) a linear combination of one row to another does not change the determinant. The example here featured only transformations like this ("subtracting a multiple of the pivot row from the targeted row"), and it can be shown that the determinant is unchanged.

julia> using LinearAlgebra

julia> A = [1 2 1; 3 8 1; 0 4 1]
3×3 Matrix{Int64}:
 1  2  1
 3  8  1
 0  4  1

julia> det(A)
10.0

julia> B = [1 2 1; 0 2 -2; 0 4 1]
3×3 Matrix{Int64}:
 1  2   1
 0  2  -2
 0  4   1

julia> det(B)
10.0

To prove this, consider the following:

    ┌          ┐       ┌    ┐       ┌      ┐       ┌    ┐           ┌    ┐       ┌    ┐
    │    a    b│       │ a b│       │  a  b│       │ a b│           │ a b│       │ a b│ 
det │ c-ma d-mb│ = det │ c d│ - det │ ma mb│ = det │ c d│ - m * det │ a b│ = det │ c d│ - m * 0
    └          ┘       └    ┘       └      ┘       └    ┘           └    ┘       └    ┘

More generally, adding (or subtracting) to one row of a matrix changes the determinant in a manner that can look like 'factoring out' the addition.

    ┌        ┐       ┌    ┐       ┌    ┐
    │ a+x b+y│       │ a b│       │ x y│
det │   c   d│ = det │ c d│ + det │ c d│
    └        ┘       └    ┘       └    ┘

Multiplying one row of a matrix by some scalar multiplies the determinant by the same scalar. Or more flexibly, multiplying n rows by some scalar t also multiplies the determinant by tn.

    ┌      ┐           ┌    ┐
    │ ta tb│           │ a b│
det │  c  d│ = t * det │ c d│
    └      ┘           └    ┘

    ┌      ┐           ┌      ┐               ┌    ┐
    │ ta tb│           │  a  b│               │ a b│
det │ tc td│ = t * det │ tc td│ = t * t * det | c d|
    └      ┘           └      ┘               └    ┘

A row exchange is characterized by a permutation matrix with a determinant of -1. Therefore the determinant's sign is flipped for every row exchange.


CategoryRicottone

LinearAlgebra/Determinant (last edited 2026-01-21 16:26:27 by DominicRicottone)