Fun With Cryptarithms

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 10

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

SEND + MORE = HONEY, BUNNY, MONEY!

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

Much, Much More!


There are in fact 4467 alphametics for send + more = ? including: send + more = cash send + more = honey send + more = bunny send + more = ants send + more = bikes ...

How do we teach the computer computer to solve cryptarithms


Cant you do anything right?

Cant you do anything right?

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 explain everything to the silly computer it does it FAST


You must explain to your computer how to check equation for every permutation with something like this:
For (hsenmcorda = 0123456789,1023456789, 9876543210) Check: { (1000*S) + (100*E) + (10*N) + D + (1000*M) + (100*O) + (10*R) + E = (1000*C) + (100*A) + (10*S) + H }

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

The modern 8 core PC would do the same work 8 times faster.

You might also like