Let $\simeq$ be an equivalence relation in the set of $n\times n$ matrices, with $0$ and $1$ coefficients, defined by $A \simeq B$ if and only if $A$ and $B$ has the same number of $1$s.
Determine how many different equivalence classes exist.
Is there a formula to count the number of matrices?
Hint:
There are $2^{n^2}$ possible $0$-$1$ matrices.
There are $\binom{n^2}{k}$ $0$-$1$ matrices with exactly $k$ ones.