<s>[INST] Diagonal entries are zero, others are $1$. Find the determinant. $\det\begin{vmatrix}
0 & \cdots & 1& 1 & 1 \\
\vdots & \ddots & \vdots & \vdots & \vdots \\
1 & \cdots & 1 & 1 & 0
\end{vmatrix}=?$
Attempt:
First I tried to use linearity property of the determinants such that $$\det\binom{ v+ku }{ w
 }=\det\binom{v  }{ w
 }+k\det \binom{ u }{ w
 }$$
$v,u,w$ are vectors $k$ is scalar.
I have tried to divide it into $n$ parts and tried to compose with sense but didn't acomplish.
Second I tried to make use of "Row Reduction" i.e. adding scalar multiple of some row to another does not change the determinant, so I added the all different rows into other i.e. adding $2, 3,4,\dots,n$th row to first row and similarly doing for all rows we got 
$$\det\begin{vmatrix}
0 & \cdots & 1& 1 & 1 \\
\vdots & \ddots & \vdots & \vdots & \vdots \\
1 & \cdots & 1 & 1 & 0
\end{vmatrix}=\det\begin{vmatrix}
n-1 & \cdots & n-1& n-1 & n-1 \\
\vdots & \ddots & \vdots & \vdots & \vdots \\
n-1 & \cdots & n-1 & n-1 & n-1
\end{vmatrix}=0$$
The last determinant is zero (I guess) so the given determinant is zero?
I don't have the answer this question, so I am not sure. How to calculate this determinant?
 [/INST] For $n = 1$, we have 
$$ \det \left[ \begin{matrix} 0 \end{matrix} \right] = 0.$$
For $n=2$, we have
$$ \det \left[ \begin{matrix} 0 &  1 \\ 1 & 0  \end{matrix} \right] = -1. $$
For $n = 3$, we have 
$$ \det \left[ \begin{matrix} 0 &  1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0  \end{matrix} \right] = 0 \det \left[ \begin{matrix} 0 & 1 \\ 1 & 0 \end{matrix} \right] - 1 \det \left[ \begin{matrix} 1 & 1 \\ 1 & 0 \end{matrix} \right] + 1 \det \left[ \begin{matrix} 1 & 0 \\ 1 & 1 \end{matrix} \right] = 2. $$
For $n = 4$, we have 
$$ \det \left[ \begin{matrix} 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0  \end{matrix} \right] = -3. $$
For $n = 5$, we have 
$$ \det \left[ \begin{matrix} 0 & 1 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1  \\ 1 & 1 & 1 & 0  & 1 \\ 1 & 1 & 1 & 1 & 0 \end{matrix} \right] = 4. $$
So, in general, if $A$ is your $n \times n$ matrix with all diagonal entries equal to $0$ and all off-diagonal entries equal to $1$, then  we have 
$$ \det A = (-1)^{n-1} (n-1). $$
Hope this helps.
For calculation of determinants, I've used this online tool.
</s>