Artificial Wasteland · the ground beneath the wire
Two Letters Apart, One Slip Away
On 16 June 1887 a Philadelphia wool merchant sent his agent in Kansas a telegram in private cipher. Somewhere between two relay offices one letter of it changed, and the sentence I have bought became the order buy. The agent bought about three hundred thousand pounds of wool. Below are ten real commercial code books from 1878 to 1923, a hundred and seventy-six thousand code words, put to the test their own first pages advertised.
The message, and the wire it crossed
Twenty-two words in a cipher only Primrose and his agent could read. Press Send it and follow it west.
The Supreme Court, deciding the case seven years later, put the whole of it in one clause. The mistake
Primrose v. Western Union Telegraph Co., 154 U.S. 1 (1894)
and the reason nobody caught it:
the same opinion
The cipher was private, made by the two of them, and the record preserves what the whole message meant. The reporter printed both readings at once, the sent word in brackets and the delivered word after it:
“Yours of the [fifteenth] seventeenth received; am exceedingly busy; [I have bought] buy all kinds, five hundred thousand pounds; perhaps we have sold half of it; wire when you do anything; send samples immediately, promptly of [purchases] purchase.” the decoded message, statement of the case
And the physical size of the fault, from the only witness who was asked about it:
“in telegraphic symbols, according to the testimony of the only witness upon the subject, the difference between these two letters is a single dot.” the opinion, on the letters a and u
In Morse, a is dot dash and u is dot dot dash. One dot, added somewhere on thirteen hundred miles of wire between Philadelphia and western Kansas, or by a hand copying at a relay desk, and a man reporting a completed purchase became a man ordering one.
That parenthesis is the entire subject of this page. Bay and buy are one letter apart and mean opposite things, and no reading of the telegram could reveal that, because the telegram had been squeezed until there was nothing left in it to disagree with itself. Plain English is enormously redundant: garble a letter of I have bought and you get I have bosght, which is visibly broken. A code word carries a whole sentence in five or ten letters, and that is exactly what it costs. Every letter you save is a letter that can no longer contradict the others.
Western Union knew. Printed on the back of the blank Primrose signed, above his own signature, was the remedy and its price. It is given here as the reporter transcribed the blank itself, and the bracketed word is bracketed for a reason: the United States Reports print this clause twice, once in the statement of the case and once inside the opinion, and the two printings differ. The transcription of the blank says originating office; the opinion, quoting the same condition back a few pages later, says original office. Both are in the official reporter, and both modern texts consulted here reproduce their own portion faithfully. In a case that turned on one letter copied wrong, the report of it contains a word copied wrong.
the terms on the message blank, as transcribed in the statement of the case
Primrose paid the usual rate of $1.15 for the message and did not pay for a repetition. Half the regular rate, fifty-seven and a half cents, would have sent it back up the wire to Philadelphia to be laid beside the original, and the two copies would not have matched. His agent bought about 300,000 pounds of wool. His evidence at trial was a loss of upwards of $20,000. He recovered nothing.
It was not a freak. Sixteen years later the Supreme Court of Mississippi heard Postal Telegraph & Cable Co. v. Wells, in which a cotton broker's telegram carried the code word ALIKE, meaning eight and a quarter cents a pound, and arrived as ALIVE, meaning eight and three eighths. Five hundred bales were sold on the wrong figure. That plaintiff won, because Mississippi had written telegraph companies into its constitution as common carriers and the unrepeated-message clause could not protect them there. Same letter count, same silence, opposite verdict.
Break a code book yourself
This is Low's Pocket Cable Code, published in New York in 1894, seven years after Primrose's telegram. Its code words are ordinary English dictionary words, which is how nearly every code book of the period was built: a real word is easy for a clerk to read, easy to spell back, and impossible for a telegraph company to charge as more than one word.
Every entry below is from the book. The scan gave up 3,195 entries that survive the filters described at the foot of this page, out of 3,521 candidates found inside the code list, a rejection rate of 9.3%. Pick a message and send it, then let the wire take one letter.
The clerk's desk
THE CODE WORD AS IT REACHES THE CLERK · click any letter to change it
Pick a message, then break it.
The words that can silently become other words are not rare in here. 151 pairs of code words in this book sit exactly one edit apart, and 261 of its 3,195 words, about one in twelve, have at least one such twin waiting for them. A book of the same size built from words drawn at random would be expected to produce about 0.1 such pairs. Low's runs at 906 times the chance rate, and the reason is not carelessness: it is that real dictionary words come in families. Frigid and rigid, duskily and huskily, fronting and frosting. The very property that made a code word easy for a clerk to read is the property that put it next to its neighbours.
A few of them, in the book's own words
The trade names the danger
The compilers of code books were not fools and they were not ignorant of this. They wrote about it, at length, on the first pages of their own books, and they were selling against each other on it. Bentley, London, 1906:
“in most instances the code words have been compiled with only a one-letter difference between each, which entails great risk of misinterpretation… In this work every care has been exercised to eliminate telegraphic similarities and to give at least a two-letter difference between each of the half-cyphers.” Bentley's Complete Phrase Code, prefatory note
The Automobile Telegraphic Code, New York, 1917, on the page that tells a clerk how to decode:
“The code words differ from each other by at least two letters, which makes errors, arising from mutilation in transmission, practically impossible.” The Automobile Telegraphic Code, “Note that”
And the Acme Code Company of San Francisco, 1923, opening its Foreword with a boast:
“This Code consists of one hundred thousand five-letter code ciphers with at least two-letter difference between each and every word. No transposition of any two adjoining letters will make another word in the book, and we assert that it is the first time this feat has been fully accomplished for 100,000 words.” Acme Commodity and Phrase Code, Foreword
Set the mathematics aside for a moment and notice what has happened. A commercial trade, arguing about money and liability, has arrived at a rule stated as a minimum distance between the members of a code, and has understood that a minimum distance of two is exactly what it takes to make every single-letter error detectable. That is the single-error-detecting condition, and Richard Hamming would write it down properly in 1950, twenty-seven years after Acme printed it on page one as advertising copy. This observation is not ours. Steven Bellovin makes it directly in his 2025 study of telegraph codebooks: “Today, of course, we lump things like the two-letter differential into the general class of Hamming distance (Hamming 1950); codebooks, though, used the concept several decades before it was formalized.” He also notes, of Acme's boast, that “they did not quite succeed”, and prints a short figure of counterexample pairs. What follows is the census behind that remark.
One clarification first, because it is easy to assume otherwise: the two-letter difference was never a regulation. It was a design convention the compilers adopted and advertised against each other. What the International Telegraph Union actually regulated was the shape of a code word, and it kept changing the shape, which is why these books look so different across fifty years. In 1885 a code word had to be a real word of one of eight named languages and the counter clerk could demand to see your book. From 1903 artificial words were admitted provided they were pronounceable in one of those languages. In 1928 pronounceability was dropped for a minimum vowel density. By Madrid in 1932 the rule had become simply this:
“The code words, whether real or artificial, must not contain more than five letters; they may be formed in any way.” Telegraph Regulations, Madrid, 1932, Article 10 §2(2)
Five letters, formed any way at all. That is the regime the great five-letter books were built for, and it left the whole question of safety to the compilers, which is where the boasts on the first pages come from. So: did they do it? The books are scanned and public.
Ten books, measured
Ten books, 1878 to 1923, 176,759 extracted code words between them. Six of them use ordinary words of some language as code words, in the manner of Low's. Four are the later kind: fixed five-letter artificial strings, and all four of those promise a two-letter difference somewhere in their front matter.
Two numbers matter for each book, and the second one is what makes the first mean anything. Silent rate is the share of all the single-letter substitutions a wire could make to a code word in the book that land on another code word in the same book: the errors a receiving clerk cannot see. Chance is that same quantity for a code of identical size whose words were drawn at random. The comparison is not optional. A book of ten-letter words lives in a space 457 thousand times larger than a book of five-letter words, so it can hardly collide by accident however carelessly it was made, and the raw rates across books say nothing at all on their own.
| Book | Year | Words | Silent rate | Chance | × chance | Swap twins | Chance | × chance |
|---|
The result is not subtle. Every one of the six word-based books runs between 97 and 6,215 times its own chance rate: the words really do cluster, catastrophically, exactly as Bentley complained in 1906. And every one of the four books that promised a two-letter difference delivers, landing at or below chance, with a median of 0.16 times chance, which is to say roughly six times safer than drawing words out of a hat. On the error they named, the trade did the thing it said it would do. The advertising was true.
The error the rule could not see
Look at the right-hand columns of that table, and at the second row of the chart. The books that solved the substitution problem did not solve the other one, and they did not solve it by an enormous margin.
Here is why. The rule says any two code words must differ in at least two letters. Now take a clerk copying a telegram by hand at three in the morning and let his hand swap two adjoining letters: ABCAT becomes ACBAT. Two letters have changed. The rule is perfectly satisfied. And it is still one slip of one hand.
A transposition is a single physical event that registers as distance two, so a minimum distance of two gives no protection against it whatsoever. Worse: the constructions the compilers used to guarantee the two-letter difference worked by permuting letters systematically down the list, which manufactures transposition twins wholesale. The fix built the hole.
Two words from the 1917 book, one swap apart
In the 1917 book, 7,338 pairs of code words are one adjoining swap apart, out of 31,939 words. Chance, for a code of that size and shape, would give about 172. The book runs at 43 times chance on the error it did not think of, having beaten chance by a factor of twenty-five on the error it did. Bentley's 1921 printing is worse: 5,620 twin pairs in 13,894 words, 173 times chance. The scanner-noise model accounts for 7 of the 1917 book's 7,338 and 1 of Bentley's 5,620, so this is not an artefact of the scan; it is what is printed on the pages.
The one book that closed it
Acme's Foreword is the only one in the panel that names the transposition problem at all, and it claims to have eliminated it across a hundred thousand words, and calls that a first. The measurement agrees, and it is the only book here that is below chance on both axes at once.
Of the 36,616 Acme code words this scan yields, 87 pairs are one adjoining swap apart, where chance would give about 226. That is 0.4 times chance, and the scanner-noise model accounts for 42 of the 87 outright. On substitutions Acme measures 0.28 times chance. It is the only book in the panel below chance on both.
What the century of prefaces amounts to is a slow, expensive, entirely commercial rediscovery of something that is now a first lecture: an error-detecting code is only as good as its model of what errors happen. The trade could count letter differences, so it optimised letter differences, and the failure moved to the one error that letter differences do not measure. One firm in San Francisco worked out that the metric was wrong, said so on its first page, and by the arithmetic of its own book it was telling the truth.
Primrose, for his part, recovered nothing. The trial court held that because the message had not been repeated he could not have more than the toll he had paid; he declined to claim it, and the court directed a verdict for the company. The Supreme Court affirmed. Fifty-seven and a half cents, spent at the counter in Philadelphia, would have sent the message back up the wire for comparison and the two copies would not have matched.
The check
Ten public-domain scans, 176,759 code words extracted, 4,423 pairs of code words found one edit apart and 13,797 found one adjoining swap apart. Every figure on this page is recomputed from the scans by research/telegraph-codebooks/, and the verifier there does two separate jobs: it works the numbers out again from the raw scans without importing the analysis code, and it then reads the figures out of this page's own printed text and fails if the two disagree. Change a number here without changing the world and the check goes red.
What the scans can and cannot support. These are optical scans of century-old print, and the thing being measured is words that sit one letter apart, which is precisely what a scanning error produces. That is not a footnote, it is the central methodological problem, and it is handled in three ways.
- The book's own structure filters the scan. A code book is a lookup table: its words run in strict alphabetical order, and most of these books number every entry. A word is accepted only if it is in correct alphabetical order against both its neighbours, and, where serials survive, only if its serial steps by exactly one. Everything else is discarded and counted.
- The remaining bias runs one way. A scanning error that survives that filter can only add a near miss, never remove one. So every collision count here is an upper bound on the truth, and a book that measures below chance is safely below it.
- The residue is modelled. Corrupt a share of each book's word list with one random letter each, run the same order filter, and find the corruption rate that reproduces the rejection rate the real scan produced. Then count the near misses that corruption manufactured. For the six word-based books the model attributes a median of 0.4% of the measured pairs to the scanner. For the four artificial books it attributes a median of 88%, and for two of them it manufactures more than were measured, which is the honest reading that their true count may be zero. The model is applied to nothing: no number above is adjusted by it.
Only part of each book came out, and it does not matter as much as it looks. Acme printed a hundred thousand code words and this scan yields 36,616 of them, about a third. The obvious worry is that a third of a book cannot support a statement about the book. But the quantity reported here is a ratio to chance, and that ratio is invariant under subsampling: take a uniform share p of the words, and the twins you can still see fall as p2, because both halves of a pair have to survive, while the chance expectation, which goes as the square of the number of words, falls as p2 too. The raw counts here are therefore far below what the whole books contain, and the columns that compare them to chance are not.
An independent check on the extraction. Bellovin's paper prints eleven Acme pairs, supplied by Jim Reeds and read off the physical book, that fail the transposition promise. Two of the twenty-two words, HALAN and HAALN, fall inside this scan's extracted third, and they are present, as a transposition pair, in the 87 counted here. At a third coverage roughly one or two of the eleven pairs would be expected to survive with both halves intact, which is what happened. That is a small check, and it is somebody else's data, which is what makes it worth having.
The two families sit on opposite sides of that model, and not by accident. Dictionary words live in a huge sparse space, so a random corruption almost never lands on another real entry and the measured clustering is nearly all genuine. Five-letter artificial words live in a space of only 11,881,376, of which Acme's extracted list alone occupies one part in 324, so a corruption lands on a neighbour often. That is the same fact, code density, that makes the design question worth asking, and it is why the substitution finding for the artificial books is stated as an upper bound while the swap finding is not: a swap is not an edit a scanner makes, and the model attributes 7 of the 1917 book's 7,338 swap twins to it.
Not claimed. That these ten books are a representative sample of the trade; they are the ones whose scans could be parsed. That the extracted word lists are complete, and they are not: yields per book are printed above and several books gave up only part of themselves. That Acme's hundred thousand words are all here, and they are not. That Primrose's private cipher was a published code book, it was not, and the opinion is explicit that his message was “written in a cipher understood by them only”. And no claim at all that any compiler had a theory of error correction: the argument runs the other way, that a commercial trade found the single-error-detecting condition by counting money and lawsuits. And no claim that the finding that Acme fell short is new: Bellovin says so, with examples, and is cited above. The census is what is new.
Sources
The case. Primrose v. Western Union Telegraph Co., 154 U.S. 1, decided
26 May 1894. Two independent texts were used and cross-checked against each other before any
passage was quoted: the official United States Reports vol. 154 as scanned by the
Library of Congress,
and the transcription in the
Caselaw Access Project.
Where the two disagreed on a character the passage was not quoted.
Prior work, and what is new here. Steven M. Bellovin, “Compression,
correction, confidentiality, and comprehension: a modern look at telegraph codebooks,”
Cryptologia 50(4) (2025), 374–410, is the standing modern study of these books and
the source of the Hamming-distance framing quoted above, of the observation that Acme “did
not quite succeed”, and of the 1903 pronounceability rule as summarised here. Author's copy:
cs.columbia.edu/~smb/papers/codebooks.pdf.
What this page adds to that is quantity: ten books measured end to end, both error kinds separated,
each set against its own chance level, and the scanner noise modelled rather than assumed away.
The second case. Postal Telegraph & Cable Co. v. Wells, 82 Miss. 733
(1903), text from the Caselaw Access Project.
The regulation. Telegraph Regulations, Madrid, 1932, from the ITU History
Digital Collection; the earlier conference texts were read there too, and the 1903 London scan was
too damaged to quote from, which is why the 1903 rule is cited to Bellovin and not to the
regulation itself.
The books. All ten are public-domain scans at the Internet Archive, listed with
their identifiers in the table above; each title links to the scan. Extraction, analysis, the
scanner-noise model and the verifier are in
research/telegraph-codebooks/ in this project's repository.