怎麼最有效率的解 Wordle?(1)

letter tiles on a wooden surface

近期 Wordle 不知為何突然流行了起來,網路上也出現了各種解法。在此藉由 Wordle 的機緣,和大家分享一些結合語言學和程式設計的小知識,希望可以幫助各位對我們使用的語言了解的同時,也能獲得玩 Wordle 的新思維。

Wordle - 维基百科,自由的百科全书

Tip 1. 字母頻率

首先是一個幾乎所有語言都有的現象——人們使用字母的機率是不均衡的,甚至不論是字母、單字還是片語都有這個現象。舉個例子,

世界人權宣言英文版前兩段(取自 https://ilms.csu.edu.tw/board.php?courseID=11145&f=doc&cid=327843)

Whereas recognition of the inherent dignity and of the equal and inalienable rights of all members of the human family is the foundation of freedom, justice and peace in the world,

Whereas disregard and contempt for human rights have resulted in barbarous acts which have outraged the conscience of mankind, and the advent of a world in which human beings shall enjoy freedom of speech and belief and freedom from fear and want has been proclaimed as the highest aspiration of the commonpeople,

統計以上兩段文章各個字母被使用的次數,

                  11111111112222222222333333333344444444445555
         12345678901234567890123456789012345678901234567890123
A | 38 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
B |  7 | bbbbbbb
C | 13 | ccccccccccccc
D | 22 | dddddddddddddddddddddd
E | 53 | eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
F | 18 | ffffffffffffffffff
G |  8 | gggggggg
H | 28 | hhhhhhhhhhhhhhhhhhhhhhhhhhhh
I | 27 | iiiiiiiiiiiiiiiiiiiiiiiiiii
J |  2 | jj
K |  1 | k
L | 14 | llllllllllllll
M | 15 | mmmmmmmmmmmmmmm
N | 35 | nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
O | 30 | oooooooooooooooooooooooooooooo
P |  8 | pppppppq
Q |  0 | 
R | 23 | rrrrrrrrrrrrrrrrrrrrrrr
S | 19 | sssssssssssssssssss
T | 25 | ttttttttttttttttttttttttt
U |  9 | uuuuuuuuu
V |  3 | vvv
W |  7 | wwwwwww
X |  0 | 
Y |  3 | yyy
Z |  0 | 

為了方便觀察,按照多寡排序

                  11111111112222222222333333333344444444445555
         12345678901234567890123456789012345678901234567890123
E | 53 | eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
A | 38 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
N | 35 | nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
O | 30 | oooooooooooooooooooooooooooooo
H | 28 | hhhhhhhhhhhhhhhhhhhhhhhhhhhh
I | 27 | iiiiiiiiiiiiiiiiiiiiiiiiiii
T | 25 | ttttttttttttttttttttttttt
R | 23 | rrrrrrrrrrrrrrrrrrrrrrr
D | 22 | dddddddddddddddddddddd
S | 19 | sssssssssssssssssss
F | 18 | ffffffffffffffffff
M | 15 | mmmmmmmmmmmmmmm
L | 14 | llllllllllllll
C | 13 | ccccccccccccc
U |  9 | uuuuuuuuu
G |  8 | gggggggg
P |  8 | pppppppq
B |  7 | bbbbbbb
W |  7 | wwwwwww
V |  3 | vvv
Y |  3 | yyy
J |  2 | jj
K |  1 | k
Q |  0 | 
X |  0 | 
Z |  0 | 

我們可以觀察到最常見的字母基本上是「E」、「A」、「N」、「O」這幾個字母,相反最少見的則脫離不了「J」、「K」、「Q」、「X」、「Z」這幾個。

參考維基百科介紹字母頻率的頁面(https://zh.wikipedia.org/wiki/%E5%AD%97%E6%AF%8D%E9%A2%91%E7%8E%87),事實上英語中最常見的字母也確實是這幾個:「E」、「T」、「A」、「O」、「I」、「N」、「S」、「H」、「R」⋯⋯ 因此,在猜 Wordle 時,如果可以先從這幾個字母組成的單字開始下手,便可以快速大幅的縮小猜測的範圍,更有效的使用每次猜測的機會。

事實上,用到這個原則的相關主題,包含密碼學、消息理論、語料庫語言學等,日後有機會會再向大家慢慢娓娓道來~

留言討論區