cryptarithmetic Problem
 SEND
+MORE
----------
MONEY

Let the numbers "to carry" be t, u, v, and w that I've written above
the addition:


tuvw
 SEND
+MQRE
-----
MQNEY

The numbers "to carry" are either 0 or 1.  Since the letter O looks like the
digit 0 (zero), I will use Q instead to avoid confusion.

 Obviously t = M = 1, so we have


1uvw
 SEND
+1QRE
-----
1QNEY

Case 1:  u=1

11vw
 SEND
+1QRE
-----
1QNEY

Then S = 8, Q = 9

11vw
 8END
+10RE
-----
10NEY

This makes v=1 to prevent E=N
But in order to cause a carry of 1,
E could only be 9, causing N=0
but Q is already 0.  That rules
out case u=1.

So u=0

10vw
 SEND
+1QRE
-----
1QNEY

so S=9, Q=0

10vw
 9END
+10RE
-----
10NEY

v=1 to prevent E=N

101w
 9END
+10RE
-----
10NEY

E + 1 = N
w + N + R = 10 + E
D + E = Y + 10w

Try w=0

E + 1 = N
N + R = 10 + E
D + E = Y 

Substitute E + 1 for N in the second equation

E + 1 + R = 10 + E

That simplifies to

R = 9

But S = 9,

so w = 1

1011
 9END
+10RE
-----
10NEY


N + R = E + 9
1 + E = N
D + E = Y + 10

Substitute 1 + E for N in the 1st equation

1 + E + R = E + 9
        R = 8

1011
 9END
+108E
-----
10NEY

E + 1 = N
D + E = Y + 10

0 and 1 are used, so Y > 1, so

D + E > 11

So the only possibility is

{D,E} = {6,7} or {D,E} = {5,7}

Try {D,E} = {6,7}

So Y = 3


1011
 9END
+108E
-----
10NE3

But E has to be 1 more than E
E can't be 7 because that would make N=8=R.  
E can't be 6 because that would make N and D 
both be 7.

So 

{D,E} = {5,7} which makes Y = 2


1011
 9END
+108E
-----
10NE2

Since N is 1 more than E, E can't be 7,
for that would make N=8=R, so E=5, and D=7

1011
 95N7
+1085
-----
10N52

So N=6
SOLUTION
1011
 9567
+1085
-----
10652

Popular posts from this blog

BIG DATA

C plus plus notes