Soundararajan 1 Gautam Soundararajan Math 7 Peter Winkler 5/15/13 Cryptarithms S E N D + M O R E __________________________ M O N E Y The mathematical puzzle shown above is known as a cryptarithm. It is an equation that uses letters of the alphabet in place of numbers. The objective of such puzzles is to determine the number that corresponds to each letter in order to satisfy the equation. Each letter has a distinct number. For instance, the number five can correspond to N. Given this, it cannot correspond to S, E, D, M, O, R, or Y. Cryptarithms take simple operations and apply them to novel situations in order to create a fun, interesting puzzle. The specific purposes and uses of cryptarithms as well as their complexity have evolved over time. There are numerous variations of cryptarithms. Addition, as shown above, is just one variation of a cryptarithm. Others include: Longer Addition: T E D H A S + G O O D ______________________ T A S T E Multiplication: H I T * I T ______________ F A S T H I T ______________________ I I F B T Division: N E K T _________________ T| L I N K Soundararajan 2 N E T ____________ K E K K K T E C ____________ K E Y As these examples show, cryptarithms can become increasingly complicated by using longer words and different operations. Aside from providing an enjoyable pastime, cryptograms played a vital role in history. Because they are difficult to decipher, they provide an ideal tool for privacy and secrecy. Around 2000 B.C., Egyptians decorated tombs with encrypted hieroglyphics. The purpose was to make the text readable by only a few people so that it seemed more regal and important. At this point, cryptograms were not used to hide important information. They were used to give the notion that there was important information hidden in plain view. The Chinese were the next to use cryptography. Here, the tool was used to deliberately conceal messages. In India, cryptograms were used by the government in order to communicate with spies located across the country. Many other civilizations, including Mesopotamia, Babylon, and Assyria, used cryptography. The Greek writer Polybius invented what is now called the Polybius Square. Each letter and number located within the square can be represented by two numbers. For example, T is 42 and 9 is 66. This tool is still used in present day algorithms. Julius Caesar is also credited with creating his own cryptogram. The Caesar shift or Caesar cipher moves each letter four places ahead in the alphabet. Soundararajan 3 Nearly all of the Western European governments used cryptography to code messages during the Middle Ages. As technology advanced, the world became ever more connected and the need to protect information became even more vital. New forms of cryptography were developed in order to protect information as the radio and telegraph were invented. Protecting military information was a primary concern as well. Special bureaus have been created to handle such matters. The National Security Agency is assigned this task in the United States. Data is encrypted using advanced digital electronics. The process of transferring private messages is summarized by the following diagram: There is information that one group wants to share with another group. First one group has to code the message, this step is called encryption. Encryption hides the message so that other people cannot understand it. The second group receives the message and decodes it using the same key that the first group used to code the message. After decryption, the second group has the original message and no third parties will have seen the unencrypted message. The important Soundararajan 4 component in this process is the encryption key. It must be complicated enough to prevent others from decoding it. Cryptography was and remains vital as a tool for secrecy. Cryptarithms have the same logic. The solver is attempting to determine the encryption key. More difficult puzzles have stronger encryptions. One significant difference, however, is that mathematical puzzles are not concealing private information. They are merely there for readers’ amusement. The first inclination people have when faced with cryptarithms is to use “trial and error”. Although this method may work in some cases, it can be more time consuming than using an algorithm to solve the puzzle. There are more efficient ways of solving these types of puzzles. Some strategies are as follows: 1. Look for obvious clues in the left-most or right-most columns. 2. When you are adding two letters, the maximum carry-forward value is 1. A (9) + A (9) ________ B C 1 8 The intuition behind this is that the largest digit is 9. When you add two 9s, you get 18. Thus, the largest carry-forward value (B) is 1. 3. When you are adding three letters, the maximum carry forward value is 2. A (9) A (9) + A (9) __________ B C 2 7 The intuition is the same as it was for strategy 2. 4. An asterisk represents additional letters/digits that are not shown. If we have A** + 1** = 1C**, A must be 8 or 9, and C must be 0 or 1. If A was smaller, there would be no carry-forward value in front of C. 5. If we have **A + **A = **A or **A + **B = **B, then A must equal zero. The only digit that equals itself when it is added to itself is 0. In the second case, the only way to get one digit when that digit is added to another digit is if the other digit is zero. These strategies are useful when solving cryptarithms. They provide clues and hints to solving the puzzle and may give us a starting point. However, they are not guaranteed to help. Some puzzles may have additional conditions that make these statements invalid. Thus, the solver must always pay careful attention to the question being asked. One common theme among all Soundararajan 5 cryptarithms, mathematical puzzles, and puzzles in general is the need for logic. Even with strategies, logic is necessary since the strategies merely provide a rough guide at best. Let us now solve the cryptarithm posed at the beginning. It is a very famous puzzle and is reproduced below with column numbers on top. 1 2 3 4 5 S E N D + M O R E __________________________ M O N E Y The first thing to note is that M is one. We determine this by looking at column 2. The largest sum of S and M has a carry-forward value of 1. This is explained by strategy 2. We can plug in this value wherever there is the letter M in the equation to get: 1 2 3 4 5 S E N D + 1 O R E __________________________ 1 O N E Y Let us now turn our attention to the letter S in column 2. In order to get a carry-forward value, S must be large. The only way to get a carry-forward value when adding a digit to one is if the digit is 9 or 8. 8 may also work because there could be a carry-forward value from column 3. We can narrow done the choices by showing why 8 does not work. First notice that the letter O must equal zero. The sum in column 2 can be 10 or 11. But O cannot equal one because M has already taken that value. 1 2 3 4 5 S E N D + 1 0 R E __________________________ 1 0 N E Y There cannot be a carry-forward value in column 3 because no number added to zero gives a carry-forward value. Using this intuition, we see that S must equal 9 so that there is a carryforward value of one in column 2. 1 2 3 4 5 9 E N D + 1 0 R E __________________________ 1 0 N E Y Soundararajan 6 We know that there must be a carry-forward from column 4 since E + 0 = N and the two letters cannot be equal. Because the largest carry-forward value is one, N = E + 1. Using column 4, we get N + R + (+ 1) = E + 10. (+ 1) represents a potential carry-forward from column 5. Subtract the first equation from the second to get R + (+ 1) = 9. So, R can be 8 or 9 dependent on whether there is a carry-forward value or not. But S is already 9 so R cannot be 9. R is 8 and one is carried-forward from column 5. 1 2 3 4 5 9 E N D + 1 0 8 E __________________________ 1 0 N E Y Column 5 must be at least 12 since we know there is a carry-forward value and Y cannot be zero or one. The only remaining digits that can give us a value of at least 12 are 7 and 6 or 7 and 5. N is one larger than E, so N must be 6, E is 5, and D is 7. This means that Y equals 2. The final solution is shown below. 1 2 3 4 5 9 5 6 7 + 1 0 8 5 __________________________ 1 0 6 5 2 The process of solving the puzzle requires a great deal of logic, persistence, and intuition, but no special knowledge in the field of mathematics. Cryptarithms are a very specific subset of mathematical puzzles. They played and continue to play a vital role in the history of the world. They started as simple puzzles that did not conceal messages and morphed into tools of increasing complexity that conceal confidential information. Soundararajan 7 Bibliography http://toprobin.com/how-to-draw-a-model-3/ http://cryptarithms.awardspace.us/puzzles.html#LONGDIV https://www.cryptochallenge.com/home/history http://en.wikipedia.org/wiki/Cryptography http://www.cloudcentrics.com/?p=1397 http://www.stealthcopter.com/blog/2009/12/python-cryptography-caesar-shift-encryption-shiftcipher/