Learn 100 digits of pi at lightning speed.
In a previous post, I wrote about the Secret to Pi. I wrote about the method I used to learn 100 digits of pi in under an hour and remember them days later without extra practice.
While memorizing the digits of pi using this method, I realized that I was spending most of my time trying to think up words that would translate to the digits. I tried to think of the longest word I could. Sometimes I would screw up and use a word that did not translate to the correct digits. I spent 2/3rds of my time just thinking of good words, images, vivid pictures. It was hard and slow.
So, I decided to make a computer program to find the words and optimize everything for me. I did, and I’m releasing the code under Affero GP. Of course, all the code is PYthon2.5. Please allow me describe it to you. With the words precomputed, I can learn pi as quickly as I can tell a story!
At the top above, I linked to a page which I generated automatically using these libraries I’m releasing.
There are a few libraries. They all require NLTK. NLTK is an excellently-designed, well-developed, actively-maintained open-source natural language parsing library. It has many (nearly 1GB of) corpora.
First, generate_nouns.py is a script. We need to automatically generate a good, long list of concrete nouns for you to have strong images and remember the story of pi visually. It uses the CMUDict Pronunciation Corpus which is in nltk.corpus.cmudict. It also uses the wordnet corpus in nltk.wordnet. The script does some intelligent processing to filter out archaic words, curse words, and abstract nouns. Run generate_nouns.py at the command line to create a nouns.csv file, or just download my copy in the repo. 50-75% are very good, concrete, vivid nouns for this purpose. If you can help me get a higher percentage/more good nouns, please tell me.
Second, there is soundmap.py. Soundmap.py is a library (import soundmap) that you can use to convert a word or phrase into the corresponding digits. To be perfectly flexible, it loads a file which describes how to match which sounds to which digits. I provided the sounds.csv file which is the one I use. I haven’t tried to figure out what would be the optimal configuration yet, but maybe you can
. This also uses the CMUDict Pronunciation corpus (of course). Call soundmap.convert_to_digits(phrase) to have it return a string of digits.
Finally, there is mapwords.py. Mapwords.py is a library that takes in a string of digits (such as the digits in pi) and uses the nouns.csv list of nouns and soundmap.py to figure out the optimal sequence of words for people to remember that sequence of digits. It also has a couple hundred digits of the famed constant inside the library: mapwords.pi. Simply call mapwords.get_best_mapping(mapwords.pi) for it to return a list of words.
You can put all these together and quickly learn thousands of digits of pi. Here’s a great page with many digits to throw into the program.