Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $a>0$. Let $A$ be the $n\times n$ matrix with $a+1$ on the diagonal and $a$ in all other entries. How can one compute $A^{-1}$ as a function of $n$?

share|cite|improve this question
up vote 5 down vote accepted

Write $A$ as $I + aJ$ where $J$ is the matrix consisting of all $1$s. Now using the fact that $J^2 = nJ$, look for an inverse of the form $c_1I + c_2J$. More generally, there is the famous Sherman-Morrison formula for rank-one perturbations of invertible matrices.

share|cite|improve this answer

Let $J$ be an $n$ by$n$ matrix all whose entries are 1. Then the answer is $I-aJ/(1+an)$. as you can verify. To motivate and get to this formula look up a series expansion for $(I-A)^{-1}$.

share|cite|improve this answer


$$A = I_n + a 1_n 1_n^T$$

Using Sherman-Morrison,

$$A^{-1} = I_n - \left(\frac{a}{1 + a 1_n^T 1_n}\right) 1_n 1_n^T = I_n - \left(\frac{a}{1 + n a}\right) 1_n 1_n^T$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.