Everyone likes a puzzle! as long as you get it eventually. Attached are some cryptograms for home schooling. If you just want some fun they are attached below, go for it. I'll discuss them in the following post(s), so there will be a buffer for those who don't want any spoilers. So you can say if you liked it, without worrying about giving anything away.
The main theme of home schooling with Wolfram Language is customization. Later, I will give the code that generated those examples so you can make your own. For one thing, these are mostly culturally from the US /Canada/UK, and vary in reading difficulty. You might experiment with material geared for different ages.
Earlier I posted about making customized maps in Wolfram Language and hope to post more homeschooling materials soon. If you are new to Wolfram Language, try the programming lab.
If you are both the student and the teacher, you can also generate examples without knowing what the answer is. Here is code that takes a random piece from WikipediaData When you are done you can reveal to yourself what is hidden in sample.
NCC[n_][s_] := StringReplace[ToLowerCase[s],
MapThread[Rule, {#, BlockRandom[SeedRandom[n];
RandomSample[#]]}] &[CharacterRange["a", "z"]]];
sample = CanonicalName[RandomEntity["Country"]];
NRandomSubstring[s_, length_] :=
StringTake[s, {#, # + length - 1} &[RandomInteger[{1, StringLength[s] - length}]]];
NCC["key"][NRandomSubstring[WikipediaData[sample, "ArticlePlaintext"], 1200]]
A few specific puzzles.
I recommend starting with this rotation-cipher
ohw wbudqwv ihdu.
l kdyh dozdbv vr ehkdyhg pbvhoi wkdw, xqghu jrg,
l kdyh sodfhg pb fklhihvw vwuhqjwk dqg vdihjxdug
lq wkh orbdo khduwv dqg jrrgzloo ri pb vxemhfwv;
dqg wkhuhiruh l dp frph dprqjvw brx,
and then this substitution cipher.
mc ai, cy jcm mc ai, mpbm ex mpi dwixmecj:
upimpiy 'mex jcaziy ej mpi tejq mc xwvviy
mpi xzejkx bjq byycux cv cwmybkicwx vcymwji,
cy mc mbgi bytx bkbejxm b xib cv mycwazix,
bjq ar chhcxejk ijq mpit:
This one is not a substitution cipher.
oivttsadefgecve hhtnoprusaeiger dnoeatnlnleowgu eraaaaorniurodn dnlwigdalcfdadl isaeraaoootonen odnnrnurfgtdcfd atgruuhhfaogdhu heseernrlaeaopc ateatowermaorre dhreodetmtufaei scfarmserweotao niawnoeguanrdon eomsosnatntdsrf tdaddhalwetaakn oaetoiehrnednwe
Why cryptograms for learning?
Like any puzzle it engages the brain, and requires logical thinking. You are forced to get close to the text. But it also prepares you to learn to program, since these are some of the simplest non-trivial programs.
One approach is to treat the problem of creating cryptograms as a programming challenge, but even better is to solve them using Wolfram Language. The most straight-forward approach, which is the one I took, is for the teacher to use Wolfram Language to make customized cryptograms.
I recommend starting with a rotation-cipher, and letting them know it is a rotation cipher unless the students are already experienced. There are several paths they can go down to find the answer, and should be fine doing it on their own, but if they are getting to the end of their attention span you could give a hint, like consider single lettered words.
After that I recommend substitution ciphers, one where they can count the letters and makes some guesses. It's up to you if you let them use LetterCounts.
I only did one which is not a substitution cipher. Turns out that O Canada's English version has 240 letters, which has a bunch of divisors to choose from. They should be able to notice the lack of spaces and punctuations, and you could just let them know it is not a substitution.
I used this code for substitutions where the first argument specifies the code (as it is used to seed the randomness it can be anything)
NCC[n_][s_] :=
StringReplace[ToLowerCase[s],
MapThread[Rule, {#, BlockRandom[SeedRandom[n]; RandomSample[#]]}] &[
CharacterRange["a", "z"]]]
Here is code to reverse the substitution cipher code NCC.
ANCC[n_][s_] :=
StringReplace[ToLowerCase[s],
MapThread[Rule, {BlockRandom[SeedRandom[n]; RandomSample[#]], #}] &[
CharacterRange["a", "z"]]]
One detail with substitution ciphers is that you might want every letter to map to a different letter. For instance if "e" is really "e", it might be unnecessarily confusing (bad) or a lot easier (maybe good). This function will check for that.
BNCCFreeQ[n_] :=
Not[Apply[Or,
MapThread[Equal, {#, BlockRandom[SeedRandom[n]; RandomSample[#]]}] &[
CharacterRange["a", "z"]]]]
Attachments: