# a question about how to calculate a determinant [duplicate]

I have the following matrix $$A = \begin{pmatrix} n-1 & -1 & \cdots & -1 \\ -1 & n-1 & \cdots & -1 \\ \vdots & \vdots & \ddots & \vdots \\ -1 & -1 & \cdots & n-1 \end{pmatrix}$$ and I need to calculate $det(A)$. How could I calculate this determinant and which are the eigenvalues ?

Thanks :)

## marked as duplicate by user17762, William, Aang, Martin Sleziak, SashaSep 28 '12 at 4:19

$$A = nI - \begin{pmatrix} 1 & 1 & \cdots & 1 \\ 1 & 1 & \cdots & 1 \\ \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & \cdots & 1 \end{pmatrix} = nI - \begin{pmatrix}1\\1\\ \vdots\\ 1 \end{pmatrix} \begin{pmatrix}1 & 1 & \cdots & 1 \end{pmatrix}$$ Can you compute the eigen-values of the matrix $I - \alpha u v^T$, where $u,v$ are vectors?
I'll assume that $A$ is $k\times k$. Let us form the matrix of all ones, call it $J$. Then we can represent $A$ as $$A=nI - J$$ To calculate the characteristic polynomial of $A$ is equivalent to finding $$\det\left((n-\lambda)I - J\right)$$ Notice that $J$ is diagonalizable since it is symmetric. $J$ has rank $1$ and it is quite easy to see that $k$ is an eigenvalue under the eigenvector of all $1$s. So the eigenvalues of $J$ are all $0$ except for $k$ which has multiplicity $1$. Therefore the characteristic polynomial of the above matrix will be $$(n-\lambda)^{k-1}(n-\lambda-k)$$