Trigram Explained

For other uses see Trigram (disambiguation).

Trigrams are a special case of the n-gram, where n is 3. They are often used in natural language processing for performing statistical analysis of texts and in cryptography for control and use of ciphers and codes. See results of analysis of "Letter Frequencies in the English Language".

Frequency

Context is very important, varying analysis rankings and percentages are easily derived by drawing from different sample sizes, different authors; or different document types: poetry, science-fiction, technology documentation; and writing levels: stories for children versus adults, military orders, and recipes.

Typical cryptanalytic frequency analysis finds that the 16 most common character-level trigrams in English are:[1] [2]

Rank Trigram Frequency[3]
(Different source)
1the1.81%
2and0.73%
3tha0.33%
4ent0.42%
5ing0.72%
6ion0.42%
7tio0.31%
8for0.34%
9nde
10has
11nce
12edt
13tis
14oft0.22%
15sth0.21%
16men

Because encrypted messages sent by telegraph often omit punctuation and spaces, cryptographic frequency analysis of such messages includes trigrams that straddle word boundaries. This causes trigrams such as "edt" to occur frequently, even though it may never occur in any one word of those messages.[4]

Examples

The sentence "the quick red fox jumps over the lazy brown dog" has the following word-level trigrams:

the quick red quick red fox red fox jumps fox jumps over jumps over the over the lazy the lazy brown lazy brown dog

And the word-level trigram "the quick red" has the following character-level trigrams (where an underscore "_" marks a space): the he_ e_q _qu qui uic ick ck_ k_r _re red

Notes and References

  1. Book: Lewand, Robert . [{{google books |id= dx8zM-VeKI8C |page= 37 |text= Most Common Trigraphs in the English Language |plainurl= yes}} Cryptological Mathematics ]. . 2000 . 37 . 978-0-88385-719-9.
  2. Web site: Relative Frequencies of Letters in General English Plain text . . Tom . Linton . dead . January 22, 2007 . https://web.archive.org/web/20070122235914/http://pages.central.edu/emp/LintonT/classes/spring01/cryptography/letterfreq.html . 2001 . Cryptography . Spring .
  3. Web site: English Letter Frequencies . Practical Cryptography .
  4. Web site: Voice Search SEO . Fuelonline .