Inverse Covariance Matrix for null hypothesis on Chi-Squared test of Multinomial parameters I am working a problem from the book "Categorical Data Analysis" by Agresti.  I am trying to show that their stated inverse covariance matrix under the null hypothesis for a chi-squared test is infact the correct form.
Here's what I have so far:
Given that the elements of $\Sigma_0$ are
    \begin{equation}\sigma_{jk} = 
  \begin{cases}
   -\pi_j \pi_k & j \ne k\\
   \pi_j(1-\pi_j) & j = k
  \end{cases}
\end{equation}
And the elelments of $\Sigma_0^{-1}$ are $1/\pi_c$ for $j\ne k$ and $\pi_j^{-1} + \pi_c^{-1}$ for $j = k$.  To show that $\Sigma_0^{-1}$ is the inverse of $\Sigma_0$ we show that $\Sigma_0 \Sigma_0^{-1} = I$.
First notice that since $\sum_j \pi_j = 1$ (because $\pi_j$ are the multinomial probabilities) the diagonal terms are
    \begin{align} &\pi_k(1-\pi_k)(\pi_k^{-1} + \pi_c^{-1}) + \left(\sum_j {-\pi_j \pi_k \over \pi_c}\right) + \underbrace{\pi_k^2 \over \pi_c}\\
&\text{the last term above subtracts out the $kk$ term from the sum to account for the diagonal term}\\
 &= (1-\pi_k) + {\pi_k(1-\pi_k)\over \pi_c} - {\pi_k \over \pi_c}\left[\left( \sum_j \pi_j \right) - \pi_k \right]\\
 & = (1-\pi_k) + {\pi_k(1-\pi_k)\over \pi_c} - {\pi_k(1-\pi_k)\over \pi_c}\\
 & = 1-\pi_k
 \end{align}
And since $\pi_k >0$, then the diagonal terms are not 1 and $\Sigma_0 \Sigma_0^{-1} \ne I$
So is the inverse covariance matrix incorrectly defined or is my algebra wrong?
 A: The inverse of $\Sigma_0$ can also be found by the Sherman-Morrison formula. 
With $\pi = (\pi_1, \ldots, \pi_{c-1})$ and $\pi_c = 1 - \pi_1 - \ldots - \pi_{c-1}$ the $(c-1) \times (c-1)$-matrix $\Sigma_0$ can be written as 
$$\Sigma_0 = \mathrm{diag}(\pi) - \pi \pi^T.$$
Since $1 - \pi^T\mathrm{diag}(1/\pi) \pi = \pi_c$ the Sherman-Morrison formula gives that 
\begin{align*}
\Sigma_0^{-1} & = \mathrm{diag}(1/\pi) + \frac{\mathrm{diag}(1/\pi) \pi \pi^T \mathrm{diag}(1/\pi)}{1 - \pi^T\mathrm{diag}(1/\pi) \pi} \\
& = \mathrm{diag}(1/\pi) + \frac{1}{\pi_c} \mathbf{1}\mathbf{1}^T
\end{align*}
whenever $\pi_c \neq 0$, where $\mathbf{1}$ denotes the $(c-1)$-vector of ones. 
A: So what I didn't understand is that when there are "c" classes then the covariance matrix is c-1 x c-1, since if it is c x c it would be singular (because you only need c-1 probabilities to specify the probability of class c.)
Given that the elements of $\Sigma_0$ are
    \begin{equation}
\sigma_{jk} = 
  \begin{cases}
   -\pi_j \pi_k & j \ne k\\
   \pi_j(1-\pi_j) & j = k
  \end{cases}
\end{equation}
And the elelments of $\Sigma_0^{-1}$ are $1/\pi_c$ for $j\ne k$ and $\pi_j^{-1} + \pi_c^{-1}$ for $j = k$.  To show that $\Sigma_0^{-1}$ is the inverse of $\Sigma_0$ we show that $\Sigma_0 \Sigma_0^{-1} = I$.
First notice that since $\sum_j \pi_j = 1$, the diagonal terms are
    \begin{align} &\pi_k(1-\pi_k)(\pi_k^{-1} + \pi_c^{-1}) + \sum_j^c {-\pi_j \pi_k \over \pi_c} - \underbrace{{-\pi_k^2 \over \pi_c} - {-\pi_k \pi_c \over \pi_c}}_{\text{"kk" and "kc" terms}}\\
 = & (1-\pi_k) + {\pi_k(1-\pi_k)\over \pi_c} - {\pi_k \over \pi_c}\left[\left( \sum_j \pi_j \right) - \pi_k \right] + \pi_k\\
 = & 1-\pi_k + {\pi_k(1-\pi_k)\over \pi_c} - {\pi_k(1-\pi_k)\over \pi_c} + \pi_k\\
 = & 1
 \end{align}
The off-diagonal terms are
    \begin{align}
&{\pi_k(1-\pi_k) \over \pi_c}  + (\pi_i^{-1} + \pi_c^{-1})(-\pi_k\pi_i) + \sum_j^c {-\pi_k \pi_j \over \pi_c} - \underbrace{{-\pi_k^2 \over \pi_c} -  {-\pi_k \pi_i \over \pi_c}- {-\pi_k \pi_c \over \pi_c} }_{\text{diagonal terms and "kc" term}}\\
 = & {\pi_k(1-\pi_k) \over \pi_c} - {\pi_k \pi_c \over \pi_c} - {\pi_k \pi_i \over \pi_c}  - {\pi_k(\sum_j^c \pi_j-\pi_k) \over \pi_c} - {-\pi_k \pi_c \over \pi_c} - {-\pi_k \pi_i \over \pi_c}\\
 = & 0
 \end{align}
