How might you crack a cryptosystem that uses character mappings? Consider how frequently certain characters appear in text. If you could spot repeated patterns in encoded text and then match them to known patterns in ``regular'' text, you might be able to crack the cryptosystem! For example, the letter 'u' almost always follows the letter 'q'.2 Natural languages have other patterns, too. A frequency is a measure of how often a pattern appears in a body of text. You may measure frequency of a pattern as either:
There are published tables of frequencies of single letters and pairs of letters for different languages.3 We refer to these frequencies as unigram and bigram frequencies: