Suppose we have a matrix $A_{3 \times 3}$ and its entries are only from the set of numbers $\{0,1,2,3,4,5,6,7,8,9\}$. Evidently there are $10^9$ possible different such matrices $A$.
Question:
- Is it a method of computation how many from these $10^9$ matrices are singular?
- or more accurately can we compute how many matrices of rank $1,2,3$ are in the set of all possible matrices $A$ ?
Ok, I wrote a brute force program to compute the ranks for each of the $10^9$ possible $3\times3$ matrices with integer entries between $0$ and $9$ inclusive. The run time was only $2$ minutes. Here are the counts: \begin{align} &\text{rank }0\text{ :}\;\;1\\ &\text{rank }1\text{ :}\;\;16\text{,}461\\ &\text{rank }2\text{ :}\;\;19\text{,}929\text{,}402\\ &\text{rank }3\text{ :}\;\;980\text{,}054\text{,}136\\ \end{align}
As requested, here is the program I wrote to get the counts. Nothing clever here, and no attempt at optimization -- just a brute force search.