Find the inverse of the matrix:
$\begin{bmatrix} -1 & 1 & 1 & \dots & 1 \\ 1 & -1 & 1 & \dots & 1 \\ ... & ... & ... & ... & ...\\ 1 & 1 & 1 & \dots & -1 \end{bmatrix}$
I tried adding the first line to each of the following lines, then dividing lines $2, 3,... n$ with 2, then changing the second line with the last one but I couldn't continue the algorithm.
Assume the inverse has the same structure as the given matrix \begin{eqnarray*} \begin{bmatrix} -1 & 1 & 1 & \cdots & 1 \\ 1 & -1 & 1 & \cdots & 1 \\ 1 & 1 & -1 & \cdots & 1 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & 1 & \cdots & -1 \end{bmatrix} \begin{bmatrix} a & b & b & \cdots & b \\ b & a & b & \cdots & b \\ b & b & a & \cdots & b \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ b & b & b & \cdots & a \end{bmatrix}= \begin{bmatrix} 1 & 0 & 0 & \cdots & 0 \\ 0 & 1 & 0 & \cdots & 0 \\ 0 & 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & 1 \end{bmatrix} \end{eqnarray*} Now solve \begin{eqnarray*} -a +(n-1)b=1 \\ a+(n-3)b=0 . \end{eqnarray*} This gives \begin{eqnarray*} b= \frac{1}{2(n-2)} \\ a=-\frac{n-3}{2(n-2)}. \end{eqnarray*}