# TMA4155 – exercise 2

## 2010-09-20

Instead of making a PDF file with the problems, we can now write mathematics directly on the web page. If you have difficulty reading the formulas, please try a different web browser and let me know the symptoms and what browser you had trouble with. Note that you can right click on any formula and get a menu to change various aspects of the formatting, including magnification to be applied to all formulas. If you use Internet Explorer, don't change the math rendering to MathML, for IE does not support MathML and you won't be able to change back without cleaning out the cookies from your browser.

### 1 — Matrix inversion

Invert each of the matrices $\begin{pmatrix}1&2&2\\3&2&1\\2&1&1\end{pmatrix}$ and $\begin{pmatrix}1&2&3\\3&2&1\\2&1&1\end{pmatrix}$ modulo 10, if possible (or explain why it is not possible).

### 2 — Hill cipher in CBC mode

Encrypt the word banana Using the classical Hill cipher in CBC mode with a 26-letter alphabet: A=0, B=1, …, Z=25. The key is the $2\times2$ matrix $M=\begin{pmatrix}4&1\\3&7\end{pmatrix}.$ Use the initialization vector $(11,2)$. Where the standard description of CBC mode calls for bitwise XOR (which is really addition modulo 2), use componentwise addition modulo 26 instead. Write the answer using letters of the alphabet, not forgetting the IV.

Next, decrypt the message OJXIBQ using the same key, again with CBC mode (the initialization vector is included in the ciphertext, so the plaintext is only four letters long).

### 3 — Factors

Show that if $91\mid a_1a_2\cdots a_n$ then $7\mid a_i$ for at least one $i$.

### 4 — Number theory

Solve each of the following congruence relations (or sets of such).

1. $4x\equiv12\pmod{9}$
2. $3x+9\equiv21\pmod{8}$
3. $6x\equiv3\pmod{9}$
4. $6x\equiv4\pmod{9}$
5. $x\equiv7\pmod{8}$ and $x\equiv3\pmod{5}$