# Suppose A is an n-by-n matrix with its diagonal entries are n and other entries are one. Find determinant of A.

For $n \geq 2$, find the determinant of $A_{n}=\begin{bmatrix} n & 1 & 1 &\ldots &1 \\ 1 & n & 1 &\ldots &1 \\ 1 & 1 & n &\ldots &1 \\ \vdots & \vdots &\vdots & \ddots & \vdots\\ 1 & 1 & 1 &\ldots & n \end{bmatrix}_{n \times n}$

One can deduce the determinant of $A_{n}=(n-1)^{n-1}(2n-1)$ by taking $n=2,3,4...$. I solve it as follows but I found it is not elegant. Any better approach?

Here is my attempt:

Let's find the eigenvalues of $A_{n}$ by solving $det(\lambda I-A_{n})=0$ because $det(A_{n})=\lambda_{1}\lambda_{2}...\lambda_{n}$ where $\lambda_{i}$ are eigenvalues of $A_{n}$. Express $A_{n}=(n-1)I+J$ where $I$ is the n-by-n identity matrix while $J$ is an n-by-n matrix with all entries equal to 1. Denote $B=(n-1)I$ so that $$\lambda I-A_{n}=\lambda I-(B+J)=(\lambda I - B)(I-(\lambda I - B)^{-1}J)$$ Since $det(XY)=det(X)det(Y)$ for square matrices $X$ and $Y$ $$det(\lambda I-A_{n})=det(\lambda I - B)det(I-(\lambda I - B)^{-1}J)$$ Since $det(kX)=k^{n}det(X)$ for a scalar k and $det(I)=1$ $$det(\lambda I-B)=\det(\lambda I - (n-1)I)=(\lambda-(n-1))^{n}det(I)=(\lambda-(n-1))^{n}$$ If $u$ be a column vector of one's in $\mathbb{R}^{n}$, then $uu^{T}=J$ so that: $$det(I-(\lambda I - B)^{-1}J)=det(I-(\lambda I - B)^{-1}uu^{T})$$ By Sylvester's Determinant Theorem: \begin{equation*} \begin{split} det(I-(\lambda I - B)^{-1}J)&=&det(I-(\lambda I - B)^{-1}uu^{T})=det(I-u^{T}(\lambda I - B)^{-1}u)\\ &=&1-u^{T}(\lambda I - B)^{-1}u=1-u^{T}(\lambda-(n-1))^{-1}Iu\\ &=&1-(\lambda-(n-1))^{-1}u^{T}Iu\\ &=&1-\frac{u^{T}u}{\lambda-(n-1)}=1-\frac{n}{\lambda-(n-1)}\\ &=&\frac{\lambda-(2n-1)}{\lambda-(n-1)} \end{split} \end{equation*} This yields $$det(\lambda I-A_{n})=(\lambda-(n-1))^{n}\frac{\lambda-(2n-1)}{\lambda-(n-1)}=(\lambda-(n-1))^{n-1}(\lambda -(2n-1))=0$$ The eigenvalues of $A_{n}$ are $n-1$ (with algebraic multiplicity of $n-1$) and $2n-1$ (with algebraic multiplicity of 1). Thus, $det(A_{n}=(n-1)^{n-1}(2n-1)$

I wonder if it is possible to obtain the determinant without solving for the eigenvalues. Or at least without using the Sylvester's determinant theorem....

Assuming we are working over a field of characteristic 0:

Add all other rows to the bottom row, so that the bottom row has $2n-1$ in each spot. Multiply the bottom row by $\frac{1}{2n-1}$ so it is all $1$s, then subtract it from each other row. This gives us the following matrix:

$$\begin{pmatrix} n-1 & 0 & \cdots & 0 \\ 0 & n-1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 2n-1 & 2n-1 & \cdots & 2n-1 \end{pmatrix}$$

This is lower triangular, so it has determinant equal to the product of the diagonal entries, or $(n-1)^{n-1}(2n-1)$.

One can find the eigenvalues much more easily than this:

Note that $A = B + (n-1)I$, where $B$ is the matrix all of whose entries are $1$, and $I$ is the identity.

The rank of $B$ is $1$ so the nullspace is of dimension $n-1$, and since $B^2=nB$, then $B$ satisfies the polynomial $x(x-n)=0$.

Therefore, the characteristic polynomial must be $x^{n-1}(x-n)$; if the characteristic of the ground field divides $n$, then this is $x^n$.

If the characteristic of the ground field does not divide $n$, then eigenvalues of $B$ are $0$, with multiplicity $n-1$, and $n$, with multiplicity $1$. Hence, the eigenvalues of $A$ are $0+(n-1) = n-1$, with multiplicity $(n-1)$, and $n+(n-1) = 2n-1$, with multiplicity $1$. So the determinant is $(n-1)^{n-1}(2n-1)$, as you obtained.

If we are working over a field whose characteristic does divide $n$, then $A = B-I$. Thus, the minimal polynomial of $A$ is $(x-1)^2$, so the characteristic polynomial is $(x-1)^n$. Again we obtain that the determinant is just $(-1)^n$, same as we would get above.

• Thanks for the answer.What is "characteristic of the ground field"? (Please forgive my math deficiency). – Yongkai Jul 25 '12 at 21:43
• The characteristic of a field is the smallest positive integer $n$, if one exists, such that $$\underbrace{1+1+\cdots+1}_{n\text{ summands}} = 0.$$If you are working over $\mathbb{Q}$, $\mathbb{R}$, or $\mathbb{C}$, you don't need to worry about characteristic; it's $0$ and no problems occur. But when one works over more general fields (e..g., if you work modulo $2$, or modulo $7$), then certain pathologies can occur. If you don't know what "characteristic of the ground field" means, chances are it doesn't matter to you what it means. – Arturo Magidin Jul 26 '12 at 0:18

Let $B$ be the matrix with all $-1's$. Since the $rank(B)=1$, it follows that $\lambda=0$ is an eigenvalue of $B$ of multiplicity $n-1$.

Also, it is trivial to see that $\lambda=-n$ is an eigenvalue of $B$, since in this case the rows add to $0$. This proved that the characteristic polynomial of $B$ is

$$\det (xI-B)= x^{n-1}(x+n) \,.$$

Set $x=n-1$ and you are done....

Sigh, Arturo beat me to the answer :)

Write $A = (n-1)I+uu'$ instead, where $u'=[1 1 \dots1].$ Using the same Sylvester's Determinant Theorem you can write $\det(A)=\det((n-1)I)(1+u'u/(n-1) = (n-1)^n(1-\frac{n}{n-1})=(n-1)^{n-1}(2n-1)$

• well, this uses Sylvester's theorem... – karakfa Jul 25 '12 at 21:31

For this matrix you can quite easily see what all the eigenvalues and eigenvectors are. If $e_i$ is the vector with entry $1$ in position $i$ and $0$ elsewhere then $e_1 + \ldots + e_n$ is an eigenvector with eigenvalue $2n-1$ and the vectors of the form $e_i-e_j$ span an $n-1$ dimensional eigenspace with eigenvector $n-1$.

• You have "eigenvalue" and "eigenvector" mixed up; $e_1+\cdots+e_n$ is a vector, hence cannot be an eigen value. And $2n-1$ is a scalar, so it is the eigenvalue, not the eigenvector. – Arturo Magidin Jul 25 '12 at 21:33