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 Laplace's 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 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 matrix and the set of -element subsets of , an element in it. Then the determinant of can be expanded along the 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 columns. Computational expense 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 . The following Python code implements Laplace expansion recursively:def determinant(M): # Base case of recursive function: 1x1 matrix if len(M) == 1: return M[0][0] 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 == 0 else -1 total += s * element * determinant(K) return total See also Leibniz formula for determinants Rule of Sarrus for determinants References David Poole: Linear