  We consider the set of $n\times n$ matrices with rational entries having
numerator and denominator of size at most $H$ and obtain upper and lower bounds
on the number of such matrices of a given rank and then apply them to count
such matrices with a given determinant, or a given characteristic polynomial.
