Consider an $n\times n$ matrix whose primary and secondary diagonal elements are all zero. Does it necessarily follow that the determinant vanishes for these matrices?
When $n=1,2,3,4$, the matrix is necessarily singular.
Consider an $n\times n$ matrix whose primary and secondary diagonal elements are all zero. Does it necessarily follow that the determinant vanishes for these matrices?
When $n=1,2,3,4$, the matrix is necessarily singular.
In general, NO.
For $2\times2$, such a matrix will itself be zero.
For $3\times3$, the matrix's 1st and 3rd rows will always be linearly dependent.
$\begin{pmatrix}0&a&0\\b&0&c\\0&d&0\end{pmatrix}$
When we have $n\geq 4$ then we can build a matrix which has all rows linearly independent; examples are given by @joriki, @J.M., @user1551.
Matrix has determinant zero iff its rows are linearly independent.
For the $4\times 4$ case, you can simplify the determinant a bit:
$\begin{vmatrix}&a&b&\\c&&&f\\d&&&g\\&h&k&\end{vmatrix}=\begin{vmatrix}a&b\\h&k\end{vmatrix}\begin{vmatrix}c&f\\d&g\end{vmatrix}$
and one can certainly set things up such that both $2\times 2$ determinants do not evaluate to $0$.
This is already false for $n=4$. For instance, the matrix
$\begin{pmatrix}0&1&1&0\\1&0&0&1\\1&0&0&-1\\0&1&-1&0\end{pmatrix}$
is not singular.
A permutation of $\{1,2,\ldots,n\}$ corresponds to an $n$-by-$n$ permutation matrix whose entries are $0$ or $1$, with a $1$ in position $ij$ precisely when the permutation sends $i$ to $j$. Permutation matrices are characterized as having exactly one $1$ in each row and in each column, and being $0$ elsewhere. Each permutation matrix is invertible, and its inverse is the permutation matrix of the inverse permutation, which is also the transpose of the matrix. (Its determinant is $1$ or $-1$, corresponding to whether the permutation is even or odd, respectively.)
A permutation $\sigma$ corresponds to a matrix with only $0$s on the diagonal and antidiagonal as long as $\sigma(k)\neq k$ for all $k$ and $\sigma(k)\neq n+1-k$ for all $k$. In case $n$ is even and greater than $2$, you always get an example by swapping $k$ and $k+1$ for each odd $k$, and the $n=4$ case of this is given in user1551's answer. If $n$ is odd and greater than $3$, you can take $\sigma(1)=2$, $\sigma(2)=3$, $\sigma(3)=1$, and swap $k$ and $k+1$ for each even $k$ greater than $3$. A $5$-by-$5$ example is given by
$\begin{pmatrix}0&1&0&0&0\\0&0&1&0&0\\1&0&0&0&0\\0&0&0&0&1\\0&0&0&1&0\end{pmatrix}.$
Why not simply consider the permutation matrix $ \begin{pmatrix}0&1&0&0\\1&0&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix} $?