Frequency analysis worksheet
Count letters, compare bar charts and crack a text without the key. Level 3: a full substitution cipher.
Frequency analysis
In every language some letters are much more common than others. In English, E is by far the most common letter, followed by T and A. In a Caesar cipher every E becomes the same cipher letter, so the most common cipher letter probably stands for E.
HJMZO CVIVO CJPNV IYTZV MNVBJ VNXCJ GVMDI WVBCY VYIVH ZYVGF DIYDR MJOZV WJJFV WJPON ZXMZO RMDOD IBDID OCZYZ NXMDW ZYVXG ZQZMO MDXFD IZQZM TGVIB PVBZN JHZGZ OOZMN VMZPN ZYHPX CHJMZ JAOZI OCVIJ OCZMN DIZIB GDNCO CZHJN OXJHH JIGZO OZMDN ZAJGG JRZYW TOVIY VDAVH ZNNVB ZDNRM DOOZI RDOCV NDHKG ZNPWN ODOPO DJIZQ ZMTZW ZXJHZ NOCZN VHZNZ XMZOG ZOOZM NJOCZ GZOOZ MOCVO VKKZV MNHJN OJAOZ IDIOC ZNZXM ZOOZS OKMJW VWGTN OVIYN AJMZR DOCOC DNDYZ VVGFD IYDXJ PGYMZ VYHZN NVBZN OCVOI JWJYT RVNNP KKJNZ YOJMZ VYOJY VTRZX VGGCD NOMDX FAMZL PZIXT VIVGT NDN
Task 1 The text has 448 letters. Calculate the relative frequency in percent of Z (62×), O (47×), V (40×). Round to one decimal place.
Task 2 Find the shift in two ways: (a) highest bar = E, (b) compare the shape of both charts. Do both give the same shift?
Task 3 Decrypt the first 40 letters.
Task 4 Why does frequency analysis work well for this text, but not for a message like “HI BOB”?
Answer key: Frequency analysis
For teachers. Same variant number, same answers.
- Task 1
- Z: 62 ÷ 448 = 13.8 % · O: 47 ÷ 448 = 10.5 % · V: 40 ÷ 448 = 8.9 %
- Task 2
- E = Z · Shift 21
- Task 3
- MORET HANAT HOUSA NDYEA RSAGO ASCHO LARIN BAGHD
- Task 4
- Long texts follow the usual letter distribution. A short message has too few letters for a reliable count.
- Answer: MORE THAN A THOUSAND YEARS AGO A SCHOLAR IN BAGHDAD NAMED AL-KINDI WROTE A BOOK ABOUT SECRET WRITING. IN IT HE DESCRIBED A CLEVER TRICK. IN EVERY LANGUAGE SOME LETTERS ARE USED MUCH MORE OFTEN THAN OTHERS. IN ENGLISH THE MOST COMMON LETTER IS E, FOLLOWED BY T AND A. IF A MESSAGE IS WRITTEN WITH A SIMPLE SUBSTITUTION, EVERY E BECOMES THE SAME SECRET LETTER. SO THE LETTER THAT APPEARS MOST OFTEN IN THE SECRET TEXT PROBABLY STANDS FOR E. WITH THIS IDEA AL-KINDI COULD READ MESSAGES THAT NOBODY WAS SUPPOSED TO READ. TODAY WE CALL HIS TRICK FREQUENCY ANALYSIS.
What students learn
- Count letters and read bar charts
- Find a Caesar shift from the most common letter
- Calculate relative frequencies
- Solve a substitution cipher with frequencies and word patterns (level 3)
Tip: show the method in the projector mode first. Students who finish early can go on with a class challenge.