# Determinant of a N symmetric square matrix with diagonal 1

What is the determinant of a symmetric $n \times n$ matrix with all diagonals be 1 and all others are $\rho$ (yes correlation matrix)?

Anyone can tell me a method to work it out elegantly?

Thanks!

-

Let $A$ be an $n\times n$ matrix of your desired form. Let us form the matrix of all ones, call it $J$. Then we can represent $A$ as $$A=\rho J - (\rho - 1)I$$ The determinant of the above matrix is $$\det(A) = \rho^n\det\left(J - \frac{\rho - 1}{\rho}I\right)$$ Letting $\lambda = \frac{\rho - 1}{\rho}$, the latter determinant is precisely the characteristic polynomial of $J$, easily seen as $$p(\lambda)=(-1)^{n}\lambda^{n-1}(\lambda - n)$$ Some simplifying then gives the determinant as $$\det(A)=\left(1-\rho \right)^{n-1}\left(1 + \rho n-\rho\right)$$
Let $M_n$ be the matrix with matrix elements $$M_{ij}= \cases{1 & i=j\cr \rho & i\not=j}$$ Also let $N_n$ be the $n \times n$ matrix, obtained by $M_n$ by replacing first element of the first row with $\rho$.
Applying Laplace's method to the first row of $M_n$ and $N_n$: $$\begin{eqnarray} \det M_n &=& \det M_{n-1} - (n-1) \rho \cdot \det N_{n-1} \\ \det N_n &=& \rho \cdot \det M_{n-1} - (n-1) \rho \cdot \det N_{n-1} \end{eqnarray}$$ with $\det M_2 = 1 - \rho^2$ and $\det N_2 = \rho(1-\rho)$. This gives $$\det(M_n) = (1-\rho)^{n-1}(1+(n-1) \rho)\qquad \det N_n = \rho (1-\rho)^{n-1}$$