Professional Documents
Culture Documents
Fun With Cryptarithms
Fun With Cryptarithms
Fun With Cryptarithms
by ArtMig Sasha M
History
SEND + MORE = MONEY
YOU + OWE + ME = CASH
A place for playing with cryptarithms: http://www.geocities.com/Athens/Agora/2160/primer.html A cryptarithm is a genre of mathematical puzzle in which the digits are replaced by letters of the alphabet or other symbols. The invention of Cryptarithmetic has been ascribed to ancient China. This art was originally known as letter arithmetic or verbal arithmetic.
Popular puzzles
The world's best known alphametic puzzle is undoubtedly SEND + MORE = MONEY Solution: 9567 + 1085 = 10652 Code: H. E. Dudeney 0123456789: omy * * e nd r s It was created by H. E. Dudeney and first published in the July 1924 issue of Strand Magazine associated with a story of a kidnapper's ransom demand. More examples: http://www.cryptarithms.com/default.asp?pg=1 Instructions how to solve manually: http://www.geocities.com/Athens/Agora/2160/primer.html
You have to find all different letters in these words. There must be 10 or less different letters, otherwise there can be no solution. The simplest case is when there are exactly 10 different letters. 2 Then they must be a permutation of 0123456789.
What are permutations? Here are all permutations of 01: 01, 10 Here are all permutations of 012: 012, 021, 201 | 102, 120, 210
01 10
0 1
1 0
01 10
As you see, 2 is inserted in all three locations in every permutations of 01. So, we get 2*3 = 6 permutations. With 0123 we insert 3 into every of 4 positions of each of 6 permutations of 012 with total of 6*4 = 24 variants and so on. For 0123456789 we get 10*9*8*7*6*5*4*3*2*1 = 3628800 variants.
Once you find the right permutation, you are done. If there are none you claim there are no solutions. This process takes almost no time at modern computers: less than a second, once the permutation table is in place. Making a table and reading this table from a file also takes less than a second. So, there is really no problem for a computer to solve any cryptarithm.
Master
Inventing Cryptarithms
computer + memory = concerto humans + better + than = masters
CPU vs Dudney
This looks like a creative process: find words which by some magical coincidence have secret arithmetic meaning. Think again. There are 45,353 English words longer than 3 letters in the dictionary file called linux.words (Located on Unix at /usr/share/dict/words). So, our computer must check 45,353 x 3,628,800 = 164,576,966,400 equations. This is not so much, really, but still we are talking of minutes and hours rather than seconds. If we want to invent cryptarithms we must speed it up.
Measuring words.
To begin with, not all the words can serve as a sum in the equation. The word in place of money cannot be shorter than the longest of send or more, nor longer than the longest of them + 1. Relationship
Money Send More Babysitter
This means that many words can be rejected right away, before we start checking all permutations.
For example, the beautiful family of cryptarithms madonna + religion = ? has only 2 solutions: madonna + religion = leonardo 9761447 + 20385814 = 30147261 and: madonna + religion = marriage 8369223 + 75401092 = 83770315 Computer had to check only 216 words, which is less than half percent of total.
It took a few seconds because I measured the words, otherwise, it would have taken 200 times longer.
Parallel Computations
Computers also can be accelerated by parallel processing. New laptops have two processors (two cores), each of which can simultaneously try its own equation. This will speed the work twice.
Money Cash Smash Cart Zone Step Stool Steep