Determinant of a matrix that has 0 on the diagonal

102 Views Asked by At

$$ \begin{pmatrix} 0&1&1&\cdots&1&1 \\ 1&0&x&\cdots&x&x \\ 1&x&0&\cdots&x&x \\ \vdots&\vdots&\vdots&\ddots&\vdots&\vdots \\ 1&x&x&\cdots&0&x \\ 1&x&x&\cdots&x&0 \end{pmatrix} $$

I have tried to solve it differently, mostly I tried to make a lower triangle matrix. Usually I use way with lambda, but I still don't have right answer

2

There are 2 best solutions below

1
On BEST ANSWER

Assume that we are looking at the $n\times n$ matrix. This works for all $n \geq 2$. I also use $|\cdot|$ to mean determinant.

One of the most useful facts for this problem is that if you add or subtract a multiple of a row (or column) from a different row (or column) then the determinant does not change. Subtracting the last row from all but itself and the first one has

\begin{equation} \left | \begin{bmatrix} 0 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 0 & x & \cdots & x & x \\ 1 & x & 0 & \cdots & x & x \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 1 & x & x & \cdots & 0 & x \\ 1 & x & x & \cdots & x & 0 \\ \end{bmatrix} \right | = \left | \begin{bmatrix} 0 & 1 & 1 & \cdots & 1 & 1 \\ 0 & -x & 0 & \cdots & 0 & x \\ 0 & 0 & -x & \cdots & 0 & x \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & x \\ 1 & x & x & \cdots & x & 0 \\ \end{bmatrix} \right | \end{equation} Now add the second to second-to-last rows to the last row \begin{equation} \left | \begin{bmatrix} 0 & 1 & 1 & \cdots & 1 & 1 \\ 0 & -x & 0 & \cdots & 0 & x \\ 0 & 0 & -x & \cdots & 0 & x \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & x \\ 1 & x & x & \cdots & x & 0 \\ \end{bmatrix} \right | = \left | \begin{bmatrix} 0 & 1 & 1 & \cdots & 1 & 1 \\ 0 & -x & 0 & \cdots & 0 & x \\ 0 & 0 & -x & \cdots & 0 & x \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & x \\ 1 & 0 & 0 & \cdots & 0 & (n-2)x \\ \end{bmatrix} \right | \end{equation} Now add $1/x$ of the second to second-to-last rows to the first row \begin{equation} \left | \begin{bmatrix} 0 & 1 & 1 & \cdots & 1 & 1 \\ 0 & -x & 0 & \cdots & 0 & x \\ 0 & 0 & -x & \cdots & 0 & x \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & x \\ 1 & 0 & 0 & \cdots & 0 & (n-2)x \\ \end{bmatrix} \right | = \left | \begin{bmatrix} 0 & 0 & 0 & \cdots & 0 & n-1 \\ 0 & -x & 0 & \cdots & 0 & x \\ 0 & 0 & -x & \cdots & 0 & x \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & x \\ 1 & 0 & 0 & \cdots & 0 & (n-2)x \\ \end{bmatrix} \right | \end{equation} Now add $-x/(n-1)$ of the first row to the second to second-to-last rows and $-x(n-2)/(n-1)$ of the first row to the last \begin{equation} \left | \begin{bmatrix} 0 & 0 & 0 & \cdots & 0 & n-1 \\ 0 & -x & 0 & \cdots & 0 & x \\ 0 & 0 & -x & \cdots & 0 & x \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & x \\ 1 & 0 & 0 & \cdots & 0 & (n-2)x \\ \end{bmatrix} \right | = \left | \begin{bmatrix} 0 & 0 & 0 & \cdots & 0 & n-1 \\ 0 & -x & 0 & \cdots & 0 & 0 \\ 0 & 0 & -x & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & 0 \\ 1 & 0 & 0 & \cdots & 0 & 0 \\ \end{bmatrix} \right | \end{equation} Swapping rows also flips the sign of the determinant. Swapping the first and the last gives \begin{equation} \left | \begin{bmatrix} 0 & 0 & 0 & \cdots & 0 & n-1 \\ 0 & -x & 0 & \cdots & 0 & 0 \\ 0 & 0 & -x & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & 0 \\ 1 & 0 & 0 & \cdots & 0 & 0 \\ \end{bmatrix} \right | = - \left | \begin{bmatrix} 1 & 0 & 0 & \cdots & 0 & 0 \\ 0 & -x & 0 & \cdots & 0 & 0 \\ 0 & 0 & -x & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & 0 \\ 0 & 0 & 0 & \cdots & 0 & n-1 \\ \end{bmatrix} \right | \end{equation} and we can calculate that the determinant of a diagonal matrix is the product of the diagonal terms and therefore \begin{equation} - \left | \begin{bmatrix} 1 & 0 & 0 & \cdots & 0 & 0 \\ 0 & -x & 0 & \cdots & 0 & 0 \\ 0 & 0 & -x & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & -x & 0 \\ 0 & 0 & 0 & \cdots & 0 & n-1 \\ \end{bmatrix} \right | = -(n-1)(-x)^{n-2} \end{equation}

0
On

Call your matrix $A$ and let $J$ be the matrix of ones. The eigenvalues of $J$ are $n,0,\ldots,0$, so the eigenvalues of $J-I$ are $n-1,-1,\ldots,-1$. Thus $\det(J-I) = (-1)^{n-1}(n-1)$. Now compute the determinant of the matrix $$x(J-I) = \begin{bmatrix} 0 & x & \cdots & x & x \\ x & 0 & \cdots & x & x \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ x & x & \cdots & 0 & x \\ x & x & \cdots & x & 0\end{bmatrix}$$ in two different ways. On one hand, $\det(x(J-I)) = x^n\det(J - I) = x^n(-1)^{n-1}(n-1)$. On the other hand, by factoring out an $x$ from the first row and column we see $\det(x(J-I)) = x^2 \det(A)$. Equating our two expressions reveals that $\det(A) = x^{n-2}(-1)^{n-1}(n-1)$.