Case 44 · code-breaking / prefix code · Hard · About 10–15 minutes
A small radio station has a five-letter emergency alphabet. Its operators can send a message without separators between letters, because none of the letter codes is the beginning of another.
The receiving strip has arrived intact. Your task is to recover the letters first and the three words afterward.

The complete codebook is:
| Letter | Code |
|---|---|
| A | 00 |
| E | 01 |
| G | 10 |
| M | 110 |
| T | 111 |
The full received strip contains these twenty-four digits:
110010111100111100011101
Start at the left and consume complete codes in order. Read every digit exactly once. There are no missing digits, errors, reversed segments, or other letters outside the five in the codebook.
After decoding the letters, insert spaces so that the message uses each of these three words exactly once: AT, GATE, MEET. Their order is not given.
What message did the station send? A code is a string, not an ordinary decimal number. In particular, the zero at the beginning of 00 or 01 must be preserved. The illustration’s lights and controls are not an additional transmission.
Hint 1 - reveal when you want a nudge
The strip begins 110. Its first two digits 11 are not a complete code, so read the third digit before choosing a letter.
Hint 2 - reveal when you want a nudge
The beginning divides as 110 | 01 | 01 | 111, which gives MEET. Resume at the very next unused digit.
Reveal the solution and explanation
The message is MEET AT GATE.
The complete parsing is 110 | 01 | 01 | 111 | 00 | 111 | 10 | 00 | 111 | 01. Converting each group through the printed codebook gives MEETATGATE. The supplied word list then determines MEET, AT, GATE in that order.
Why is that parsing unique? Codes beginning with 0 are completed after two digits:00 is A and 01 is E. A beginning 10 is G. A beginning 11 must continue to a third digit, becoming 110 for M or 111 for T. None of these complete codes can also be the beginning of a longer complete code.
At each boundary, those cases force both the next letter and the number of digits consumed. Repeating the argument reaches the end without leaving a partial code. No later guess can create a different earlier boundary.
As an independent check, concatenating the codes for the recovered ten letters reproduces all twenty-four digits. Testing the six orders of AT, GATE, and MEET finds only one matching the decoded letters. This code is invented for the puzzle; prior knowledge of Morse code or binary alphabet numbering would add an unnecessary second system.
Solve another: The Cabinet of Fifty Mysteries · Browse all 50 cases