Letter frequency

From Wikipedia, the free encyclopedia - View original article

 
Jump to: navigation, search

The frequency of letters in text has often been studied for use in cryptanalysis, and frequency analysis in particular.

No exact letter frequency distribution underlies a given language, since all writers write slightly differently. Linotype machines assumed the letter order, from most to least common, to be etaoin shrdlu cmfwyp vbgkjq xz based on the experience and custom of manual compositors.

Likewise, Modern International Morse code encodes the most frequent letters with the shortest symbols; arranging the Morse alphabet into groups of letters that require equal amounts of time to transmit, and then sorting these groups in increasing order, yields e it san hurdm wgvlfbk opjxcz yq. Similar ideas are used in modern data-compression techniques such as Huffman coding.

Letter frequency was also used by other telegraph system, such as, for instance by Donald Murray, in the Murray Code.

Introduction[edit]

Letter frequencies, like word frequencies, tend to vary, both by writer and by subject. One cannot write an essay about x-rays without using frequent Xs, and the essay will have an idiosyncratic letter frequency if the essay is about the frequent use of x-rays to treat zebras in Qatar. Different authors have habits which can be reflected in their use of letters. Hemingway's writing style, for example, is visibly different from Faulkner's. Letter, bigram, trigram, word frequencies, word length, and sentence length can be calculated for specific authors, and used to prove or disprove authorship of texts, even for authors whose styles are not so divergent.

Accurate average letter frequencies can only be gleaned by analyzing a large amount of representative text. With the availability of modern computing and collections of large text corpora, such calculations are easily made. Examples can be drawn from a variety of sources (press reporting, religious texts, scientific texts and general fiction) and there are differences especially for general fiction with the position of 'h' and 'i', with H becoming more common.

Herbert S. Zim, in his classic introductory cryptography text "Codes and Secret Writing", gives the English letter frequency sequence as "ETAON RISHD LFCMU GYPWB VKJXQ Z", the most common letter pairs as "TH HE AN RE ER IN ON AT ND ST ES EN OF TE ED OR TI HI AS TO", and the most common doubled letters as "LL EE SS OO TT FF RR NN PP CC".[1]

The "top twelve" letters comprise about 80% of the total usage. The "top eight" letters comprise about 65% of the total usage. Letter frequency as a function of rank can be fitted well by several rank functions, with the two-parameter Cocho/Beta rank function being the best.[2] Another rank function with no adjustable free parameter also fits the letter frequency distribution reasonably well[3] (the same function has been used to fit the amino acid frequency in protein sequences.[4]) A spy using the VIC cipher or some other cipher based on a straddling checkerboard typically uses a mnemonic such as "a sin to err" (dropping the second "r") to remember the top eight characters.

The use of letter frequencies and frequency analysis plays a fundamental role in cryptograms and several word puzzle games, including Hangman, Scrabble and the television game show Wheel of Fortune. One of the earliest description in classical literature of applying the knowledge of English letter frequency to solving a cryptogram is found in E.A. Poe's famous story The Gold-Bug, where the method is successfully applied to decipher a message instructing on the whereabouts of a treasure hidden by Captain Kidd.[5]

Letter frequencies had a strong effect on the design of some keyboard layouts. The most-frequent letters are on the bottom row of the Blickensderfer typewriter, and the home row of the Dvorak Simplified Keyboard.

Relative frequencies of letters in the English language[edit]

Relative frequencies of letters in text.
Relative frequencies ordered by frequency.

Analysis of entries in the Concise Oxford dictionary is published by the compilers.[6] The table below is taken from Pavel Mička's website, which cites Robert Lewand's Cryptological Mathematics.[7]

LetterRelative frequency in the English language
a8.167%8.167
 
b1.492%1.492
 
c2.782%2.782
 
d4.253%4.253
 
e12.702%12.702
 
f2.228%2.228
 
g2.015%2.015
 
h6.094%6.094
 
i6.966%6.966
 
j0.153%0.153
 
k0.772%0.772
 
l4.025%4.025
 
m2.406%2.406
 
n6.749%6.749
 
o7.507%7.507
 
p1.929%1.929
 
q0.095%0.095
 
r5.987%5.987
 
s6.327%6.327
 
t9.056%9.056
 
u2.758%2.758
 
v0.978%0.978
 
w2.360%2.36
 
x0.150%0.15
 
y1.974%1.974
 
z0.074%0.074
 

This table differs slightly from others,[how?] such as Cornell University Math Explorer's Project, which produced a table after measuring 40,000 words.[8]

In English, the space is slightly more frequent than the top letter (e) [9] and the non-alphabetic characters (digits, punctuation, etc.) collectively occupy the fourth position, between t and a.[10]

Relative frequencies of the first letters of a word in the English language[edit]

The frequency of the first letters of words or names is helpful in pre-assigning space in physical files and indexes.[11] Given 26 filing cabinet drawers, rather than a 1:1 assignment of one drawer to one letter of the alphabet, it is often useful to use a more equal-frequency-letter code by assigning several low-frequency letters to the same drawer (often one drawer is labeled VWXYZ), and to split up the most-frequent initial letters -- S, A, and C -- into several drawers (often 4 drawers Aa-An, Ao-Az, Ca-Cj, Ck-Cz, Sa-Si, Sj-Sz). The same system is used in some multi-volume works such as some encyclopedias.

The first letter of an English word, from most to least common, s a c m p r t b f g d h i n e l o w u v j k q y z x.[11]

The frequency distribution of the first letter of Hindi words is also significantly different from the overall frequency distribution of letters in Hindi words.[12]

Both the overall letter distribution and the word-initial letter distribution approximately match the Zipf distribution and even more closely match the Yule distribution.[12]

Often the frequency distribution of the first digit in each datum is significantly different from the overall frequency of all the digits in a set of numeric data -- see Benford's law for details.

Analysis of a subset of Project Gutenberg text shows the following frequencies of letters at the starts of words:[13]

LetterRelative frequency as the first letter of an English word
a11.602%11.602
 
b4.702%4.702
 
c3.511%3.511
 
d2.670%2.67
 
e2.007%2.007
 
f3.779%3.779
 
g1.950%1.95
 
h7.232%7.232
 
i6.286%6.286
 
j0.597%0.597
 
k0.590%0.59
 
l2.705%2.705
 
m4.374%4.374
 
n2.365%2.365
 
o6.264%6.264
 
p2.545%2.545
 
q0.173%0.173
 
r1.653%1.653
 
s7.755%7.755
 
t16.671%16.671
 
u1.487%1.487
 
v0.649%0.649
 
w6.753%6.753
 
x0.017%0.017
 
y1.620%1.62
 
z0.034%0.034
 

Relative frequencies of letters in other languages[edit]

LetterFrench [14]German [15]Spanish [16]Portuguese [17]Esperanto [18]Italian[19]Turkish[20]Swedish[21]Polish[22]Dutch [23]Danish[24]Icelandic[25]Finnish[26]Czech
a7.636%6.516%11.525%14.634%12.117%11.745%12.920%9.383%10.503%7.486%6.025%10.110%12.217%8.421%
b0.901%1.886%2.215%1.043%0.980%0.927%2.844%1.535%1.740%1.584%2.000%1.043%0.281%0.822%
c3.260%2.732%4.019%3.882%0.776%4.501%1.463%1.486%3.895%1.242%0.565%00.281%0.740%
d3.669%5.076%5.510%4.992%3.044%3.736%5.206%4.702%3.725%5.933%5.858%1.575%1.043%3.475%
e14.715%16.396%12.681%11.570%8.995%11.792%9.912%10.149%7.352%17.324%15.453%6.418%7.968%7.562%
f1.066%1.656%0.692%1.023%1.037%1.153%0.461%2.027%0.143%0.805%2.406%3.013%0.194%0.084%
g0.866%3.009%1.768%1.303%1.171%1.644%1.253%2.862%1.731%3.403%4.077%4.241%0.392%0.092%
h0.737%4.577%0.703%0.781%0.384%0.636%1.212%2.090%1.015%2.380%1.621%1.871%1.851%1.356%
i7.529%6.550%6.247%6.186%10.012%10.143%9.600%*5.817%8.328%6.499%6.000%7.578%10.817%6.073%
j0.613%0.268%0.443%0.397%3.501%0.011%0.034%0.614%1.836%1.461%0.730%1.144%2.042%1.433%
k0.049%1.417%0.011%0.015%4.163%0.009%5.683%3.140%2.753%2.248%3.395%3.314%4.973%2.894%
l5.456%3.437%4.967%2.779%6.145%6.510%5.922%5.275%2.564%3.568%5.229%4.532%5.761%3.802%
m2.968%2.534%3.157%4.738%2.994%2.512%3.752%3.471%2.515%2.213%3.237%4.041%3.202%2.446%
n7.095%9.776%6.712%4.046%7.955%6.883%7.987%8.542%6.237%10.032%7.240%7.711%8.826%6.468%
o5.598%2.594%8.683%9.735%8.779%9.832%2.976%4.482%6.667%6.063%4.636%2.166%5.614%6.695%
p2.521%0.670%2.510%2.523%2.755%3.056%0.886%1.839%2.445%1.370%1.756%0.789%1.842%1.906%
q1.362%0.018%0.877%1.204%00.505%00.020%00.009%0.007%00.013%0.001%
r6.693%7.003%6.871%6.530%5.914%6.367%7.722%8.431%5.243%6.411%8.956%8.581%2.872%4.799%
s7.948%7.273%7.977%6.805%6.092%4.981%3.014%6.590%5.224%5.733%5.805%5.630%7.862%5.212%
t7.244%6.154%4.632%4.736%5.276%5.623%3.314%7.691%2.475%6.923%6.862%4.953%8.750%5.727%
u6.311%4.166%2.927%3.634%3.183%3.011%3.235%1.919%2.062%2.192%1.979%4.562%5.008%2.160%
v1.838%0.846%1.138%1.575%1.904%2.097%0.959%2.415%0.012%1.854%2.332%2.437%2.250%5.344%
w0.074%1.921%0.017%0.037%00.033%00.142%5.813%1.821%0.069%00.094%0.016%
x0.427%0.034%0.215%0.253%00.003%00.159%0.004%0.036%0.028%0.046%0.031%0.027%
y0.128%0.039%1.008%0.006%00.020%3.336%0.708%3.206%0.035%0.698%0.900%1.745%1.043%
z0.326%1.134%0.517%0.470%0.494%1.181%1.500%0.070%4.852%1.374%0.034%00.051%1.503%
à0.486%000.072%00.635%00000000
â0.051%000.562%0000000000
á000.502%0.118%00000001.799%00.867%
å00000001.338%001.190%00.003%0
ä00.447%000001.797%00003.577%0
ã0000.733%0000000000
ą000000000.699%00000
æ00000000000.872%0.867%00
œ0.018%0000000000000
ç0.085%000.530%001.156%0000000
ĉ00000.657%000000000
ć000000000.743%00000
č00000000000000.462%
ď00000000000000.015%
ð000000000004.393%00
è0.271%00000.263%00000000
é1.504%00.433%0.337%00000000.647%00.633%
ê0.225%000.450%0000000000
ë0.001%0000000000000
ę000000001.035%00000
ě00000000000001.222%
ĝ00000.691%000000000
ğ0000001.125%0000000
ĥ00000.022%000000000
î0.045%0000000000000
ì000000.030%00000000
í000.725%0.132%00000001.570%01.643%
ï0.005%0000000000000
ı0000005.114%*0000000
ĵ00000.055%000000000
ł000000002.109%00000
ñ000.311%00000000000
ń000000000.362%00000
ň00000000000000.007%
ò000000.002%00000000
ö00.573%00000.777%1.305%0000.777%0.444%0
ô0.023%000.635%0000000000
ó000.827%0.296%00001.141%000.994%00.024%
ø00000000000.939%000
ř00000000000000.380%
ŝ00000.385%000000000
ş0000001.780%0000000
ś000000000.814%00000
š00000000000000.688%
ß00.307%000000000000
ť00000000000000.006%
þ000000000001.455%00
ù0.058%00000.166%00000000
ú000.168%0.207%00000000.613%00.045%
ŭ00000.520%000000000
ü00.995%0.012%0.026%001.854%0000000
ů00000000000000.204%
ý000000000000.228%00.995%
ź000000000.078%00000
ż000000000.706%00000
ž00000000000000.721%

*See Dotted and dotless I

The figure below illustrates the frequency distributions of the 26 most common Latin letters across some languages. Template:Letter frequencies in 14 languages

Based on these tables, the 'etaoin shrdlu'-equivalent results for each language is as follows:

All these languages use a basically similar 25+ character alphabet.

See also[edit]

References[edit]

  1. ^ Zim, Herbert Spencer. (1961). Codes & Secret Writing: Authorized Abridgement. Scholastic Book Services. OCLC 317853773. 
  2. ^ Li, Wentian; Miramontes, Pedro (2011). "Fitting ranked English and Spanish letter frequency distribution in US and Mexican presidential speeches". Journal of Quantitative Linguistics 18 (4): 359. doi:10.1080/09296174.2011.608606. 
  3. ^ Gusein-Zade, S.M. (1988). "Frequency distribution of letters in the Russian language". Probl. Peredachi Inf. 24 (4): 102–7. 
  4. ^ Gamow, George; Ycas, Martynas (1955). "Statistical correlation of protein and ribonucleic acid composition". Proc. Natl. Acad. Sci. 41 (12): 1011–19. doi:10.1073/pnas.41.12.1011. PMC 528190. 
  5. ^ Poe, Edgar Allan. "The works of Edgar Allan Poe in five volumes". Project Gutenberg. 
  6. ^ "What is the frequency of the letters of the alphabet in English?". Oxford Dictionary. Oxford University Press. Retrieved 29 December 2012. 
  7. ^ Mička, Pavel. "Letter frequency (English)". Algoritmy.net. 
  8. ^ http://www.math.cornell.edu/~mec/2003-2004/cryptography/subs/frequencies.html
  9. ^ Statistical Distributions of English Text
  10. ^ Lee, E. Stewart. "Essays about Computer Security" (PDF). University of Cambridge Computer Laboratory. p. 181. 
  11. ^ a b Herbert Marvin Ohlman. "Subject-Word Letter Frequencies with Applications to Superimposed Coding". [1] Proceedings of the International Conference on Scientific Information (1959).
  12. ^ a b Hemlata Pande and H. S. Dhami. "Mathematical Modelling of Occurrence of Letters and Word’s Initials in Texts of Hindi Language".
  13. ^ Calculated from "Project Gutenberg Selections" available from the NLTK Corpora
  14. ^ "CorpusDeThomasTempé". Retrieved 2007-06-15. 
  15. ^ Beutelspacher, Albrecht (2005). Kryptologie (7 ed.). Wiesbaden: Vieweg. p. 10. ISBN 3-8348-0014-7. 
  16. ^ Pratt, Fletcher (1942). Secret and Urgent: the Story of Codes and Ciphers. Garden City, N.Y.: Blue Ribbon Books. pp. 254–5. OCLC 795065. 
  17. ^ "Frequência da ocorrência de letras no Português". Retrieved 2009-06-16. 
  18. ^ "La Oftecoj de la Esperantaj Literoj". Retrieved 2007-09-14. 
  19. ^ Singh, Simon; Galli, Stefano (1999). Codici e Segreti (in Italian). Milano: Rizzoli. ISBN 978-8-817-86213-4. OCLC 535461359. 
  20. ^ Serengil, S.I., Akin, M. "Attacking Turkish Texts Encrypted by Homophonic Cipher" Proceedings of the 10th WSEAS International Conference on Electronics, Hardware, Wireless and Optical Communications, pp.123-126, Cambridge, UK, February 20-22, 2011.
  21. ^ "Practical Cryptography". Retrieved 2013-10-30. 
  22. ^ Wstęp do kryptologii, counting [space] 17.2%, [dot point] 0.9%, [comma] 0.9% and [semicolon] 0.5%
  23. ^ a b "Letterfrequenties". Genootschap OnzeTaal. Retrieved 2009-05-17. 
  24. ^ "Practical Cryptography". Retrieved 2013-10-24. 
  25. ^ "Practical Cryptography". Retrieved 2013-10-24. 
  26. ^ "Practical Cryptography". Retrieved 2013-10-24. 
  27. ^ Perec, Georges; Alphabets; Éditions Galilée, 1976
Notes

Some useful tables for single letter, digram, trigram, tetragram, and pentagram frequencies based on 20,000 words that take into account word-length and letter-position combinations for words 3 to 7 letters in length. The references are as follows:

  1. Mayzner, M.S.; Tresselt, M.E. (1965). "Tables of single-letter and digram frequency counts for various word-length and letter-position combinations". Psychonomic Monograph Supplements 1 (2): 13–32. OCLC 639975358. 
  2. Mayzner, M.S.; Tresselt, M.E.;Wolin, B.< R.< (1965). "Tables of trigram frequency counts for various word-length and letter-position combinations". Psychonomic Monograph Supplements 1 (3): 33–78. 
  3. Mayzner, M.S.; Tresselt, M.E.;Woliin, B.< R,.. (1965). "Tables of tetragram frequency counts for various word-length and letter-position combinations". Psychonomic Monograph Supplements 1 (4): 79–143. 
  4. Mayzner, M.S.; Tresselt, M.E.Wolin, B,.< R.> (1965). "Tables of pentagram frequency counts for various word-length and letter-position combinations". Psychonomic Monograph Supplements 1 (5): 144–190. 

External links[edit]