title: Algorithm to find the determinant of a matrix
body: <p>I have to write an algorithm to find the determinant of a matrix, which is done with the recursive function:</p>
  
  <p><img src="https://i.stack.imgur.com/oFk07.png" alt="enter image description here"></p>
  
  <p>where <code>A_ij</code> is the matrix, which appears when you remove the <code>i</code>th row and the <code>j</code>th column for <code>A</code>. When <code>A</code> has dimension <code>n x n</code>, then the dimension for <code>A_ij</code> is <code>(n-1) x (n-1)</code>. I'm not allowed to use <code>Minor[]</code> or <code>Det[]</code>.</p>
  
  <p>How do I write this algorithm?</p>
  
  <hr>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>det1[Mi_ /; Dimensions[Mi][[1]] == Dimensions[Mi][[2]]] :=
    Module[{det1}, 
      det1 = Sum[ 
        If[det1 == 1, Break[], (-1)^(1 + j) *Mi[[1, j]]*det1[Drop[Mi, {1}, {j}]]], 
        {j, 1, Length[Mi]}]; 
      Return[det1 // MatrixForm, Module]
  ] 
  </code></pre>