my question is related to matrix inverting and Hill cipher(you don't have to know what it is to help me)
My teacher gave me an example. First we have a matrix (the key matrix) that multiplied by a vector of letters is another vector with the previous letters encrypted. To decrypt it you need the inverse of the key matrix and then multiply it by the vector of the encrypted letters, thus you get the vector of the decrypted letters (the real message)
Well, this is the matrix, the key matrix that I have to multiply the vectors of letters by and get the encrypted message.
$ \left[ \begin{array}{ c c } 22&27&18 \\ 18&28&5 \\ 4&17&1 \end{array} \right] $
However, when I try to invert it using multiple calculators on the internet and even programming languages (e.g. Ruby) I get a matrix (the inverted one) with a lot of 0.decimals numbers. Not whole numbers
Why am I expecting to get whole numbers? Because my teacher gave me the inverse. This is it:
$ \left[ \begin{array}{ c c } 1&18&8 \\ 2&8&11 \\ 20&24&14 \end{array} \right] $
I don't get something like this one. I know the inverse matrix is unique, but then who is wrong? Calculators bring on the same matrix, however, the matrix my teacher gave is the right matrix, because it can decrypt the encrypted message well, so it must be the good one.
Not to forget to tell you, that the inverse is the matrix mod 29.
Any idea on how I could get to the same matrix as my teacher? Thanks a lot.