2

Let $A$ be a $28 \times 28$ matrix whose $(i,j)$-th entry is $$ a_{ij} = \begin{cases} 28 &\text{if } i = j\\ -1 &\text{if } i \neq j \end{cases} $$ What is the inverse of this matrix?


I tried doing it by the adjoint method, but my resolution is wrong. First I tried finding the determinant of $A$, which I believe to be $\det(A) =28^{28}+27-14\cdot28^2-14$. Then, I tried finding the cofactor of $a_{ij}$ where $i=j$, which I believe is $\operatorname{cof}(28) =28^{27}-27-28^3$ and also the cofactor of $a_{ij} $ where $i\neq j$ which I calculated to be $\operatorname{cof}(-1)=28^{26}+27-1+27\cdot28$. Since the matrix is symmetric, I thought that the cofactor matrix is equal to the adjoint matrix, so the elements of the inverse matrix would be: $$a_{ii}^{-1}=\frac{\operatorname{cof}(28)}{\det(A)}$$ and $$a_{ij}^{-1}=\frac{\operatorname{cof}(-1)}{\det(A)}$$ where $i\neq j$. But this doesn't give the correct value. I think it might be a simple mistake, but I really can't find it so any help would be appreciated.

  • Are you interested in a formula or numerical values? Also, your determinant is incorrect. – CroCo Dec 19 '21 at 03:39
  • I want values like those that I gave for the determinant and for the cofactors (like $\det(A) =28^{28}+27-14\cdot28^2 - 14$). I put the values like that so it would be clear what products I made. Since you said my determinant is incorrect, I'll explain how I got there. $28^{28}$ is the product of the main diagonal, $27$ is the sum of all the remaining "positive products", $-14\cdot28^2$ is the sum of all "negative products" from odd columns, and $-14$ is the sum of all "negative products" from even columns. I came to this conclusion analysing $2\times2$ and $4\times4$ matrices similar to $A$. –  Dec 19 '21 at 03:53
  • 1

3 Answers3

2

Here is an another way:

Note that $A=29I - e e^T$, where $e$ is a vector of ones. It is straightforward to check that the eigenvalues are $1,29$ hence it is invertible.

To compute $A^{-1}$, solve $Ax=b$.

This is $29x-(e^Tx)e = b$, hence $29 e^T x -(e^Tx)e^T e = e^T b $, or $e^T x = e^T b$. The first equation can be written as $29 x = (e^T b)e+b=(I+e e^T)b $, and so $x = {1 \over 29} (I+e e^T)b $, from which we get $A^{-1} = {1 \over 29} (I+e e^T)$.

copper.hat
  • 172,524
  • Thanks for the answer, but I haven't studied eigenvalues and eigenvectors yet. Will take a look back at this when I have studied those things. –  Dec 19 '21 at 04:20
  • @PrincipeDiSpade You don't need to know what they are, it was just to demonstrate invertibility. All you need to do is multiply $A$ by the last matrix and check that the answer is $I$. – copper.hat Dec 19 '21 at 04:22
  • I guess you could add $(ee^T)^2 = e e^T e e^T = e (e^T e) e^T = 28 e e^T.$ I suspect that remains a sticking point. – Will Jagy Dec 19 '21 at 05:35
  • Or just multiply them out $(29I - e e^T) {1 \over 29} (I+e e^T) = I$. – copper.hat Dec 19 '21 at 05:45
  • @copper.hat Yeah, I just saw the word "eigenvalue" and thought I would not understand your answer. It's actually very clear to me otherwise. –  Dec 19 '21 at 16:25
2

More generally, let

$$ {\bf A} := (n+1) \, {\bf I}_n - {\bf 1}_n {\bf 1}_n^\top $$

Note that $\bf A$ is a rank-$1$ update of a multiple of the identity matrix. Using Sherman-Morrison,

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

1

let $W$ be the 28 by 28 matrix where every entry is $1.$ The simple fact is $$ W^2 = 28 W$$

Your matrix is $$ A = 29 I - W $$

If there is an inverse matrix $B,$ it i of the same shape, some coefficients $\beta, \gamma$ with $$ B = \beta I + \gamma W$$

With these definitions, what values of $\beta, \gamma$ make $AB = I?$

Will Jagy
  • 139,541
  • So I tried multiplying both sides of $B=\beta I+\gamma W$ by $A$ on the left, and ended up with $AB=29\beta I+(29\gamma - \beta) W- \gamma W^2$ but I'm not sure how to make RHS equal $I$. I tried doing $\beta=\frac{1}{29}$ so $29\beta I = I$, but that didn't get me anywhere. –  Dec 19 '21 at 04:18
  • @PrincipeDiSpade did you use $W^2 = 28 W ; ? ; ; $ – Will Jagy Dec 19 '21 at 04:21
  • Nope. With that I get $\beta =\gamma = \frac{1}{29} $. Is that correct? –  Dec 19 '21 at 04:24
  • @PrincipeDiSpade now put your $\beta, \gamma $ into $AB$ and see if it really works – Will Jagy Dec 19 '21 at 04:26
  • Yeah, putting it back gives the correct solutions. Thanks for the help. –  Dec 19 '21 at 04:29
  • "it is of the same shape" This is correct for this quite particular case, but is it obvious? – Surb Dec 19 '21 at 10:14
  • 1
    @Surb not obvious. There are a number of things I would prefer the OP knew, nothing yet confirms that he knows how to multiply matrices; it would be nice if he found $W^2$ by multiplication, for the 2 by2 and then 3 by3 matrix of all ones – Will Jagy Dec 19 '21 at 18:42