A question about the determinant of a binary matrix Is it true that for every positive integers $n$ and $m < n$ there exists a square matrix of order $n$ that contains only zeros and ones, whose columns contain exactly $m$ ones  (and hence $n(n-m)$ zeros) and whose determinant is not equal to zero?  It is clear that one can speak of rows instead of columns.  Here is an example of such a determinant for $n=5$ and $m=3$:
$$
\begin{vmatrix}
1 & 1 & 0 & 0 & 0 \\
0 & 0 & 1 & 1 & 0 \\
1 & 0 & 1 & 0 & 1 \\
0 & 1 & 1 & 1 & 1 \\
1 & 1 & 0 & 1 & 1
\end{vmatrix}
$$
I see experimentally using MathCAD that it seems to be true.  But how to prove it?
 A: This depends on the ring/field. E.g. every $3\times3$ binary matrix with exactly $2$ ones on each column must either possess repeated columns or be obtained by scrambling the columns of
$$
A=\pmatrix{0&1&1\\ 1&0&1\\ 1&1&0}.
$$
Therefore all such matrices are singular in a commutative ring of characteristic $2$.
However, the answer to your question is affirmative in every commutative ring of characteristic $0$. It suffices to prove the assertion over $\mathbb Z$ by mathematical induction. The base case $(n,m)=(2,1)$ is solved by picking $A=I$. In the inductive step, suppose $n\ge3$. If $m=1$, simply pick $A=I$. If $m>1$, then $n-1>m-1\ge1$ and by induction assumption, there exists some nonsingular $(n-1)\times(n-1)$ binary matrix $B$ with exactly $m-1$ ones on each column. Let
$$
A=\pmatrix{0&\mathbf1^T\\ \mathbf u&B}
$$
where $\mathbf 1\in\mathbb Z^{n-1}$ denotes the vector of ones and $\mathbf u$ is any binary integer vector containing exactly $m$ ones and $n-m-1$ zeroes. Since $\mathbf1^TB=(m-1)\mathbf1^T$,
$$
\det(A)=
\det\left[\pmatrix{1&-\frac{1}{m-1}\mathbf1^T\\ \mathbf0&I}\pmatrix{0&\mathbf1^T\\ \mathbf u&B}\right]
=\det\pmatrix{-\frac{\mathbf1^T\mathbf u}{m-1}&\mathbf0^T\\ \mathbf u&B}
=\frac{-m}{m-1}\det(B)\ne0.
$$
The previous line also shows that if $B$ is an integer (but not necessarily binary) matrix whose column sums are all equal to some $k\ne0$, then $k$ must divide $\det(B)$.
A: It's True!. Consider the following matrix:
In the column the first $m$ entries are one. In the next $m$ columns the $i + 1$' th column will be the same as first column with $i$'th and last entries swapped. In the next $n - m - 1$ columns the $m + 1 + i$'th column will consist of the first column except that the first and $m + i$'th components are swapped.
To show the matrix is nonsingular we will prove that it's rows are independent. Assume that $a_1, \dots, a_n$ are the coefficients of the linear combinations of rows adding up to zero. Then the first component being zero implies:
$a_1 + \dots + a_m = 0$ $(*)$
the $i + 1$'th component begin zero for $1 <= i <= m$ means will result to the equation:
$a_1 + \dots + a_{i - 1} + a_{i} + \dots a_{m} + a_{n} = 0$
comparing this with $(*)$ implies:
$a_1 = a_2 = \dots = a_m = a_n$
Now the equation corresponding to the $m + 1 + i$'th equation being equal to zero for $1 <= i <= n - m - 1$ implies that:
$a_2 + \dots + a_m + a_{m + i} = 0$
again comparing this with $(*)$ results in :
$a_1 = a_2 = \dots = a_n$
pluging into $(*)$ will result:
$a_1 = a_2 = \dots a_n = 0$
so the matrix is nonsingular so the determinant is nonzero.
Here is an example for $n = 6$ and $m = 3$:
$$
\begin{matrix}
1 & 0 & 1 & 1 & 0 & 0 \\
1 & 1 & 0 & 1 & 1 & 1 \\
1 & 1 & 1 & 0 & 1 & 1 \\
0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 \\
0 & 1 & 1 & 1 & 0 & 0 \\
\end{matrix}
$$
A: We can do even better, if $m$ and $n$ are relatively prime. In such a case we can make a matrix with nonzero determinant where each column has $m$ ones and each row has $m$ ones also.
With $m$ and $n$ relatively prime, start by placing any desired permutation of ones and zeroes in the first row. Then for the second row, advance each 0 or 1 entry one place to the right, wrapping the bit in the last column around to the first column. Thus with $n=5, m=3$ the first two rows might read
1 1 1 0 0
0 1 1 1 0
Iterate this cyclic permutation process for the remaining rows, so the complete matrix in this example would read
1 1 1 0 0
0 1 1 1 0
0 0 1 1 1
1 0 0 1 1
1 1 0 0 1
with determinant $3$.
