Baudot
Morse paid for the common letters with time. Five bits cost the same for every letter, so this one had to pay with something else.
The code, graded
characters sent 386holes punched 737of those, letters 615best arrangement 595time, five units each 1,930
Sending this punches 737 holes, 615 of them for letters. The best possible assignment of the twenty-six letter codes would punch 595 for those same letters, so Murray's assignment is 3.4% worse than itself rearranged. Against an assignment that ignored frequency altogether it saves 22.1%. It sits 5.1% of the way from the best arrangement to the worst. The time does not move: 1,930 units, 5 for every one of 386 characters, under every arrangement above and every arrangement anyone could invent. That is what fixed width costs and what it buys.
Left is the best possible arrangement of these thirty-two codes. Right is the worst.
This text changes shift 9 times. Each one is a whole character that carries no text, costing 5 units and, for the return to letters, five holes — the most expensive code in the set. That is the bill for thirty-two codes having to mean sixty-odd things.
Every letter, commonest first
Five positions on the tape, always five, filled where the code punches. The number on the right is how many holes that letter costs, and in brackets what it would have cost if the codes were dealt out by frequency. Press a letter to hear it at 45.45 baud: the tones change and the length never does.
Where the code pays for it
Only 5 codes punch a single hole, and 3 of them went to line feed, the space and carriage return. That leaves exactly 2 for letters, E and T, and 10 more codes punching two. So 12 letters hold a cheap code, and 12 letters are the commonest here. The difference is the whole of what the assignment gives away: D, the 13th and Z, the 26th hold seats that belong to F, the 10th and U, the 12th.
Checked when this page loaded: all 32 five-bit patterns are present exactly once, and the hole groups come out 1, 5, 10, 10, 5, 1 — the binomial coefficients, which is what a complete table must give and what a mistyped one would not. The rearrangement rule was checked too, by trying all 120 arrangements of a five-code alphabet: the cheapest cost 188, which is what pairing them in order gives (188).
What fixed width takes away
Morse gave the common letters the short signals, and E costs one unit where Q costs thirteen. That is the machine next door on this site, and the interesting part is how close to optimal it got.
A five-unit code cannot do any of it. Every character is five units on the wire, E and Q alike, and that is the whole reason the thing works: a machine can decode it without listening to an operator's rhythm, because it knows exactly when each character ends. Fixed width is what made the telegraph into a printer. It also means letter frequency has nothing left to buy.
So Donald Murray spent it on a different currency. A hole is a punch striking paper, and a punch striking paper is wear on a machine that runs all day. His assignment gives the codes with the fewest holes to the characters that come up most. Same idea as the print shop in Morristown, different bill.
The number that cannot move
The readout above prints holes and it prints time. Rearrange the code any way you like and the holes change; the time is five units times the characters sent and there is nothing to rearrange. That is not a claim on this page, it is arithmetic the page performs in front of you, and it is the difference between the two machines stated as a measurement rather than as a sentence.
The answer, on ordinary English
On the archived copy of Pride and Prejudice this page cites, counting the 563,924 letters between the Project Gutenberg start and end markers, Murray's assignment punches 1,141,647 holes. The best possible arrangement of those same codes punches 1,119,357, so he is 1.99% off the best possible. Against an assignment that ignored frequency altogether he saves 22.6%. He sits 3.2% of the way from the best arrangement to the worst.
Morse, measured the same way on the same text, is 6.69% off. Murray had the easier problem, because he was dealing out thirty-two codes rather than inheriting twenty-six signals of wildly different lengths, and he also had fifty years and somebody else's work to look at. Both of those are worth saying before anyone reads 1.99% as the better man.
One letter is most of what he lost
The ten two-hole codes went to A O I N H S R D L and Z. The ten commonest letters in that text after E and T are A O I N H S R D L and U. That is the entire difference: one swap. Z is the twenty-fourth commonest letter here and it is sitting in a seat that belongs to the twelfth.
It costs 15,786 extra punches out of 22,290, which is most of everything the assignment gives away. No source says why, and the honest position is that there may not be a why worth recovering: a code has to put every letter somewhere, and one seat filled oddly in 1901 is not obviously a decision rather than an accident.
Whose code this actually is
Not Baudot's. Émile Baudot's five-unit code is ITA1, and it went with a five-key keyboard played like a chord, three fingers of the right hand and two of the left. The code graded above is Donald Murray's from around 1901, standardised by the CCITT as ITA2 around 1930, and it is what every teletype used and what every table online prints under the name Baudot.
And 1874 is not the year of the five-unit code either, though it is the year everybody gives. Baudot's patent of 17 June 1874 covered his multiplex printing telegraph, and the code it carried had six units, which is 64 combinations for an alphabet that needs about 27. He moved to five in 1876, and the five-unit code is the one with the shift, the one this page grades, and the one the word Baudot now means. So the interesting date and the famous date are two years apart.
Murray's reason for changing it was the keyboard: once an operator typed on something typewriter-shaped and a machine punched the tape, the bit pattern no longer had to match what the fingers did, so it was free to be chosen for the machine instead. That freedom is exactly what let him buy the wear. The date on this page is written as a pair for the same reason Morse's is: the structure is 1876 and the assignment measured here is 1901.
What thirty-two codes cannot hold
Twenty-six letters, ten digits and punctuation do not fit in thirty-two, so every code means two things and a shift character says which. Type a phone number into the box and the cost appears: a trip into figures and back is two whole characters that carry no text at all. Z-Characters on this site is Infocom doing the same trick with five-bit text a century later, and paying the same way.
The same bill turns up in a third currency. A punch card has twelve rows per column and far more patterns than it ever spends, and caps a character at three holes anyway, because a fourth removes enough material for the card to tear in the feed rollers. Not a descendant of this one: Hollerith's cards are older than Murray's assignment, so they are a parallel answer to the same shortage, paid in material rather than in wear. Zork ran out of the same five bits in 1979 and reached for the same shift.
What is real here, and what is not
The code measured is not the code in the title
ITA2, Murray's, is what is graded. Baudot's own ITA1 is a different assignment and could not be graded the same way, for reasons set out below. Every "Baudot encoder" online has this backwards or silent, and measuring one man's work under another man's name is the quiet error this studio exists to avoid, so the page says which twice and dates itself as a pair.
The grade covers letters and nothing else
Digits and punctuation ride on the letter codes in figure shift, so rearranging the letters would move their cost too. Quoting a total number of holes against a best arrangement computed for letters only would be comparing two different things and calling the difference a finding. The readout prints the total, prints the letters' share of it, and grades only the second.
Why ITA1 is not graded here alongside ITA2
It is the obvious next measurement and it is not made, because "Baudot's code" is not one table. The version the British Post Office ran inland differs from the continental one, CCITT only standardised ITA1 in 1926, and characters were deliberately left free for national use. A single number graded against a code with national variants would be a number about whichever variant happened to get typed in.
There is a second reason and it is the more interesting one. Holes were not Baudot's currency. His code was played as a chord on five keys in time with a distributor, not punched onto tape; the tape came with Murray, and so did the cost of punching it. Scoring ITA1 by hole count would be marking a code against a bill it never received, which is the same mistake as praising Morse for something Vail never chose.
There is no sourced reason for Z
Z holds a two-hole code and is one of the rarest letters in English. It is the single biggest thing the assignment gives away and neither source consulted explains it. The page measures it and stops there rather than offering a plausible story, because a plausible story about a decision made in 1901 is the kind of thing that gets repeated afterwards as fact.
LTRS is the most expensive code and this page does not say why
The return from figures to letters is 11111, all five holes, the dearest code in the set, and it is sent every time a number ends. The tempting explanation is that all-holes is the one pattern you can punch over any other, so it doubles as the erase code the way ASCII's DEL is 0x7F. Neither source consulted says that about ITA2. It is left here as something that looks true and is not established.
Frequency is whatever you paste
No letter frequencies are stored on this page. They are counted from the text in the box, so the grade is a fact about your text rather than about English in general. Which letter Z displaced depends on the text: on the novel quoted above it is U, and on the Linotype ETAOIN SHRDLU ordering it is U as well, but a short or unusual passage will move it.
Nothing here is a real teleprinter
No motor, no start and stop bits, no baud rate, no paper. The five units are counted, not timed, and a real ITA2 character on the wire carries a start bit and a stop of one and a half units on top of them, which is the same constant for every character and therefore cancels out of every comparison made here. The tape drawn in the table is five positions in a row because that is what is being priced, not because it looks like tape.
Sources
- Gil Smith, Teletypewriter Communication Codes, 2001, for the full thirty-two-row table and for Baudot against Murray
- Baudot code, Wikipedia, for the hole groups stated independently of that table and for the five-key keyboard
- Eric Fischer, The Evolution of Character Codes 1874-1968, for the six-unit code of the 1874 patent and the change to five units in 1876
- Pride and Prejudice, Project Gutenberg, the text the quoted figures are counted from