How many calls of the form $\det(B)$ does the algorithm create?

30 Views Asked by At

Let's say $A\in \mathbb{R}^{n\times n}$ and the $n^2$ components of $A$ are pairwise different. In order to calculate $\det(A)$ we can use the recursive algorithm that computes $\det(A) = \sum\limits_{j=1}^{n} (−1)^{1+j}a_{1j} \det(A_{1j})$ where $A_{1j}$ is the matrix obtained by deleting its first row and j-th column.

Input: A ∈ Rn×n 
Output: det(A) 
if (n = 1)
    return a11 
else
    d := 0
    for j = 1,...,n
        d := (−1)^{1+j}det(A_{1j}) + d
    return d

Suppose that B is a matrix that can be obtained from A by deleting the first k rows and k of the columns of A. How many (recursive) calls of the form det(B) does the algorithm create?

My first idea was that it creates $k!$ calls(1st question: can you confirm that and is my explenation sufficient?). Basically "every permutation of the k columns" if it makes sense. A certain call leads to different ones and the only way to get $\det(B)$ call is to choose the columns that are deleted every time. Here is a drawing for $n=5$ and $k=3$:

n=5, k=3 example

I don't get why we need to suppose that all the coefficients of $A$ are pairwise different. Is it to insure that every sub-matrix is unique so #{calls of the form det(B)} means the calls for a specific $B$ can only be obtained by specific deleted rows and columns? (deleting two different sets of columns can't give the same sub-matrix, so it's kind of the well definition of $\{(i_l,j_l)\ l=1,...,k\}\rightarrow $ "matrix obtained by deleting rows and columns associated to the $(i_l,j_l)$'s"). 2nd question: can you confirm that the pairwise different coefficient condition is indeed to make every sub-matrix unique?

The second question is: How many different submatrices can be obtained from $A$ by deleting the first $k$ rows and some set of $k$ columns?

So I found $\binom{n}{k}$. 3rd question: I guess just confirm that number please.

Conclude that the algorithm remains exponential, even if it does not expand repeated subcalls.

So here we assume that for any sub-matrix, its determinant will only be calculated once. But because every sub-matrix is unique, we're still going to have to expand the call once. The algorithm calls it self more than once so it is exponential but I feel like I'm not giving enough explenation, plus I'm not really using the "even if it does not expand repeated subcalls" information... 4th question: can you comment on the complexity of the algorithm given the above information please?

Thank you