# How to calculate this determinant? [duplicate]

How to calculate this determinant?

$$A=\begin{bmatrix}n-1&k&k&k&\ldots& k\\k&n-1&k&k&\ldots &k\\\ldots&\ldots&\ldots &&\ldots\\\\k&k&k&k&\ldots &n-1\\ \end{bmatrix}_{n\times n}$$

where $n,k\in \Bbb N$ are fixed.

I tried for $n=3$ and got the characteristic polynomial as $(x-2-k)^2(x-2+2k).$

How to find it for general $n\in \Bbb N$?

## marked as duplicate by user1551 linear-algebra StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 5 '17 at 18:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• You formatting is very good. You don't need to be nervous.--) – Juniven Apr 5 '17 at 13:37
• If you refer to the $n\times n$ matrix as $A_n$, can you write the determinant in terms of $A_{n-1}, A_{n-2}$ etc.? – user112495 Apr 5 '17 at 13:38
• No that is the problem I am facing here@user112495 – Learnmore Apr 5 '17 at 13:39
• Welcome to MSE, this is a great first post. – user409521 Apr 5 '17 at 13:40
• Thanks a lot @InfiniteMonkey – Learnmore Apr 5 '17 at 13:44

## 3 Answers

Here I've followed the same initial step as K. Miller. Instead of using a determinant identity I examine the eigenvalues $A$ and consider their product.

If $J$ denotes the $n\times n$ matrix of all $1$'s, then then eigenvalues of $J$ are $0$ with multiplicity $n-1$ and $n$ with multiplicity $1$. This can be seen by noting that $J$ has $n-1$ dimensional kernel and trace $n$.

Your matrix $A$ is exactly $kJ+(n-k-1)I$ where $I$ denotes the $n\times n$ identity matrix. The eigenvalues of $A$ are therefore $n-k-1$ with multiplicity $n-1$ and $nk+n-k-1$ with multiplicity $1$. The determinant of $A$ is then $(nk+n-k-1)(n-k-1)^{n-1}$.

• To clarify why the eigenvalues of $A$ are as given, note that all vectors are eigenvectors of $I$, so each eigenvector of $J$ is also an eigenvector of $A$. – Paul Sinclair Apr 5 '17 at 16:23
• In general, if $A$ is a matrix with eigenvalues $\lambda_1,\lambda_2,\ldots,\lambda_n$, and $p$ is a polynomial, then the eigenvalues of $p(A)$ are $p(\lambda_1),p(\lambda_2),\ldots, p(\lambda_n)$. – Zack Cramer Apr 5 '17 at 17:30

You can write $A = (n-k-1)I + kee^T$, where $e$ is the $n$-vector of all ones. Now use the matrix determinant lemma which states that

$$\det(B + uv^T) = (1 + v^TB^{-1}u)\det(B)$$

for $B$ an invertible square matrix. Applying this result to $A$, we find that

$$\det(A) = (n - k - 1)^n\left(1 + \frac{kn}{n-k-1}\right) = (n-1)(k+1)(n-k-1)^{n-1}.$$

• More precisely, the 'general result' is the so-called matrix determinant lemma. Additionally, it's worth noting that there's a geometric meaning to the matrix $ee^T$: it's a (unnormalized) projection matrix onto the vector $e$. The vector $e$ then generates a 1D subspace of eigenvectors of $ee^T$ while the remaining $n-1$ eigenvectors lie in the orthogonal complement. – Semiclassical Apr 5 '17 at 14:56
• @Semiclassical Thanks for the additional information. I have updated my answer accordingly. – K. Miller Apr 5 '17 at 15:15

Here is another method using only rows and columns manipulations. Less smart than previous answers but less demanding in prior knowledge.

First let's replace the first column by the sum of all colums: $$\begin{bmatrix}n-1&k&\ldots& k\\k&n-1&\ldots &k\\\ldots&\ldots&\ldots &\ldots\\\\k&k&\ldots &n-1\\ \end{bmatrix} = \left(n-1 + (n-1) \cdot k \right)\begin{bmatrix}1&k&k&\ldots &k\\ 1&n-1&k&\ldots &k\\ \ldots&\ldots&\ldots &\ldots&\ldots\\ \\1&k&k&\ldots &n-1\\ \end{bmatrix}$$ Now let's subtract the first row from all the other ones. It remains: $$(n-1) (k+1)\begin{bmatrix}1&k&k&\ldots &k\\ 0&n-1-k&0&\ldots &0\\ \ldots&\ldots&\ldots &\ldots&\ldots\\ \\0&0&0&\ldots &n-1-k\\ \end{bmatrix} = (n-1) (k+1) (n-1-k)^{n-1}$$