Friedman's "Special Code Problem for the Student": solved

Six telegrams in an unenciphered five-figure code, sent between General SMITH and General DAVIDSON. The problem comes from William F. Friedman, Solving German Codes in World War I (Aegean Park Press), which gives no solution. It was posted to r/codes by u/kinako-san (post, 4 Dec 2026), who had worked on it for years. All 189 distinct code groups are identified, which reads all 567 groups of the six messages.

Solution

The system is a one-part code. The code-book lists its words in alphabetical order and numbers them upward, so a higher number always means a word later in the alphabet. A STOP group (45504) ends each sentence. Words not in the book are built from single-letter groups: the names S-M-I-T-H and D-A-V-I-D-SON, P-A-R-A-TROOPS, and the endings -S, -E-D, -I-N-G, -L-Y, -A-L and -E-S-T. Below, the plaintext is smoothed (suffixes joined, STOP written as a full stop). The visualizer shows the group-by-group reading.

In short

Visualizer: rebuilding the code-book

Step through the ten stages in which the code-book was reconstructed. Groups identified at the current stage are highlighted. Click any group, in the messages or on the number line, to see its reading, how often it occurs, and its alphabetical neighbours in the code-book.

The code-book's number line: one tick per group, tick height = how often the group occurs, labels = the single-letter groups
Click a group to inspect it.
word group single-letter group (spelling, suffixes) identified at this stage ? = not yet identified

How it was solved

    The problem's own hint pointed the way: it says the names SMITH and DAVIDSON are probably spelled out, letter by letter or by syllable. Without the one-part structure the remaining words would have needed far more text. With it, every new reading limits the readings of the groups around it.

    Evidence that the reconstruction is right

    1. Alphabetical order holds everywhere

    Sorting the 189 readings by group number puts them in strict alphabetical order, from A 00101 to ZERO 53664. A one-part code gives this order automatically. Wrong guesses usually break it.

    2. Related words get nearly consecutive numbers

    3. Group numbers follow dictionary position

    Each reading is plotted at its position in an alphabetized 60,000-word English word list, against its code number. The points fall on a nearly straight line: Pearson r = 0.99905 (r = 0.99829 against the 235,000-word web2 list). So the code-book was numbered roughly in step with a large dictionary. That makes position a usable test. For each group, its position between its two neighbours was predicted from the word list. The median error was 0.034 of the gap. This test was used to choose between candidate words for the few weakly attested groups.

    Code number vs. alphabetical rank in a 60k-word English list (189 groups; hover a dot)

    4. Readings that are not certain

    Message 6, "CANCEL OUR MESSAGE FIFTEEN". Smith's messages are numbered THREE, FOUR, FIVE, SIX. Message 5 said Sixth Brigade was out of contact, and Message 6 reports radio contact re-established, so the message being cancelled must be FIVE. Number fifteen was Davidson's own message, which Smith acknowledged in Message 2. The groups are FIFTEEN 17451 and FIVE 17718, and no single-digit slip turns one into the other. More likely whoever set the problem repeated the FIFTEEN from the earlier messages. Worth checking against the book.

    The reconstructed code-book (189 groups)

    GroupPlaintextUsesStageRank in 60k listNote

    Single-letter groups found: A D E G H I L M N O P R S T V Y. The groups for B C F J K Q U W X Z (and SEVEN) never occur in the six messages, so their numbers are unknown. Their approximate place on the number line is still clear.

    Encoder / decoder

    Decode groups

    load:
    Group by group
    Joined

    A group not in the code-book is shown with the two known words it falls between, for example [38500: REACH…REPLY].

    Encode English

    Code groups
    Breakdown

    The encoder works like the code clerk. It uses a word's own group if there is one. Otherwise it splits off an ending (-S, -ED, -ING, -LY…) from a known stem, and failing that it spells the word with the fewest groups. Full stops become STOP and digits are spelled out. A word that needs a letter missing from the reconstruction is flagged in red.

    Source and files