# Alphametics

Consider the following problem. This is a problem on simple addition where each letter represents a unique digit and M is not equal to zero.

This classic example was published in July 1924 issue of Strand Magazine by Henry Dudeney. Here, one has to find the digits that are represented by the letters to make this addition correct. The most important task in this activity is proper analysis and reasoning. At first, this may appear to be a daunting task, but if you take it step-by-step, you will find it rewarding and entertaining.
The sum of any two four-digit numbers cannot yield a number greater than 19,998. [The maximum possibility is 9999 + 9999.] Therefore, M = 1.
Since M = 1, MORE < 2000. SEND < 10,000. This implies that MONEY < 12,000. Thus, â€˜Oâ€™ can be either 0 or 1. But 1 is already assigned to M. Therefore, O = 0.
Now, we have;

Now, MORE < 1100. If SEND is less than 9000, then MONEY < 10,100, which would imply that N = 0. But this cannot be, since 0 is already assigned to O. Therefore, SEND > 9000. So, S = 9.
Now we have;

Consider the digits in hundreds place. If there is no carryover to the hundreds column, then E + 0 = N, which implies that E = N. This is not permissible. Therefore, there must be a carryover to the hundreds column. This implies that E + 0 + 1 = N, or E + 1 = N. It further implies that N + R = E + 10, if there is no carry over to tens place or N + R + 1 = E + 10, in case there is carry over to tens place.
First, we shall presume that N + R = E + 10 holds. Substituting the value of N = E + 1 in this equation, we get:
(E + 1) + R = E + 10, which implies that R = 9. But 9 has already been assigned to S. This implies that our assumption N + R = E + 10 is not correct. So, N + R + 1 = E + 10 should be correct.
N + R + 1 = E + 10.
(E + 1) + R + 1 = E + 10 (since, N = E + 1). This implies that R = 8.
We now have;

From the remaining list of available digits, we find that D + E < 14. Since there is carry over to tens place, D + E = Y + 10. Further Y cannot be 1, since M = 1. So, Y is either 2 or 3.
If Y = 3, then D + E = 13, implying that the digits D and E can take only 6 or 7. If D = 6 and E = 7, then from the earlier equation E + 1 = N, we get N = 8 which is unacceptable since R = 8. If D = 7 and E = 6, then, from the earlier equation, E + 1 = N we get N = 9, which is again unacceptable since S = 9. Thus, Y cannot be 3.
Therefore, Y = 2.
We now have;

Thus, D + E = 12. The only way to get this sum is with 5 and 7.
If E = 7, we again get, N = E + 1 = 7 + 1 = 8, which is not acceptable.
Therefore, D = 7 and E = 5. We can now again use the equation E + 1 = N to get N = 6.
Finally, we get the solution:

Now, MORE < 1100. If SEND is less than 9000, then MONEY < 10,100, which would imply that N = 0. But this cannot be, since 0 is already assigned to O. Therefore, SEND > 9000. So, S = 9.

Consider the digits in hundreds place. If there is no carryover to the hundreds column, then E + 0 = N, which implies that E = N. This is not permissible. Therefore, there must be a carryover to the hundreds column. This implies that E + 0 + 1 = N, or E + 1 = N. It further implies that N + R = E + 10, if there is no carry over to tens place or N + R + 1 = E + 10, in case there is carry over to tens place.

From the remaining list of available digits, we find that D + E < 14. Since there is carry over to tens place, D + E = Y + 10. Further Y cannot be 1, since M = 1. So, Y is either 2 or 3.

Thus, D + E = 12. The only way to get this sum is with 5 and 7.

This is one of the celebrated problems of the world of â€˜alphameticsâ€™, an interesting bi-product of mathematics which deals with the numbers in disguise! It is also called cryptarithms (this name is originated from the word â€˜cryptographyâ€™, a branch of science that deals with encoding and decoding the passwords and letters written in secret languages). A cryptarithm is an arithmetical puzzle in which each digit of an arithmetical operation (addition, subtraction, multiplication, etc.,) is assigned a definite letter as in a code. The problem is to decode and find the digits assigned to each of the letters.

While posing the cryptarithm problem, one must keep the following rules in mind:

While posing the cryptarithm problem, one must keep the following rules in mind:

- The code must be oneâ€“one. All occurrences of a given digit must be replaced by the same letter, and different digits cannot be represented by the same letter.
- Common arithmetical conventions must be observed. For example, the first digit of a number cannot be 0. Thus, in the problem given above, we must have S â‰ 0 and M â‰ 0.
- The problem and codes must be such that precisely one answer exists. Problems with multiple solutions are generally not considered â€˜niceâ€™. It is difficult to achieve and we shall sometimes be forced to relax this requirement.
- Finally, it is also an attractive feature to select the code so that actual names or dictionary words appear in the problem.