Hi guys.(adsbygoogle = window.adsbygoogle || []).push({});

So I got this assignment, where I have to create my own function, which can calculate the determinant of any n x n matrix.

The general formula we've been given is (recursive formula): [itex]det(A) = Sum[n,i=1] (-1)^{1+i} * a_{1 i} * det(A_{1 i})[/itex] where n is the length of the matrix.

The first lines are quite easy to compute: [itex]det(A) = Sum[n,i=1] (-1)^{1+i} * a_{1 i}[/itex]

However finding the determinant just seems like an impossible thing to do. It's fairly easy to calculate with a 2 x 2 matrix, but once it exceeds 2 x 2, you just get a new matrix instead of a number. I know you have to make some loop of some kind, but I just can't figure out how. We are, of course, not allowed to use the built in Det[...] function in any way. Otherwise it would had been completed in a few seconds

I know you have to use the recursive function inside the function, however that just brings up a million errores :)

So I hope there was some expert out there, who could give a hint or some help of some kind, so I get going with this assignment.

On the beforehand thanks.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Creating your own function Determinant in Mathematica

**Physics Forums | Science Articles, Homework Help, Discussion**