Matrices code a message by multiplying numerical representations of letters by a coding matrix. The message is decoded by multiplying the coded values by the coding matrix's inverse matrix.
The Mechanism
This is HL-only content from AHL 1.14, Introduction to matrices. First, assign each character a number, such as A , B , ..., Z , and arrange the numbers into column vectors.
Suppose the message is “HI”, so H and I . Its message vector is
For longer messages, split the numerical sequence into blocks containing two values because has two columns. Each block must keep the same order. If a final block is incomplete, the question must specify a padding value.
Choose the coding matrix
The coded vector is
Check the multiplication dimensions: a matrix multiplied by a vector produces a coded vector. This dimension check catches a transposed message vector and prevents multiplying the matrices in the wrong order.
| Stage | Matrix operation | Result |
|---|---|---|
| Encode | ||
| Decode |
The matrix must be invertible, meaning . Here, , so
For a general matrix , the inverse exists only when , and it reverses the transformation exactly. If the determinant is zero, different message vectors can map to the same coded vector, so unique decoding is impossible.
Decoding gives
which converts back to “HI”. The common misconception is that the coding matrix is used again to decode. This is incorrect: decoding requires , because .
Exam Technique
For an HL short-response question, write the matrix equation before using your GDC. Check matrix dimensions and verify that the coding matrix is invertible; then convert the decoded numbers back into letters using the stated convention. On a GDC, enter the matrix and vector carefully, but show the defining matrix equation as working. Keep exact integer values where possible and state the final decoded text, not only the vector.
