Skip over navigation
Cambridge University Faculty of Mathematics NRich logo
menu search
  • Teachers expand_more
    • Early years
    • Primary
    • Secondary
    • Post-16
    • Events
    • Professional development
  • Students expand_more
    • Primary
    • Secondary
    • Post-16
  • Parents expand_more
    • Early Years
    • Primary
    • Secondary
    • Post-16
  • Problem-Solving Schools
  • About NRICH expand_more
    • About us
    • Impact stories
    • Support us
    • Our funders
    • Contact us
  • search

Or search by topic

Number and algebra

  • The Number System and Place Value
  • Calculations and Numerical Methods
  • Fractions, Decimals, Percentages, Ratio and Proportion
  • Properties of Numbers
  • Patterns, Sequences and Structure
  • Algebraic expressions, equations and formulae
  • Coordinates, Functions and Graphs

Geometry and measure

  • Angles, Polygons, and Geometrical Proof
  • 3D Geometry, Shape and Space
  • Measuring and calculating with units
  • Transformations and constructions
  • Pythagoras and Trigonometry
  • Vectors and Matrices

Probability and statistics

  • Handling, Processing and Representing Data
  • Probability

Working mathematically

  • Thinking mathematically
  • Developing positive attitudes
  • Cross-curricular contexts

Advanced mathematics

  • Decision Mathematics and Combinatorics
  • Advanced Probability and Statistics
  • Mechanics
  • Calculus

For younger learners

  • Early Years Foundation Stage

Probably a Code?

Age 16 to 18
Challenge Level Yellow starYellow starYellow star
  • Problem
  • Student Solutions
  • Teachers' Resources

When cracking text-based codes, a first step is often to look for repeated strings of characters resulting from structure in the underlying cypher-text. This can give a way in to cracking the code.

Alison and Steve are considering the following coded message:
 

vrucseviffsrzpvekpqmyfvfvarvfhfzecsxzvvorjbtlrkaqmcvbgyfsct
nuznglyrkqsqewtauvzpievmblcciabcfvofpymgrfnpkjuszcjrjuaur
idgznelhpycaoljzbjkrcqioguwavhlvflejbcuqkpkzsvmnpaxivovjjt
lrqmyovtpjhfkzccrctgksiwoauvzgnvfvuabnitkfnpkjuziohqmipjv
eoipivaolnwwtlgravlbwbjvfvqefpcqolfzvuwviqvlqsgvovjekuqfnr
ybdqulzplcfqimctfsmevzvuqyrwmtcrebcuqmqxpqzbtfvedcpak
wdlcvzubnumfaurbvorgwnlvjbjlfvivvswzqzgrvfkrjwnhgzwppgv
dgycimulakakafvthabdgktnxqphgzwphfkpgyrxqqubwjghhkgcu
qumnptybvorimohexitlgkpgzhequmbimxlemqupocmkafszqhqu
qurwlavzxzzvpaxbjlufzkgbeipkqznhbfzvihcvzrlglinzccmpkblzv
orimhvenqvolfctsrrdgtljquariqypycxwaffugaelavpagzgjruqpna
rdknnkwtzgymtlfewyhauntvfkitlorvkzuvlcuqjiksveoqcriiehyda
ghjvucfovecmgvlvvncipkflzrhfjqpnveequqvzuhauqpirrcvfrmm
tfevokvayqvoribqkvjkqcrimfvakpgonsqvhocmisbsmkafgzqkhtb
kvajipksvivbevaohlsmypgywwaroiowyviuauvxjlafugunfnvorym
ccretaibuqgzhelqbokmfslrzgpakpqzrlvfpftwxlevluvyzbwkrjejhg
diaubkjglkgmearuqphpfcpaepwhlgvzphycqiogrqohlkpgyruqujb
mmtauvequqiwwzcfegyjyqeonkbthpkavoremgkyvipkzrgtltltcar
rbjvhjipkpvtgzgzinvojmtcnkqqufkpcaevywpevwpslkpkzifgcnrk
wtlaumtauvqtzrvukutvkelakzkjvkqgzpfvupfkmpasfzgcriquonct
uhgzivlzpitkrebebezwupgpekaukpgzvxpvvsrxcygfnvornwtsqem
xlesmhvevdkzvkmfhauucfgimckncipkavdgyovnqyrzuryvebgkop
bjlsfwvvsdipauvaghevualakqelzvvvznelvorpitlflnhppzmpagfkq
udlmthycnghefnfhaxmtveumcaurvfabzvfbpvugabtwotrekgauz
anhofzkvhjdqfnxmypgybjlwfgcjuztfmrvtuduvvjlrdjcyxjqphyzb
vsrswcajzbjovjpqsvuiatnkmuvarvgecvlkavfvqmqzaevivzabcyqu
unkqxlezdgyolbubcgwupaxinsgymulpfvllpkctlfkwdlsrtullfceha
ewvjbebgzgkpgpavavpzrjnlovvgmvkejppyquonctevawmtvartn
tneskuqkwvorciuatvvgynkqquoplkzpfdgyveocwnjacnremcygy
mrvyvbqaufagjblvvyvvavvevieojyqeonkxtlfvvvzbdipfzfvvofrzg
yrhckzvkmqyopiujribcpazviauvagjevbqmgymohtemvduzkjpsr
bcsygwuzvstgjnewpslsmgmsvkvlqsgcuhelgygrskutjceonjukur

Alison computes the frequency of each letter, finding these results:

a b c d e f g h i j k l m n o p q r s t u v w x y z
85 55 72 22 73 77 85 48 61 58 90 77 61 55 55 87 80 78 41 58 94 166  44 21 53 80

After some fiddling around on a spreadsheet, Steve notices that there are seven repeated strings of 5 letters, highlighted as shown below:

Steve dismisses this as coincidence, saying "I would guess that these repeated 5-letter sequences  are consistent with randomly generated text based on these frequencies of letters". Alison is not convinced and thinks that this structure of 5 letter sequences would not likely occur randomly for these frequencies of letters.

Investigate.

Challenge: Crack the code, regardless of who is right!

You may also like

Game of PIG - Sixes

Can you beat Piggy in this simple dice game? Can you figure out Piggy's strategy, and is there a better one?

The Mean Game

Edward Wallace based his A Level Statistics Project on The Mean Game. Each picks 2 numbers. The winner is the player who picks a number closest to the mean of all the numbers picked.

Very Old Man

Is the age of this very old man statistically believable?

  • Tech help
  • Accessibility Statement
  • Sign up to our newsletter
  • Twitter X logo

The NRICH Project aims to enrich the mathematical experiences of all learners. To support this aim, members of the NRICH team work in a wide range of capacities, including providing professional development for teachers wishing to embed rich mathematical tasks into everyday classroom practice.

NRICH is part of the family of activities in the Millennium Mathematics Project.

University of Cambridge logo NRICH logo