In linear algebra, the Laplace expansion, named after Pierre-Simon Laplace, also called cofactor expansion, is an expression of the determinant of an -matrix as a weighted sum of minors, which are the determinants of some -submatrices of . Specifically, for every, the Laplace expansion along the th row is the equalitywhere
bi,j
mi,j
The coefficient
(-1)i+jmi,
bi,j
bi,j
The Laplace expansion is often useful in proofs, as in, for example, allowing recursion on the size of matrices. It is also 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 Gaussian elimination.
Consider the matrix
B=\begin{bmatrix}1&2&3\ 4&5&6\ 7&8&9\end{bmatrix}.
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:
\begin{align} |B|&=1 ⋅ \begin{vmatrix}5&6\ 8&9\end{vmatrix}-2 ⋅ \begin{vmatrix}4&6\ 7&9\end{vmatrix}+3 ⋅ \begin{vmatrix}4&5\ 7&8\end{vmatrix}\\[5pt] &=1 ⋅ (-3)-2 ⋅ (-6)+3 ⋅ (-3)=0. \end{align}
Laplace expansion along the second column yields the same result:
\begin{align} |B|&=-2 ⋅ \begin{vmatrix}4&6\ 7&9\end{vmatrix}+5 ⋅ \begin{vmatrix}1&3\ 7&9\end{vmatrix}-8 ⋅ \begin{vmatrix}1&3\ 4&6\end{vmatrix}\\[5pt] &=-2 ⋅ (-6)+5 ⋅ (-12)-8 ⋅ (-6)=0. \end{align}
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.
Suppose
B
i,j\in\{1,2,...,n\}.
B
i,j
Mij
(ast)
1\les,t\len-1.
Consider the terms in the expansion of
|B|
bij
sgn\taub1,\tau(1) … bi,j … bn,\tau(n)=sgn\taubija1,\sigma(1) … an-1,\sigma(n-1)
for some permutation with
\tau(i)=j
\sigma\inSn-1
\sigma\leftrightarrow\tau
Sn-1
\{\tau\inSn\colon\tau(i)=j\}.
\tau
\sigma
\sigma=\begin{pmatrix}1&2& … &i& … &n-1\ (\leftarrow)j(\tau(1))&(\leftarrow)j(\tau(2))& … &(\leftarrow)j(\tau(i+1))& … &(\leftarrow)j(\tau(n))\end{pmatrix}
(\leftarrow)j
(n,n-1, … ,j+1,j)
The permutation can be derived from as follows.Define
\sigma'\inSn
\sigma'(k)=\sigma(k)
1\lek\len-1
\sigma'(n)=n
\sigma'
\sigma'=\begin{pmatrix}1&2& … &i& … &n-1&n\ (\leftarrow)j(\tau(1))&(\leftarrow)j(\tau(2))& … &(\leftarrow)j(\tau(i+1))& … &(\leftarrow)j(\tau(n))&n\end{pmatrix}
(\leftarrow)i
\sigma'
\sigma'(\leftarrow)i=\begin{pmatrix}1&2& … &i+1& … &n&i\ (\leftarrow)j(\tau(1))&(\leftarrow)j(\tau(2))& … &(\leftarrow)j(\tau(i+1))& … &(\leftarrow)j(\tau(n))&n\end{pmatrix}
(\leftarrow)i
(n,n-1, … ,i+1,i)
the operation which applies
\tau
(\leftarrow)j
(\leftarrow)j\tau=\begin{pmatrix}1&2& … &i& … &n-1&n\ (\leftarrow)j(\tau(1))&(\leftarrow)j(\tau(2))& … &n& … &(\leftarrow)j(\tau(n-1))&(\leftarrow)j(\tau(n))\end{pmatrix}
(\leftarrow)j\tau=\sigma'(\leftarrow)i
\tau=( → )j\sigma'(\leftarrow)i
( → )j
(\leftarrow)j
(j,j+1, … ,n)
Thus
\tau=(j,j+1,\ldots,n)\sigma'(n,n-1,\ldots,i)
n-i
n-j
sgn\tau=(-1)2n-(i+j)sgn\sigma'=(-1)i+jsgn\sigma.
And since the map
\sigma\leftrightarrow\tau
n\sum | |
\begin{align} \sum | |
\tau\inSn:\tau(i)=j |
sgn\taub1,\tau(1) … bn,\tau(n)&=
n | |
\sum | |
i=1 |
\sum | |
\sigma\inSn-1 |
(-1)i+jsgn\sigmabija1,\sigma(1) … an-1,\sigma(n-1)\\ &=
n | |
\sum | |
i=1 |
bij(-1)i+j
\sum | |
\sigma\inSn-1 |
sgn\sigmaa1,\sigma(1) … an-1,\sigma(n-1)\\ &=
n | |
\sum | |
i=1 |
bij(-1)i+jMij\end{align}
from which the result follows. Similarly, the result holds if the index of the outer summation was replaced with
j
Laplace's cofactor expansion can be generalised as follows.
Consider the matrix
A=\begin{bmatrix}1&2&3&4\ 5&6&7&8\ 9&10&11&12\ 13&14&15&16\end{bmatrix}.
S=\left\{\{1,2\},\{1,3\},\{1,4\},\{2,3\},\{2,4\},\{3,4\}\right\}
By defining the complementary cofactors to be
b\{j,k\
c\{p,q\
\varepsilon\{j,k\,\{p,q\}}=sgn\begin{bmatrix}1&2&3&4\ j&k&p&q\end{bmatrix},wherep ≠ j,q ≠ k.
The determinant of A can be written out as
|A|=\sumH
H,H\prime | |
\varepsilon |
bH
c | |
H\prime |
,
H\prime
H
In our explicit example this gives us
\begin{align} |A|&=b\{1,2\
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.
Let
B=[bij]
S
H
B
H
|B|=\sumL\in\varepsilonH,LbH,LcH,L
where
\varepsilonH,L
H
L
\left(\sumh\inh\right)+\left(\sum\ell\in\ell\right) | |
(-1) |
bH,L
B
B
H
L
cH,L
bH,L
bH',L'
H'
L'
H
L
This coincides with the theorem above when
k=1
The Laplace expansion is computationally inefficient for high-dimension matrices, with a time complexity in big O notation of . Alternatively, using a decomposition into triangular matrices as in the LU decomposition can yield determinants with a time complexity of .[2] The following Python code implements the Laplace expansion:
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:]] s = 1 if column % 2
3 x 3