A matrix has only $0$'s in its diagonal, all the other entries are $1$'s. What are the eigenvalues and eigenspaces of the matrix? I think that I should to rewrite the matrix in a appropriate form, but I can't find it. For a $2\times2$ matrix I get the characteristics polynomial $x^2-1$ and the eigenvalues $-1,1$. For $3\times3$ matrix I get $-x^3+3x+2$ and the eigenvalues are $2,-1,-1$.
 A: Consider the matrix $B \in M_n(\mathbb{F})$ having $1$ in all entries. Then, it is clear that $\mathrm{rank}(B) = 1$ with $\ker(B) = \{(x_1, \ldots, x_n)^t \in \mathbb{F}^n \, | \, x_1 + \ldots + x_n = 0 \}$ and $B(e_1 + \ldots + e_n) = n(e_1 + \ldots + e_n)$ where $e_i$ are the standard basis vectors. Thus, the characteristic polynomial of $B$ is $p_B(x) = \det(xI - B) = x^{n-1}(x - n)$ and the eigenspaces are
$$ V_0^B = \{(x_1, \ldots, x_n)^t \in \mathbb{F}^n \, | \, x_1 + \ldots + x_n = 0 \}, \,\,\, V_n^B = \mathrm{span} \{ e_1 + \ldots + e_n \}. $$
Now, the matrix you are interested in is $A = B - I$ and so it has eigenvalues $\lambda_1 = 0 - 1 = -1$ and $\lambda_2 = n - 1$ with the same eigenspaces
$$ V_{-1}^A = \{(x_1, \ldots, x_n)^t \in \mathbb{F}^n \, | \, x_1 + \ldots + x_n = 0 \}, \,\,\, V_{n-1}^A = \mathrm{span} \{ e_1 + \ldots + e_n \}.$$
A: Let A (your matrix) be
\begin{pmatrix}
0&1&1\\
1&0&1\\
1&1&0
\end{pmatrix}
You can calculate the eigenvalues by calculating det(A - I$\lambda$) by using Cramer's rule.
\begin{equation}
A - I\lambda = \begin{pmatrix}
-\lambda&1&1\\
1&-\lambda&1\\
1&1&-\lambda
\end{pmatrix}
\end{equation}
Doing this on the first row gives
\begin{equation}
0 = \operatorname{det}(A - I\lambda) = -\lambda (\lambda^2 -1) - 1(-\lambda -1) + 1(1 + \lambda)
\end{equation}
You can factor out $\lambda + 1$ and get the eigenvalues.
To get the eigenvectors you should, for each $\lambda$, solve the equation
\begin{equation}
A\vec{u}_i = \lambda_i\vec{u}_i
\end{equation}
since the eigenvectors of A are precisely those vectors who's direction remains unchanged when multiplied by A.
Solving this will give you a parametric solution for $\vec{u}_i$, so you can normalize it to get an explicit answer.
Good luck!
