字母频率
字母频率(frequency of letters; character frequencies),指的是各个字母在文本材料中出现的频率。常被应用于密码学,尤其是可破解古典密码的频率分析。在英语中最常见的字母是e。而在铅字印刷时代,人们已根据经验在Linotype排字机上将字母按常用与否排列成etaoin shrdlu cmfwyp vbgkjq xz 。还有,摩斯电码中越常用的字母,其编码符号就越短;而发出各字母的用时由快到慢顺序是e it san hurdm wgvlfbk opjxcz yq。数据压缩技术中也有相似的方法,如霍夫曼编码就是按来源符号出现的机率大小去编码。
介绍
有分析显示字母频率就像词频,不同作者或写作主题的作品中往往各不相同。当为x射线(x-rays)撰文时,文章中就会有大量的字母X。而撰写用x射线治疗卡塔尔(Qatar)的斑马(zebras)时,一般很少出现的字母X、Q和Z就会充斥文中。可从作者的字母使用频率中看出他的某些写作习惯。例如,海明威的写作风格明显不同于福克纳。字母、双字母组、三字母组、单词频率、单词长度和句子长度,这些都可以经统计后用以证明或反驳某一作品是某作者所写,甚至待鉴别作品与作者的写作风格相近也可用这一方法。
只能靠分析大量有代表性的文本才可得出准确的字母平均频率,而借由现代计算机和庞大的文本语料库,很容易完成这样的统计工作。又聋又瞎网(Deafandblind)列出了各种文本材料(新闻报告、宗教文本、科学文本和一般小说)的字母频率顺序,其中在一般小说类里,字母“h”与“i”的排位差异尤甚,由Linotype排字机的“etaoin shrdlu”变成了“etaohn isrdlu”。
赫伯特·S·基姆在他那部经典的密码学入门著作 《密码和隐密写作》(Codes and Secret Writing)里提道:英文的字母频率排列顺序是ETAON RISHD LFCMU GYPWB VKJXQ Z,最常见的字母对是TH HE AN RE ER IN ON AT ND ST ES EN OF TE ED OR TI HI AS TO,最常见的连写字母对是LL EE SS OO TT FF RR NN PP CC。[1]
使用最多的前12个字母占了总使用次数的80%,使用最多的前8个字母则占了总使用次数的65%。数种排名函数能很好地拟合字母频率,而双参数Cocho/Beta排名函数(two-parameter Cocho/Beta rank function)是当中的佼佼者。[2]用另一种不能调节参数的排名函数也能不错地拟合字母频率分布,[3]该函数也能拟合蛋白质序列中的氨基酸频率。[4]
使用VIC暗号或其他基于纵横棋盘格的暗号时,间谍常用助记符如“a sin to err”(最后的r不计)来记住最常用的8个字母。在密码解谜游戏cryptograms和单词解谜游戏如猜单词游戏、Scrabble、香蕉拼字游戏和电视游戏节目幸运轮中,须要运用字母频率和频率分析。在古典文学中,爱伦坡早在其著名小说《金甲虫》描述了如何用英文字母频率的知识去解开故事中的替换式密码,找出船长基德埋藏宝藏的所在。[5]
字母频率在一些键盘布局的设计上举足轻重。Blickensderfer打字机在下排放置最常用的字母。德沃夏克键盘将最常用的字母放在最易输入的中排,即除拇指外的八指所放之处。
英语中的字母频率
英语中的字母频率如下:[6]
字母 | 英语中出现的频率 | |
---|---|---|
a | 8.167% | |
b | 1.492% | |
c | 2.782% | |
d | 4.253% | |
e | 12.702% | |
f | 2.228% | |
g | 2.015% | |
h | 6.094% | |
i | 6.966% | |
j | 0.153% | |
k | 0.772% | |
l | 4.025% | |
m | 2.406% | |
n | 6.749% | |
o | 7.507% | |
p | 1.929% | |
q | 0.095% | |
r | 5.987% | |
s | 6.327% | |
t | 9.056% | |
u | 2.758% | |
v | 0.978% | |
w | 2.360% | |
x | 0.150% | |
y | 1.974% | |
z | 0.074% |
上面列出的表格引自Algoritmy网站。[7]而这个列表和其他的表稍微不同,如美国康奈尔大学数学探索项目(Math Explorer's Project)在统计40000个单词后得到了大同小异的另一表(页面存档备份,存于互联网档案馆)。牛津大学出版社分析简明牛津词典的词条后也得出百分比稍有不同的一表。[8]
英语中空格出现的频率比使用最多的字母(e)还稍稍多点[9](约为107%),而非字母符号(如数字、标点等)统共后排名第四,即在字母“T”和“A”之间。[10]
英语单词中首字母的频率
单词中首字母的频率如下:[11]
首字母 | 单词频率 | |
---|---|---|
a | 11.602% | |
b | 4.702% | |
c | 3.511% | |
d | 2.670% | |
e | 2.007% | |
f | 3.779% | |
g | 1.950% | |
h | 7.232% | |
i | 6.286% | |
j | 0.597% | |
k | 0.590% | |
l | 2.705% | |
m | 4.374% | |
n | 2.365% | |
o | 6.264% | |
p | 2.545% | |
q | 0.173% | |
r | 1.653% | |
s | 7.755% | |
t | 16.671% | |
u | 1.487% | |
v | 0.649% | |
w | 6.753% | |
x | 0.037% | |
y | 1.620% | |
z | 0.034% |
其他语言中的字母频率
字母 | 法语 [12] | 德语 [13] | 西班牙语 [14] | 葡萄牙语 [15] | 世界语 [16] | 意大利语[17] | 土耳其语 | 瑞典语[18] | 波兰语[19] | 荷兰语 [20] | 道本语 [21] |
---|---|---|---|---|---|---|---|---|---|---|---|
a | 7.636% | 6.516% | 12.525% | 14.634% | 12.117% | 11.745% | 11.680% | 9.341% | 11.503% | 7.486% | 17.2% |
b | 0.901% | 1.886% | 2.215% | 1.043% | 0.980% | 0.927% | 2.952% | 1.254% | 1.740% | 1.584% | 0 |
c | 3.260% | 2.732% | 4.139% | 3.882% | 0.776% | 4.501% | 0.970% | 1.213% | 3.895% | 1.242% | 0 |
d | 3.669% | 5.076% | 5.860% | 4.992% | 3.044% | 3.736% | 4.871% | 4.521% | 4.225% | 5.933% | 0 |
e | 14.715% | 17.396% | 13.681% | 12.570% | 8.995% | 11.792% | 9.007% | 9.647% | 8.352% | 18.914% | 7.4% |
f | 1.066% | 1.656% | 0.692% | 1.023% | 1.037% | 1.153% | 0.444% | 1.931% | 0.143% | 0.805% | 0 |
g | 0.866% | 3.009% | 1.768% | 1.303% | 1.171% | 1.644% | 1.340% | 3.269% | 1.731% | 3.403% | 0 |
h | 0.737% | 4.757% | 0.703% | 0.781% | 0.384% | 0.636% | 1.145% | 2.103% | 1.015% | 2.380% | 0 |
i | 7.529% | 7.550% | 6.247% | 6.186% | 10.012% | 11.283% | 8.274%* | 7.190% | 9.328% | 6.499% | 14.8% |
j | 0.545% | 0.268% | 0.443% | 0.397% | 3.501% | 0.011% | 0.046% | 0.652% | 1.836% | 1.461% | 3.0% |
k | 0.049% | 1.417% | 0.011% | 0.015% | 4.163% | 0.009% | 4.715% | 3.214% | 2.753% | 2.248% | 5.1% |
l | 5.456% | 3.437% | 4.967% | 2.779% | 6.145% | 6.510% | 5.752% | 5.229% | 3.064% | 3.568% | 10.2% |
m | 2.968% | 2.534% | 3.157% | 4.738% | 2.994% | 2.512% | 3.745% | 3.460% | 2.515% | 2.213% | 4.4% |
n | 7.095% | 9.776% | 6.71% | 5.046% | 7.955% | 6.883% | 7.231% | 8.796% | 6.737% | 10.032% | 11.6% |
o | 5.378% | 2.594% | 8.683% | 10.735% | 8.779% | 9.832% | 2.653% | 4.317% | 7.167% | 6.063% | 7.7% |
p | 2.521% | 0.670% | 2.510% | 2.523% | 2.745% | 3.056% | 0.788% | 1.437% | 2.445% | 1.370% | 3.7% |
q | 1.362% | 0.018% | 0.877% | 1.204% | 0 | 0.505% | 0 | 0.007% | 0 | 0.009% | 0 |
r | 6.553% | 7.003% | 6.871% | 6.530% | 5.914% | 6.367% | 6.948% | 8.309% | 5.743% | 6.411% | 0 |
s | 7.948% | 7.273% | 7.977% | 7.805% | 6.092% | 4.981% | 2.950% | 6.374% | 6.224% | 3.733% | 4.1% |
t | 7.244% | 6.154% | 4.632% | 4.736% | 5.276% | 5.623% | 3.049% | 8.693% | 2.475% | 6.923% | 4.6% |
u | 6.311% | 4.346% | 3.927% | 4.634% | 3.183% | 3.011% | 3.430% | 2.066% | 2.062% | 2.192% | 3.2% |
v | 1.628% | 0.846% | 1.138% | 1.665% | 1.904% | 2.097% | 0.977% | 2.289% | 0 | 1.854% | 0 |
w | 0.074% | 1.921% | 0.017% | 0.037% | 0 | 0.033% | 0.016% | 2.107% | 6.313% | 1.821% | 2.8% |
x | 0.427% | 0.034% | 0.215% | 0.253% | 0 | 0 | 0.007% | 0.103% | 0 | 0.036% | 0 |
y | 0.128% | 0.039% | 1.008% | 0.006% | 0 | 0.020% | 3.371% | 0.601% | 3.206% | 0.035% | 0 |
z | 0.326% | 1.134% | 0.517% | 0.470% | 0.494% | 1.181% | 1.497% | 0.020% | 5.852% | 1.374% | 0 |
à | 0.486% | 0 | 0 | 0.072% | 0 | 0.635% | 0 | 0 | 0 | 0 | 0 |
â | 0.051% | 0 | 0 | 0.562% | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
á | 0 | 0 | 0.502% | 0.118% | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
å | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1.221% | 0 | - | 0 |
ä | 0 | 0.447% | 0 | 0 | 0 | 0 | 0 | 1.809% | 0 | 0 | 0 |
ã | 0 | 0 | 0 | 0.733% | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ą | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | 0.699% | - | 0 |
œ | 0.018% | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - | 0 |
ç | 0.085% | 0 | 0 | 0.530% | 0 | 0 | 0.825% | 0 | 0 | - | 0 |
ĉ | 0 | 0 | 0 | 0 | 0.657% | 0 | 0 | 0 | 0 | - | 0 |
ć | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | 0.743% | - | 0 |
è | 0.271% | 0 | 0 | 0 | 0 | 0.263% | 0 | 0 | 0 | 0 | 0 |
é | 1.504% | 0 | 0.433% | 0.337% | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ê | 0.225% | 0 | 0 | 0.450% | 0 | 0 | 0 | 0 | 0 | - | 0 |
ë | 0.001% | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ę | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | 1.035% | - | 0 |
ĝ | 0 | 0 | 0 | 0 | 0.691% | 0 | 0 | 0 | 0 | - | 0 |
ğ | 0 | 0 | 0 | 0 | 0 | 0 | 1.129% | 0 | 0 | - | 0 |
ĥ | 0 | 0 | 0 | 0 | 0.022% | 0 | 0 | 0 | 0 | - | 0 |
î | 0.045% | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - | 0 |
ì | 0 | 0 | 0 | 0 | 0 | 0.030% | 0 | 0 | 0 | 0 | |
í | 0 | 0 | 0.725% | 0.132% | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ï | 0.005% | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ı | 0 | 0 | 0 | 0 | 0 | 0 | 5.199%* | 0 | 0 | - | 0 |
ĵ | 0 | 0 | 0 | 0 | 0.055% | 0 | 0 | 0 | 0 | - | 0 |
ł | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | 2.109% | - | 0 |
ñ | 0 | 0 | 0.311% | 0 | 0 | 0 | 0 | 0 | 0 | - | 0 |
ń | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | 0.362% | - | 0 |
ò | 0 | 0 | 0 | 0 | 0 | 0.002% | 0 | 0 | 0 | 0 | 0 |
ö | 0 | 0.573% | 0 | 0 | 0 | 0 | 0.270% | 0.514% | 0 | 0 | 0 |
ô | 0.023% | 0 | 0 | 0.635% | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ó | 0 | - | 0.827% | 0.296% | 0 | 0 | 0 | 0 | 1.141% | 0 | 0 |
ŝ | 0 | 0 | 0 | 0 | 0.385% | 0 | 0 | 0 | 0 | - | 0 |
ş | 0 | 0 | 0 | 0 | 0 | 0 | 1.938% | 0 | 0 | - | 0 |
ś | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | 0.514% | - | 0 |
ß | 0 | 0.307% | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - | 0 |
ù | 0.058% | 0 | 0 | 0 | 0 | 0.166% | 0 | 0 | 0 | 0 | 0 |
ú | 0 | 0 | 0.168% | 0.207% | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ŭ | 0 | 0 | 0 | 0 | 0.520% | 0 | 0 | 0 | 0 | - | 0 |
ü | 0 | 0.995% | 0.012% | 0.026% | 0 | 0 | 1.992% | 0 | 0 | 0 | 0 |
ź | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | 0.078% | - | 0 |
ż | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | 0.706% | - | 0 |
*参见带点与不带点I
根据上表,英语中使用频率最高的10个字母为etaoi nshrd,而其他语言的排列顺序如下:
语言 | 排序 | 语族与其他 |
---|---|---|
法语 | esait nrulo | 印欧语系- 罗曼语族;传统上使用发音更便利的esartinulop排列。[22] |
西班牙语 | eaosr nidlt | 印欧语系-罗曼语族 |
葡萄牙语 | aeosr indmt | 印欧语系-罗曼语族 |
意大利语 | eaion lrtsc | 印欧语系-罗曼语族 |
世界语 | aieon lsrtk | 人工语言-基于印欧语系,词源上多采用罗曼词汇,音位系统本质上是斯拉夫形式,也有少量日耳曼语言特征。 |
德语 | enisr atdhu | 印欧语系-日耳曼语族 |
瑞典语 | eantr isldo | 印欧语系-日耳曼语族 |
土耳其语 | aeinr ldkmu | 阿尔泰语系-突厥语族 |
荷兰语 | enati rodsl | 印欧语系-日耳曼语族[20] |
波兰语 | aoien wszrd | 印欧语系-斯拉夫语族 |
以上语言基本使用相似的25个(或以上)字母。而道本语的排列顺序是ainlo ektms,与以上语言不同的是道本语只使用了14个字母。
注释
- ^ Zim, Herbert Spencer. Codes & Secret Writing: Authorized Abridgement. Scholastic Book Services. 1961. OCLC 317853773.
- ^ Li, Wentian; Miramontes, Pedro. Fitting ranked English and Spanish letter frequency distribution in US and Mexican presidential speeches. Journal of Quantitative Linguistics. 2011, 18 (4): 359. doi:10.1080/09296174.2011.608606.
- ^ Gusein-Zade, S.M. Frequency distribution of letters in the Russian language. Probl. Peredachi Inf. 1988, 24 (4): 102–7.
- ^ Gamow, George; Ycas, Martynas. Statistical correlation of protein and ribonucleic acid composition (PDF). Proc. Natl. Acad. Sci. 1955, 41 (12): 1011–19 [2013-06-05]. PMC 528190 . doi:10.1073/pnas.41.12.1011. (原始内容存档 (PDF)于2015-09-24).
- ^ Poe, Edgar Allan. The works of Edgar Allan Poe in five volumes. Project Gutenberg. [2013-06-05]. (原始内容存档于2015-09-24).
- ^ Beker, Henry; Piper, Fred. Cipher Systems: The Protection of Communications. Wiley-Interscience. 1982: 397. Table also available from Lewand, Robert. Cryptological Mathematics. The Mathematical Association of America. 2000: 36 [2013-06-05]. ISBN 978-0-88385-719-9. (原始内容存档于2020-08-01). and 存档副本. [2008-06-25]. (原始内容存档于2008-07-08).
- ^ Mička, Pavel. Letter frequency (English). Algoritmy.net. [2013-06-05]. (原始内容存档于2021-03-04).
- ^ What is the frequency of the letters of the alphabet in English?. Oxford Dictionary. Oxford University Press. [29 December 2012]. (原始内容存档于2015-04-22).
- ^ Statistical Distributions of English Text. [2013-06-05]. (原始内容存档于2004-06-03).
- ^ Lee, E. Stewart. Essays about Computer Security (PDF). University of Cambridge Computer Laboratory: 181. [2010-02-13]. (原始内容存档 (PDF)于2011-06-04).
- ^ Calculated from "Project Gutenberg Selections" available from the NLTK Corpora (页面存档备份,存于互联网档案馆)
- ^ CorpusDeThomasTempé. [2007-06-15]. (原始内容存档于2007-09-30).
- ^ Beutelspacher, Albrecht. Kryptologie 7. Wiesbaden: Vieweg. 2005: 10. ISBN 3-8348-0014-7.
- ^ Pratt, Fletcher. Secret and Urgent: the Story of Codes and Ciphers. Garden City, N.Y.: Blue Ribbon Books. 1942: 254–5. OCLC 795065.
- ^ Frequência da ocorrência de letras no Português. [2009-06-16]. (原始内容存档于2009-08-03).
- ^ La Oftecoj de la Esperantaj Literoj. [2007-09-14]. (原始内容存档于2021-01-17).
- ^ Singh, Simon; Galli, Stefano. Codici e Segreti. Milano: Rizzoli. 1999. ISBN 978-8-817-86213-4. OCLC 535461359 (意大利语).
- ^ Singh, Simon; Brogren, Margareta. Kodboken : konsten att skapa sekretess - från det gamla Egypten till kvantkryptering. Stockholm: Norstedts. 1999. ISBN 978-9-113-00708-3. OCLC 186495779 (瑞典语).
- ^ Wstęp do kryptologii (页面存档备份,存于互联网档案馆), counting [space] 17.2%, [dot point] 0.9%, [comma] 0.9% and [semicolon] 0.5%
- ^ 20.0 20.1 Letterfrequenties. Genootschap OnzeTaal. [2009-05-17]. (原始内容存档于2011-07-24).
- ^ lipu pi jan Jakopo pi toki pona. [2007-09-14]. (原始内容存档于2007-11-14).
- ^ Perec, Georges; ““Alphabets“” Éditions Galilée, 1976
参考文献
- 注:若需要单个字母、双字母组、三字母组、四字母组和五字母组的频率表格,可参考如下资料(基于20000个单词,且考虑到不同的单词长度和字母位置):
- Mayzner, M.S.; Tresselt, M.E. Tables of single-letter and digram frequency counts for various word-length and letter-position combinations. Psychonomic Monograph Supplements. 1965, 1 (2): 13–32. OCLC 639975358.
- Mayzner, M.S.; Tresselt, M.E.;Wolin, B.< R.<. Tables of trigram frequency counts for various word-length and letter-position combinations. Psychonomic Monograph Supplements. 1965, 1 (3): 33–78.
- Mayzner, M.S.; Tresselt, M.E.;Woliin, B.< R,.. Tables of tetragram frequency counts for various word-length and letter-position combinations. Psychonomic Monograph Supplements. 1965, 1 (4): 79–143.
- Mayzner, M.S.; Tresselt, M.E.Wolin, B,.< R.>. Tables of pentagram frequency counts for various word-length and letter-position combinations. Psychonomic Monograph Supplements. 1965, 1 (5): 144–190.
参阅
- 英语最常用单词
- 语料库语言学
- 频率分析
- Linotype排字机
- 英语最常用单词
- Scrabble
- Scrabble字母分布
- 莱文斯坦距离
- 阿拉伯字母频率
- 计量文献学
外部链接
- A site with content of Cryptographical Mathematics by Robert Edward Lewand
- Some examples of letter frequency rankings in some common languages (页面存档备份,存于互联网档案馆)
- Java-Application for building letter frequencies out of a text file
- JavaScript Heatmap Visualization showing letter frequencies of texts on different keyboard layouts (页面存档备份,存于互联网档案馆)
- An updated version of Mayzner's work using Google books Ngrams data set(页面存档备份,存于互联网档案馆) by Peter Norvig
- Counter--character frequencies (页面存档备份,存于互联网档案馆)
- Letter frequency-simia.net
- letter frequency (页面存档备份,存于互联网档案馆)