# cofactor matrix in Hill cipher

And there it says that the value of K is the following:

\begin{equation} K= \begin{pmatrix} 11&8\\3&7 \end{pmatrix} \end{equation}

Now I need to calculate $K^{-1}$, so for that reason I calculate the adjoint matrix by using the cofactors. For what I know it should be:

\begin{pmatrix} 7&-3\\-8&11 \end{pmatrix}

but in the slides it appears that is:

\begin{pmatrix} 7&-8\\-3&11 \end{pmatrix}

which is different from the one I calculate, what am I doing wrong?

Over any (commutative unitary) ring $R$, the inverse of $$E=\begin{bmatrix} a&b\\c&d\end{bmatrix}, a,b,c,d \in R$$ (if it exists), can be found by first computing the determinant $f:=ad-bc$. The inverse exists iff $D$ is an invertible element in $R$, so iff $\exists f' \in R$ with $ff'=1$. Then
$$E^{-1} = \begin{bmatrix} df'&-bf'\\ -cf'& af' \end{bmatrix}$$ as a direct computation verifies.
In your case the determinant is $7\cdot 11 -3\cdot 8 = 53 = 1 \pmod{26}$ (and so in $R= \mathbb{Z}_{26}$ we have $f = f' = 1$ in the above formula).