Linear Algebra – Inverse of a Matrix with Uniform Off Diagonals

inverselinear algebramatrices

Suppose that we have an all positive matrix where the off diagonal elements are all identical. Can one calculate the inverse of the matrix analytically, or more efficiently than the general case? For example:

$$
\begin{bmatrix}
1 & .1 & .1 \\
.1 & 2 & .1 \\
.1 & .1 & 3 \\
\end{bmatrix}
$$

Best Answer

Let $A$ be the matrix whose entries are $A_{i,j} = \begin{cases}a_{i} & \text{if} \ i = j \\ \alpha & \text{if} \ i \neq j\end{cases}$.

Let $D$ be the diagonal matrix with diagonal entries $D_{i,i} = a_i - \alpha$.

Then, $A = D + \alpha vv^T$ where $v$ is a $n \times 1$ vector of all ones.

If $A$ and $D$ are both invertible, then we may apply the Sherman-Morrison formula to get $$A^{-1} = (D+\alpha vv^T)^{-1} = D^{-1} - \dfrac{\alpha D^{-1} vv^T D^{-1}}{1 + \alpha v^TD^{-1}v}$$

Since $D$ is diagonal, the inverse of $D$ is simply a diagonal matrix with entries $(D^{-1})_{i,i} = (D_{i,i})^{-1} = \dfrac{1}{a_i - \alpha}$.

From here, it is easy to compute $A^{-1}$. The $i,j$-th entry of $A^{-1}$ is given by $$(A^{-1})_{i,j} = \begin{cases}\dfrac{1}{a_i-\alpha} - \dfrac{1}{c(a_i-\alpha)^2} & \text{if} \ i = j \\ - \dfrac{1}{c(a_i-\alpha)(a_j-\alpha)} & \text{if} \ i \neq j\end{cases},$$

where $c = \dfrac{1}{\alpha} + \displaystyle\sum_{i = 1}^{n}\dfrac{1}{a_i-\alpha}$.

Of course, this doesn't handle the case where $D$ isn't invertible, which occurs precisely when $a_i = \alpha$ for some $i$.

Related Question