Matrices – Inverse of Matrix of Ones Plus nI

inversematrices

Having a vector $\mathbf{1} \in \mathbb{R}^{n}$ containing only ones, following equality should be true according to a paper I am currently reading:

\begin{equation}
\left( nI+\mathbf{1}\mathbf{1}^T \right)^{-1}= \frac{1}{n}\left( I – \frac{1}{2n} \mathbf{1}\mathbf{1}^T \right)
\end{equation}

EDIT: what is the general rule for constructing an inverse of a matrix with $n$ on diagonal and $1$ elsewhere and how is this rule derived?

Best Answer

As mentioned in one of the comments, you should consider using the Sherman-Morrison formula or the Woodbury identity which states that for a nonsingular matrix $A$ and column vectors $ b, c$ such that $ {A+bc^\top}$ is nonsingular,

$$( {A+bc^\top})^{-1}={A^{-1}}-\frac{1}{1+{c^\top A^{-1}b}} {A^{-1}bc^\top A^{-1}}$$

Therefore,

\begin{align} (n I+\mathbf{11}^\top)^{-1}&=\frac{1}{n} I-\frac{1}{1+\frac{1}{n}{ 1^\top 1}}\frac{1}{n^2}\mathbf{11}^\top \\&=\frac{1}{n} I-\frac{1}{n+n}\frac{1}{n}\mathbf{11}^\top \\&=\frac{1}{n}\left( I-\frac{1}{2n}\mathbf{11}^\top\right) \end{align}


To see how the general formula is derived, first note that

$$\det (A+bc^\top)\ne 0 \implies 1+{c^\top A^{-1}b}\ne 0$$

Suppose $A$ is of order $p\times p$, and $b$ and ${c}$ are both $p\times 1$ column vectors.

Let $$d={A+bc^\top}$$

Then,

\begin{align} {dA^{-1}}&={I_p}+{bc^\top A^{-1}} \\\\&\implies {dA^{-1}b}=b+{bc^\top A^{-1}b}= b (1+{c^\top A^{-1}b}) \\\\&\implies ({dA^{-1}b})(1+{c^\top A^{-1}b})^{-1}=b \\\\&\implies ({dA^{-1}b})(1+{c^\top A^{-1}b})^{-1} c^\top={bc^\top} \\\\&\implies A+({dA^{-1}b})(1+{c^\top A^{-1}b})^{-1} c^\top= A+{bc^\top}= d \\\\&\implies A= d (1-{A^{-1}b}(1+{c^\top A^{-1}b})^{-1} c^\top) \\\\&\implies {I_p}= d (1-{A^{-1}b}(1+{c^\top A^{-1}b})^{-1} c^\top){A^{-1}} \\\\&\implies {d^{-1}}=(1-{A^{-1}b}(1+{c^\top A^{-1}b})^{-1} c^\top){A^{-1}} \end{align}

That is,

\begin{align} ( {A+bc^\top})^{-1}&={A^{-1}}-{A^{-1}b}(1+{c^\top A^{-1}b})^{-1} c^\top{A^{-1}} \\\\&={A^{-1}}-\dfrac{1}{1+{c^\top A^{-1}b}} {A^{-1}bc^\top A^{-1}} \end{align}

Related Question