computes the determinant of the matrix using leibniz 's formula a direct implementation of leibniz determinant equation . this is of little practical use because of its slow runtime of o n ! where n is the width of the matrix . lu decomposition should be used instead . one advantage of leibniz 's equation is how simplistic it is . det a = sum & sigma ; in sn ; sgn & sigma ;-rrb- prod i = 1 to n ; ai , & sigma ; i sgn is the sign function of permutations . +1 or -1 for even and odd permutations a set of permutations . if n = 3 then the possible permutations are 1,2,3 1,3,2 , 3,2,1 , ... etc concode_field_sep PlaceHolder placeHolder concode_field_sep double recursive