You are on page 1of 6

A Primer on Cryptarithms involving addition and subtraction

Submission Date: December 11, 2004

by

Harsh Menon Ext 5369

Performed for Dr. Susan Gerhart, Professor, CS 222 In partial fulfillment Of the requirements of CS222.1 Discrete Structures Fall 2004 Embry-Riddle Aeronautical University Prescott, Arizona

CRYPTARITHMETIC

2

5/11/2008

INTRODUCTION Purpose
The purpose of this document is to communicate to the reader the process involved in solving a cryptarithmetic by analysis of the process. The document is directed at people who have an interest in cryptology and have a thorough background in arithmetic.

PROCESS ANALYSIS Overview
Cryptarithmetic is the science and art of creating and solving cryptarithms. A cryptarithm is a type of mathematical puzzle in which the digits are replaced by alphabets or other symbols. The invention of Cryptarithmetic has been dated back to ancient China. This art was originally known as letter arithmetic or verbal arithmetic. In India, during the middle ages, cryptarithms called "skeletons" were developed. These were cryptarithms in which most or all of the digits have been replaced by asterisks.

Chronological Description
1. Preparation Write the problem again, but by leaving more spaces between the alphabets to make room for trial numbers that will be written under the letters. For example, the puzzle SEND + MORE = MONEY, after solving can be seen in Figure 1: Solved Cryptarithm:
S E N D 9 5 6 7 + M O R E 1 0 8 5 --------M O N E Y 1 0 6 5 2

Figure 1: Solved Cryptarithm. (Source: geocities.com 2002.)

CRYPTARITHMETIC 2. Remember cryptarithmetic conventions
• • • • •

3

5/11/2008

Each letter or symbol represents only one digit throughout the problem; When letters are replaced by their digits, the resultant arithmetical operation must be correct; The numerical base, unless specifically stated, is 10; Numbers must not begin with a zero; and There must be only one solution to the problem.

3. See subtractions as "upside-down" additions Read subtractions as upside-down additions. It is possible to check a subtraction by adding the difference and the subtracter to get the subtrahend. The subtraction in Figure 2: Subtraction must be read from bottom to top and right to left as in Figure 3: Reading Subtraction:
C O U N T - C O I N --------S N U B

Figure 2: Subtraction (Source: geocities.com 2002)
B U N S + + + + N I O C = = = = T N U O + + + + C1 C2 C3 C4

Figure 3: Reading Subtraction (Source: geocities.com 2002)

C1, C2, C3 and C4 are the carry-overs of "0" or "1" that are to be added to the next column to the left. 4. Search for "0" and "9" in additions or subtractions A good hint to find zero or 9 is to look for columns containing two or three identical letters.

CRYPTARITHMETIC * * * A * * * A ------* * * A

4 * * * B * * * A ------* * * B

5/11/2008

+

+

Figure 4: Addition (Source: geocities.com 2002)

Figure 4:Addition shows two additions. The columns A+A=A and B+A=B indicate that A is zero. In math this is called the "additive identity property of zero"; it says on adding "0" to anything and it doesn't change, therefore it stays the same. Now look at those same additions in the body of the cryptarithm in Figure 5: Body Addition: * A * * + * A * * ------* A * * * B * * + * A * * ------* B * *

Figure 5: Body Addition (Source: geocities.com 2002) In these cases, A may take on a value of zero or nine. It depends whether or not "carry 1" is received from the previous column. In other words, the "9" mimics zero every time it gets a carry-over of "1". 5. Search for "1" in additions or subtractions Look for left hand digits. If single, they are probably "1". Take the world's most famous cryptarithm in Figure 6: Famous Cryptarithm:
S E N D + M O R E --------M O N E Y

Figure 6: Famous Cryptarithm (Source: geocities.com 2002) "M" can only equal 1, because it is the "carry 1" from the column S+M=O (+10). In other words, every time an addition of "n" digits gives a total of "n+1" digits, the left hand digit of the total must be "1". In the subtraction problem in Figure 7: Subtraction Problem, "C" stands for the digit "1":

CRYPTARITHMETIC

5
C O U N T - C O I N --------S N U B

5/11/2008

Figure 7: Subtraction Problem (Source: geocities.com 2002) 6. When stuck, generate-and-test Usually we start solving a cryptarithm by searching for 0, 1, and 9. Then if we are dealing with an easy problem there is enough material to proceed decoding the other digits until a solution is found. This is the exception and not the rule. Most frequently after decoding 1 or 2 letters (and sometimes none) you get stuck. To make progress we must apply the generate-and-test method, which consists of the following procedures:
• • •

List all digits still unidentified; Select a base variable (letter) to start generation; Do a cycle of generation and testing: from the list of still unidentified digits (procedure 1) get one and assign it to the base variable; eliminate it from the list; proceed guessing values for the other variables; test consistency; if not consistent, go to perform the next cycle (procedure 3); if consistent, stop: you have found the solution to the problem.

CONCLUSION
This document covers only the addition and subtraction aspects of cryptarithmetic. More information on multiplication and division and other advanced topics in cryptarithmetic is beyond the scope of this document and can be found at the website listed in the works cited section.

WORKS CITED
Barker, C. (n.d.). Cryptarithms. Retrieved Dec. 01, 2004. <http://perso.wanadoo.fr/colin.barker/index.htm> Logicville. (2004). Cryptarithm. Retrieved Dec. 01, 2004. <http://www.logicville.com/cryptarithm.htm> Soares, J. (2002). A Primer on Cryptarithmetic. Retrieved Nov. 28, 2004. <http://www.geocities.com/Athens/Agora/2160/primer.html#WHT>

CRYPTARITHMETIC

6

5/11/2008