Laplace expansion
In linear algebra, the Laplace expansion, named after Pierre-Simon Laplace, also called cofactor expansion, is an expression for the determinant |B| of an n × n matrix B that is a weighted sum of the determinants of n sub-matrices (or minors) of B, each of size (n − 1) × (n − 1). The Laplace expansion is of didactic interest for its simplicity and as one of several ways to view and compute the determinant. For large matrices, it quickly becomes inefficient to compute when compared to methods using matrix decomposition.
Calculation of the determinant by Laplace expansion utilizes the cofactor and the minor. The i, j cofactor of the matrix B is the scalar Cij defined by
where Mij is the i, j minor of B, that is, the determinant of the (n − 1) × (n − 1) matrix that results from deleting the i-th row and the j-th column of B.
Then the Laplace expansion is given by the following
- Theorem. Suppose is an matrix and choose any fixed . Suppose is a fixed choice of . Then its determinant is given by:
- where is the minor of element , i.e. the determinant of the submatrix formed by removing the row and the column of matrix .
Examples
Consider the matrix
The determinant of this matrix can be computed by using the Laplace expansion along any one of its rows or columns. For instance, an expansion along the first row yields:
Laplace expansion along the second column yields the same result:
It is easy to verify that the result is correct: the matrix is singular because the sum of its first and third column is twice the second column, and hence its determinant is zero.
Proof
Suppose is an n × n matrix and For clarity we also label the entries of that compose its minor matrix as
for
Consider the terms in the expansion of that have as a factor. Each has the form
for some permutation τ ∈ Sn with , and a unique and evidently related permutation which selects the same minor entries as τ. Similarly each choice of σ determines a corresponding τ i.e. the correspondence is a bijection between and The explicit relation between and can be written as
where is a temporary shorthand notation for a cycle . This operation decrements all indices larger than j so that every index fit in the set {1,2,...,n-1}
The permutation τ can be derived from σ as follows. Define by for and . Then is expressed as
Now, the operation which apply first and then apply is (Notice applying A before B is equivalent to applying inverse of A to the upper row of B in Cauchy's two-line notation )
where is temporary shorthand notation for .
the operation which apply first and then apply is
above two are equal thus,
where is the inverse of which is .
Thus
Since the two cycles can be written respectively as and transpositions,
And since the map is bijective,
from which the result follows. Similarly, the result holds if the index of the outer summation was replaced with .
Laplace expansion of a determinant by complementary minors
Laplaces cofactor expansion can be generalised as follows.
Example
Consider the matrix
The determinant of this matrix can be computed by using the Laplace's cofactor expansion along the first two rows as follows. Firstly note that there are 6 sets of two distinct numbers in {1, 2, 3, 4}, namely let be the aforementioned set.
By defining the complementary cofactors to be
and the sign of their permutation to be
The determinant of A can be written out as
where is the complementary set to .
In our explicit example this gives us
As above, it is easy to verify that the result is correct: the matrix is singular because the sum of its first and third column is twice the second column, and hence its determinant is zero.
General statement
Let be an n × n matrix and the set of k-element subsets of {1, 2, ... , n}, an element in it. Then the determinant of can be expanded along the k rows identified by as follows:
where is the sign of the permutation determined by and , equal to , the square minor of obtained by deleting from rows and columns with indices in and respectively, and (called the complement of ) defined to be , and being the complement of and respectively.
This coincides with the theorem above when . The same thing holds for any fixed k columns.
Computational expense
The Laplace expansion is computationally inefficient for high dimension matrices, with a time complexity in big O notation of O(n!). Alternatively, using a decomposition into triangular matrices as in the LU decomposition can yield determinants with a time complexity of O(n3).[1] The following Python code implements Laplace expansion recursively:
def determinant(M):
# Base case of recursive function: 2x2 matrix (such that det(M) = ad - cb)
if len(M) == 2:
return (M[0][0] * M[1][1]) - (M[0][1] * M[1][0])
else:
total = 0
for column, element in enumerate(M[0]):
# Exclude first row and current column.
K = [x[:column] + x[column + 1 :] for x in M[1:]]
# Given that the element is in row 1, sign is negative if index is odd.
if column % 2 == 0:
total += element * determinant(K)
else:
total -= element * determinant(K)
return total
See also
- Leibniz formula for determinants
- Rule of Sarrus for determinants
References
- Stoer Bulirsch: Introduction to Numerical Mathematics
- David Poole: Linear Algebra. A Modern Introduction. Cengage Learning 2005, ISBN 0-534-99845-3, pp. 265–267 (restricted online copy, p. 265, at Google Books)
- Harvey E. Rose: Linear Algebra. A Pure Mathematical Approach. Springer 2002, ISBN 3-7643-6905-1, pp. 57–60 (restricted online copy, p. 57, at Google Books)
External links
- Laplace expansion in C (in Portuguese)
- Laplace expansion in Java (in Portuguese)