0

I want to find the inverse of this $n\times n$ matrix, assuming it is invertible. The condition of invertible is discussed at Rank of the $n \times n$ matrix with ones on the main diagonal and $a$ off the main diagonal.

Now assume it is invertible. I need to find the inverse.

\begin{pmatrix} 1 & a & a & \cdots & \cdots & a \\ a & 1 & a & \cdots & \cdots & a \\ a & a & 1 & a & \cdots & a \\ \vdots & \vdots & a& \ddots & & \vdots\\ \vdots & \vdots & \vdots & & \ddots & \vdots \\ a & a & a & \cdots &\cdots & 1 \end{pmatrix}

Jonathen
  • 1,044

2 Answers2

2

$$ {\bf M}_n (a) := \begin{bmatrix} 1 & a & a & \dots & a & a\\ a & 1 & a & \dots & a & a\\ a & a & 1 & \dots & a & a\\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\ a & a & a & \dots & 1 & a\\ a & a & a & \dots & a & 1\end{bmatrix} = (1-a) {\bf I}_n + a {\bf 1}_n {\bf 1}_n^{\top} $$

Using Sherman-Morrison,

$$ {\bf M}_n^{-1} (a) = \cdots = \color{blue}{\frac{1}{1 - a} \left( {\bf I}_n - \frac{a}{1 + (n-1) a} {\bf 1}_n {\bf 1}_n^{\top} \right)} $$

which is the matrix that Greg obtained via other means.

1

If $\def\o{{\tt1}}J$ is the $(n\times n)$ all-ones matrix, then $P=\frac{\o}nJ$ is a projector, i.e. $P^2=P.$

There is a general formula for functions of such matrices: $$ \def\a{\alpha}\def\b{\beta}\def\l{\lambda} \def\LR#1{\:\left[#1\right]} f(\l P+\b I) = f(\l+\b)\,P + f(\b)\,(I-P) $$ The matrix in question can be written as $$\eqalign{ A &= aJ + (\o-a)\,I \\ &= (an)\,P + (\o-a)\,I \\ &\equiv \l P + \b I \\ }$$ Choosing $\:f(A)=A^{-1}\:$ yields $$\eqalign{ A^{-1} &= \frac{P}{\l+\b} + \frac{I-P}{\b} \\ &= \frac{\o}{\b}\LR{I-\frac{\l P}{\l+\b}} \\ &= \frac{\o}{\o-a}\LR{I-\frac{aJ}{an-a+\o}} \\ }$$

greg
  • 35,825
  • 1
    @RodrigodeAzevedo It's from Chapter 1 of Higham's Functions of Matrices $,$ (I can't remember if it's shown as a theorem or as one of the problems in the appendix) – greg Oct 02 '22 at 14:54
  • Thank you. When you can find some time, please consider providing a reference to Higham's book. – Rodrigo de Azevedo Oct 02 '22 at 14:58