TITLE: On Sampling rank $r$ matrices
QUESTION [11 upvotes]: Sample $n^2$ integers $a_{11},\dots,a_{nn}$ in $\{-d,\dots,-1,0,1\dots,d\}$ uniformly. 
What is the probability that the resulting matrix $[a_{ij}]$ has rank $r$?
Is there a nice parametrization of such matrices that helps us generate such a rank $r$ matrix quickly deterministically?
In general what is a good strategy?

REPLY [4 votes]: The case $r=n$ is considered in this paper by Martin and Wong.  They prove that for every $n \geq 2$ and every $\epsilon >0$, the probability that a random $n \times n$ matrix with entries from $\{-k, \dots, 0, \dots, k\}$ is singular is $\ll \frac{1}{k^{2-\epsilon}}$. See Lemma $1$.  The discussion following Lemma $1$ shows that this is tight for $n=2$, but not for $n >2$.  By a deep theorem of Katznelson, the true probability decays as $\frac{\log (k)}{k^n}$, which is not far from $\frac{1}{k^n}$ (the probability that a random matrix contains a row of zeros).