TITLE: How many 1's can a regular 0,1-matrix contain?
QUESTION [7 upvotes]: A matrix of order $n$ has all of its entries in $\{0,1\}$. What is the maximum number of $1$ in the matrix for which the matrix is non singular.

REPLY [11 votes]: Suppose that the matrix $A\in\{0,1\}^{n\times n}$, by the pigeon hole principle if $A$ has strictly more than $n^2-(n-1)$ nonzero entries, then at least two columns are full of ones and thus are linearly dependent. It follows then that $A$ has not full rank (and thus is singular). Now, the matrix $A\in\{0,1\}^{n\times n}$ defined by $$A_{i,j}=\begin{cases} 1 & \text{if } i \neq j \\ 1 & \text{if } i=j=n\\ 0 &\text{else}\end{cases}$$
is nonsingular and thus the bound you are looking for is $n^2-(n-1)=n^2-n+1$.