# Counting non singular matrices

The number of $$3\times3$$ non singular matrices with four entries as 1 and all other entries as 0, is (JEE Main 2010)

My approach: the determinant must be non-zero, which means that no row or column can be entirely zero. Hence, there are $$3!=6$$ to insert 3 ones into the matrix so that it is non-singular. For each way, there are 6 ways to put the fourth one, giving a total of $$6\times 6=36 \text{ ways}$$

I checked each of the six matrices with 3 ones to ensure that the determinant was non-zero. And then I would have had to check for the fourth one being inserted and ensure that it does not lead to a zero determinant.

Is there a way of doing this in one go rather than one at a time? For example, the linked answer says triple of 1's and not creating a second triple (which is the same approach that I have taken). My question is: is there an elegant way of doing it, or do I need to write it out?

For reference: Question is at the high school math level (not from a linear algebra subject)

• Are you a pre master student or pre bachelors?
– Babu
Commented May 5 at 7:25
• As mentioned, this is at high school/grade 12 level. Commented May 5 at 9:14
• It doesn't matter where you put last remaining $1$, determinant will always be non zero. To see this one way is to think in terms of linear independence of column vectors. Another way, perhaps easier is using that swapping rows or columns of matrix changes determinant only by sign. Commented May 5 at 9:18

For any $$n×n$$ matrix, there must be atleast $$n$$ values in it to make it non singular (taking all other empty spaces as $$0$$). It actually is kind of a general formula.., and there are $$n!$$ ways of it being non singular, applying your logic. After that for adding $$k$$ elements, there are $$\binom{n^2-n}{k}$$ ways they can fill $$n^2-n$$ spaces. Thus total possible arrangements, are $$n!×\binom{n^2-n}{k}$$. In your case, $$n=3,k=1$$, returning $$36$$