# Inverse of a special matrix of arbitrary size

1. Jun 2, 2014

### stormyweathers

Hey guys.

In a project I'm working on, it would be very convienent to express the inverse of this matrix in terms of its size, NxN.

The matrix is
$$\leftbrace \begin{tabular}{c c c c} a & b & \ldots & b \\ b & a & \ldots & b \\ b & b & \ddots & b \\ \vdots & vdots & ldots & b \\ b & b & \ldots & b \\ \end{tabular} \rightbrace$$
[the tex isnt working, but the matrix is just constant b, except on the diagonal where it is a]

I can see a pattern in the inverses for N=2,3 ; the whole this is divided by det(A) and each element is given by the determinant of its corresponding cominor. This is great because it gives me a recursive formula for computing the inverse. But I'd like to be able to express it explicitly so I can write down the $$i^{th}$$ row in general

2. Jun 2, 2014

### D H

Staff Emeritus
I think this is what you meant:

$$\begin{bmatrix} a & b & \ldots & b \\ b & a & \ldots & b \\ \vdots & & \ddots & \vdots \\ b & b & \ldots & a \\ \end{bmatrix}$$

That's a Toeplitz matrix, and a rather special one at that. For an NxN matrix of this form, the determinant is $(a-b)^{N-1}(a+(N-1)b)$ and the inverse is simply:

$$\frac 1{(a-b)(a+(N-1)b)} \begin{bmatrix} a+(N-2)b & -b & \ldots & -b \\ -b & a+(N-2)b & \ldots & -b \\ \vdots & & \ddots & \vdots \\ -b & -b & \ldots & a+(N-2)b \\ \end{bmatrix}$$

3. Jun 2, 2014

### jbunniii

Your matrix is of the form
$$aI + b(1-I)$$
where $I$ is the $n \times n$ identity matrix, and $1$ is the $n \times n$ matrix consisting of all ones. We might speculate that the inverse has the same form $cI + d(1-I)$. Let's see if that will work:
\begin{align} (aI + b(1-I))(cI + d(1-I)) &= acI + ad(1-I) + bc(1-I) + bd(1-I)^2 \\ &= (ac - ad - bc)I + (ad + bc)1 + bd(n1 - 1 - 1 + I) \\ &= (ac - ad - bc)I + (ad + bc)1 + bd((n-2)1 + I) \\ &= (ac - ad - bc + bd)I + (ad + bc + bd(n-2))1 \\ \end{align}
where on line 2, we have used the fact that $1^2 = n1$. We need the final expression to equal the identity $I$. This will be true provided that $ac - ad - bc + bd = 1$ and $ad + bc + bd(n-2) = 0$. We have two linear equations with two unknowns ($c$ and $d$), so for most values of $a$ and $b$ there should be a unique solution. I'm too lazy to carry out the rest of the algebra to confirm. :tongue:

4. Jun 2, 2014