Authors of the code:
Morse and Vail (1840s), then Gerke (1848, Hamburg–Cuxhaven line: only the dot and the dash), the Austro-German telegraph union (1851 according to some sources, in force on 1st July 1852 according to Pierpont), the Paris conference of 1865.
American Morse
The American line code had internal silences (C, O, R, Y, Z) and dashes of several lengths. More compact, but a trap in noise: radio imposed the international code.
The unit
Dot 1, dash 3; silences of 1 within a letter, 3 between letters, 7 between words (ITU-R M.1677-1). Dot duration: 1200 ÷ wpm ms. PARIS = 50 units, CODEX = 60.
The optimum of the code
The international code, inherited from Vail, with English frequencies: 6.08 units per letter (without the letter space), against 5.69 at best and 8.23 at random. About 7% from the optimum; 4.5% counting the letter space. The O (11 units, 4th letter of English) costs the most.
The ITU table
A single accent, é; the at sign .--.-. ; « error » = eight dots; « understood » ...-. ; « wait » .-... ; « end of work » ...-.- ; « invitation to transmit » -.- .
Prosigns
Sent without letter space: AR 13 units (A R: 15), SK 15 (S K: 17), BT 13, KN 15. SOS: 23 as one sign, 27 as three letters.
Cut numbers
Usage, not standard: 1 = A, 2 = U, 3 = V, 5 = E, 8 = D, 9 = N, 0 = T; 7 = B or G depending on the tables. « 5NN »: 25 units, « 599 »: 49.
Going further
Durations, in detail
Duration of a code (internal silences included): u = p + 3t + (p + t − 1), with p dots and t dashes. PARIS: P 11 + A 5 + R 7 + I 3 + S 5 = 31, plus 4 × 3 + 7 = 19 of spaces, which makes 50. Hence tdot = 60 / (50 × wpm) s = 1200 / wpm ms: 12 wpm → 100 ms, 20 → 60, 25 → 48, 30 → 40, 40 → 30. With the same key, wpmPARIS = 1.2 × wpmCODEX.
The optimum, recalculated
It concerns the International Code (ITU), inherited from Vail by Gerke, not Vail's American Morse itself. Weighted average of durations of the 26 letters according to Lewand's frequencies (E 12.70%, T 9.06%, A 8.17%...): 6.08 units. Optimal attribution (durations given to letters sorted by frequency): 5.69. Chance (average of the 26 durations, 214/26): 8.23. Difference from optimum: +6.9%; gain over chance: 26%. These durations include internal silences but not letter space; adding its 3 units to each letter reduces the difference to +4.5% (9.08 vs. 8.69). Frequencies depend on the chosen corpus. The code was revised from 1848 to 1865 for other languages; this calculation is only valid for English.
Dates: what is debated
The adoption of Gerke's code by the Austro-German telegraph union is dated 1851 by some sources, and its entry into force 1st July 1852 by Pierpont; no source I read says whether the two dates complement each other. The Paris conference is dated 1865 (17 May) by most, 1864 by a few. Vail's exact role in choosing the codes remains debated; the counting in a printer's type case is a tradition with no archive document.