Background

Overview

Remembering numbers can be a challenge. Recalling any individual phone number, product number, passcode, or ID might not cause difficulty when the number is of a reasonable length. However, keeping track of many such identifiers in one’s head can be easier said than done. Now imagine how challenging it would be to keep track of hundreds of digits or more without using special memorization techniques. This would be nearly impossible for most people. Fortunately, there are techniques that can make this much easier, even for people who aren’t born with extraordinary memories. The mnemonic major system is one of these methods. In this mini-project, I designed a generator that uses the major system to transform numbers into word phrases. This is not the first generator that has been created for this purpose, and there are web services that can perform this task available online. However, implementing a generator in Wolfram Language makes it easily customizable and compatible with the language’s features.

Introducing the Major System

Humans have a much easier time remembering words that are associated with visuals than memorizing seemingly random lines of digits. Therefore, an effective memorization technique is for people to convert the digits of a number into word phrases that are easy to remember. They can then use the major system in reverse to translate the memorized words back into numbers whenever they wish.​Major System Translation Table​
Digit
Phonetic​​Translations
ApproximateLetter​​Translations
0
s,z
s,z
1
d,t,θ,ð
d,t,th
2
n,ŋ
n,ng
3
m
m
4
r,ɝ
r
5
l
l
6
ʃ,tʃ,dʒ
sh,ch
7
g,k
g,k
8
f,v
f,v
9
b,p
b,p
​​The major system translates a word based on its pronunciation rather than how it’s spelled. Therefore, digits are mapped to symbols in the phonetic alphabet rather than regular letters. However, these phonetics can be approximated as the letters or pairs of letters that by which they are most often represented. ​As an example of the major system in action, consider the word “simplicity.” Its phonetic form is as follows.
In[1]:=
WordData["simplicity","PhoneticForm"]
Out[1]=
sˌɪmplˈɪsəti
The vowels of this phonetic form are not used in the major system, but we can see from the translation table above that its consonant sounds (s, m, p, l, a second s, and t) can be translated to 0,3,9,5,0, and 1. So if a person happened to want to memorize the number 039501, they would only need to remember the word “simplicity.”
​
In the previous example, we started with the phrase and converted it to a number, but in practical situations, a person would typically start with the number they need to memorize and use the major system to translate it into words. For example, 12345 could become “tiny mural.” It takes some creativity and vocabulary to come up with a suitable phrase, which makes it harder to translate numbers to phrases than vice versa. This is why a generator that automatically performs the more difficult step of the process can be useful.

Creating A Major System Generator

Coding the Generator

I began by creating lists of all nouns and adjectives in Wolfram Language’s built-in WordList function as well as their phonetic pronunciations.
In[1]:=
nouns=Select[WordList[],MemberQ[WordData[#,"PartsOfSpeech"],"Noun"]&];
In[2]:=
adjectives=Select[WordList[],MemberQ[WordData[#,"PartsOfSpeech"],"Adjective"]&];
In[3]:=
adjectivePhonetics=Select[{#,WordData[#,"PhoneticForm"][[1]]}&/@adjectives,(#[[2]]=!="NotAvailable")&];
In[4]:=
sounds={"ŋ","ɒ","ɔ","ə","ɛ","ɝ","ɡ","ɪ","ʃ","ʊ","ʌ","ʒ","ˈ","ˌ","a","æ","b","d","ð","e","f","h","i","j","k","l","m","n","o","p","r","s","t","u","v","w","z","θ"};
In[5]:=
consonentchars={"tʃ","dʒ","ŋ","ɡ","ʃ","b","d","ð","f","k","l","m","n","p","r","s","t","v","z","θ","ɝ"};
In[6]:=
vowelchars=DeleteElements[sounds,consonentchars];
In[7]:=
nounPhonetics=Select[nouns,(WordData[#,"PhoneticForm"][[1]]=!="NotAvailable")&];
In[8]:=
adjectivePhonetics=Select[adjectives,(WordData[#,"PhoneticForm"][[1]]=!="NotAvailable")&];
I then created a function that converts each of these words into a list of digits.
In[9]:=
ClearAll[wordToDigits];​​wordToDigits[word_String]:=​​Module[{consonants,digits},consonants=StringReplace[WordData[word,"PhoneticForm"][[1]],#->""&/@vowelchars];​​digits=StringReplace[consonants,{"s"->"0","z"->"0","d"->"1","ð"->"1","θ"->"1","t"->"1","n"->"2","ŋ"->"2","m"->"3","r"->"4","ɝ"->"4","l"->"5","ʃ"->"6","tʃ"->"6","dʒ"->"6","ɡ"->"7","k"->"7","f"->"8","v"->"8","b"->"9","p"->"9"}];​​Return[ToExpression/@Characters[digits]];​​];
In[11]:=
adjAssoc=Association[(#->wordToDigits[#])&/@adjectivePhonetics];
In[12]:=
nounAssoc=Association[(#->wordToDigits[#])&/@nounPhonetics];
In[13]:=
sortedAdj=Table[{},{n,5}];
In[14]:=
sortedNouns=Table[{},{n,5}];
I created functions that can convert a number into a list of two-word phrases consisting of an adjective and a noun.
In[15]:=
ClearAll[digitsToPhrase];​​digitsToPhrase[digits_List]:=​​Module[{digitLength,adjMatches,nounMatches,sortedAdj,sortedNouns,availableCombos,nounLength,adjLength,adj,noun},​​digitLength=Length[digits];​​adjMatches=Select[adjAssoc,MatchQ[digits,Append[#,___]]&];​​nounMatches=Select[nounAssoc,MatchQ[digits,Prepend[#,___]]&];​​sortedAdj=Table[{},{n,digitLength+1}];​​sortedNouns=Table[{},{n,digitLength+1}];​​AppendTo[sortedAdj[[Length[adjMatches[#]]+1]],#]&/@Keys[adjMatches];​​AppendTo[sortedNouns[[Length[nounMatches[#]]+1]],#]&/@Keys[nounMatches];​​availableCombos=Select[Range[digitLength+1]-1,(sortedNouns[[#+1]]=!={}&&sortedAdj[[1+digitLength-#]]=!={})&];​​If[availableCombos=={},Print[digits];Return[],0];​​nounLength=Max[availableCombos];​​adjLength=digitLength-nounLength;​​adj=RandomChoice[sortedAdj[[adjLength+1]]];​​noun=RandomChoice[sortedNouns[[nounLength+1]]];​​adj<>" "<>noun​​];
In[17]:=
ClearAll[realToDigits];​​realToDigits[num_Real]:=Module[{rawDigits,relevantDigits},rawDigits=RealDigits[num][[1]];​​relevantDigits=NestWhile[Drop[#,-1]&,rawDigits,(Last[#]==0)&];​​relevantDigits];

Demonstration

Here is the output of the generator for the first 314 digits of pi.

Result Evaluation and Concluding Remarks

The generator successfully generates phrases to match the numbers it receives from the user. However, there are a few areas that could use improvement. Since the phrases are randomly generated, they often don’t make a lot of sense. In addition, since all nouns and adjectives from Wolfram’s WordData function are used as options, the user might see obscure vocabulary they are unfamiliar with or words they consider objectionable. Lastly, since I wasn’t able to find an easy way to separate abstract from concrete nouns, many of the phrases may describe abstract concepts that are harder to visualize and thus harder to memorize. Nevertheless, it does achieve its core purpose of translating numbers to phrases using the major system.

Cite This Notebook

“Remembering Long Numbers with a Major System Phrase Generator”
by Curran Flanders
https://community.wolfram.com/groups/-/m/t/3417244