Explaining the "trivial solution" mentioned by Daniel
The last digit cannot be 9 because it is 2 * E
(from AWE and SOME) , therefore needs to be even. That leads to 9998
as possible max value for MATH
and E = 4
as only possible value for E
. Let's try:
A W 4
+ S O M 4
---------
9 9 9 8
As we want to have M = 9
(from MATH), we can conclude that W = 0
because W + M = 9
(and we have no carry over from the first digit).
A 0 4
+ S O 9 4
---------
9 9 9 8
We also want to have A = 9
(from MATH), we again can conclude that O = 0
because A + 0 = 9
(and again no carry over)
9 0 4
+ S 0 9 4
---------
9 9 9 8
Leaves us with S = 9
to reach the final result.
9 0 4
+ 9 0 9 4
---------
9 9 9 8
Upate
As quarage pointed out, there is another possible solution for 9998, and it's also straight forward. The assumption that 9999 is not possible is still valid, but of course you can reach H = 8
(for MATH) also with E = 9
:
A W 9
+ S O M 9
1
---------
9 9 9 8
As we know that M = 9
(from MATH) and now we have a carry over from the first digit, we know that W = 9
:
A 9 9
+ S O 9 9
1 1
---------
9 9 9 8
And we know that A = 9
(from MATH), so O = 9
9 9 9
+ S 9 9 9
1 1 1
---------
9 9 9 8
Which finally leads to S = 8
9 9 9
+ 8 9 9 9
1 1 1
---------
9 9 9 8