[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1980.0. "word to number" by BRSTR2::SYSMAN (Dirk Van de moortel) Wed Jun 21 1995 12:44

             ONE
             ONE
             ONE
           THREE
           THREE
          ELEVEN
        + ------
          TWENTY

there's only one solution...
Don't write a program, try to find it. THEN write a program to check it ;-)
T.RTitleUserPersonal
Name
DateLines
1980.1first half or soWIBBIN::NOYCEThe brakes still work on this busThu Jun 22 1995 13:2980
             ONE
             ONE
             ONE
           THREE
           THREE
          ELEVEN
        + ------
          TWENTY

Assuming that each of the 10 letters is a different digit, and that there are
no leading zeros...

In column 1 (rightmost), 5*E + N = Y (mod 10) shows that E must be odd, since
otherwise N=Y.  And therefore N+5 = Y (mod 10).

In column 6 (leftmost), E + carry_6 = T.  The carry in to column 6 therefore
cannot be zero, and must be 1 or 2.  (It could only be 3 if T=L=9.)
And therefore E cannot be 9.

In column 2,
	3*N + 3*E + carry_2     = T	(mod 10 from here on)
	3*N + 2*E + E + carry_2 = E + carry_6
	3*N + 2*E + carry_2     = carry_6     [ = 1 or 2 ]
We can enumerate solutions for E={1,3,5,7}:
E=1:	3*N + 2 + [(N+5)/10]    = carry_6
E=3:	3*N + 6 + [(N+15)/10]   = carry_6
E=5:	3*N + 0 + [(N+25)/10]   = carry_6
E=7:	3*N + 4 + [(N+35)/10]   = carry_6

These simplify to
E=1 or 5, N<5  ==> 3*N+2 = [1 or 2]  => N=3 or N=0
E=1 or 5, N>=5 ==> 3*N+3 = [1 or 2]  => N=6 or N=3
E=3 or 7, N<5  ==> 3*N+7 = [1 or 2]  => N=8 or N=5
E=3 or 7, N>=5 ==> 3*N+8 = [1 or 2]  => N=1 or N=8

Eliminating the contradictions with the range test on N leaves:
	E=1, N=3, T=2, Y=8
	E=1, N=0, T=3, Y=5
	E=5, N=3, T=6, Y=8
	E=5, N=0, T=7, Y=5 (reject, duplicate digit E=Y)
	E=1, N=6, T=2, Y=1 (reject, duplicate digit E=Y)
	E=5, N=6, T=6, Y=1 (reject, duplicate digit N=T)
	E=3, N=8, T=5, Y=3 (reject, duplicate digit E=Y)
	E=7, N=8, T=9, Y=3

We can also reject the case (E=1, N=0, T=3) because in column 5 we have
	T + T + L + carry_5 = W+20 (because E+2=T).
	3 + 3  = W+20 - L - carry_5 >= 20 - 9 - 3 = 8.

We're left with the cases

	    O31
	    O31
	    O31
	  2HR11
	  2HR11
	 1L1V13
	+------
	 2W1328

	    O35
	    O35
	    O35
	  6HR55
	  6HR55
	 5L5V53
	+------
	 6W5368

	    O87
	    O87
	    O87
	  9HR77
	  9HR77
	 7L7V78
	+------
	 9W7893

time for lunch... The next step is to attack  H + H + carry_4 = 0 (mod 10).
Eventually we discover R=7...
1980.2a solutionFLOYD::YODERMFYThu Jun 22 1995 16:3910
    235
    235
    235
  69755
  69755
 505153
 ------
 645368

I'll leave the uniqueness proof to others; alas, mine doesn't fit in the margin.
1980.3HANNAH::OSMANsee HANNAH::IGLOO$:[OSMAN]ERIC.VT240Thu Jun 22 1995 17:302
Do we believe that Yoder did this without a computer ?
1980.4Re: .4FLOYD::YODERMFYFri Jun 23 1995 11:1712
Well, *I* believe that I did it without a computer.

Of course, I could be mistaken...  :-)

My proof of uniqueness consists of lots of trial and error.  I took on faith the
declaration that R=7 in .1, which eliminates the third possibility given there;
then I found that the first possibility doesn't work, and the second one leads
to the solution I found and to no others (assuming I made no mistakes).  But I
don't think the process was terribly edifying.  One key point is that the carry
into column 4 must be even, hence it must be 0, 2, or 4; these lead to H = 0 or
5, H = 4 or 9, and H = 3 or 8 respectively.  I think the case of the carry being
4 can be eliminated pretty quickly.
1980.5Correction to .-1FLOYD::YODERMFYFri Jun 23 1995 11:243
A somewhat embarrassed elaboration on my last comment: if the third diagram is
indeed eliminated, then the carry into column 4 can't be 4, because that implies
H = 3 or 8, both of which are taken.  So the carry is either 0 or 2.
1980.6Quick kill of the first caseFLOYD::YODERMFYFri Jun 23 1995 11:418
Assuming R=7, the first case can be shown to be impossible quickly.

The carry into column 3 is 1, and into column 4 is 2.  So we must have

  O+O+O+7+7+V+1(carry) = 10*2+3 = 23
  3*O+V = 8

So O < 3 and O isn't 0 or 1, so O=2, which implies V=2 also.
1980.7CSC32::D_DERAMODan D&#039;Eramo, Customer Support CenterFri Jun 23 1995 11:514
        Computer trial of the 3,628,800 possibilities shows there is
        exactly one solution, as given in .2. :-)
        
        Dan
1980.8Quick kill of second caseFLOYD::YODERMFYFri Jun 23 1995 12:0612
Well, it looks like much of the trial and error I did isn't needed.

In the second case, if R=7, then the carry into column 4 isn't 0, so it's 2, and
H = 4 or 9.  Now 3*O+V = 7, so {O,V} = {2,1} or {1,4}.  If the latter, then
(since H = 4 or 9) H = 9, 14+L = 10+W, so W = L+4 and {W,L} = {0,2} which is
impossible.

So O=2 and V=1.  If H=4, then 13+L = W+10, so W=L+3 and {L,W} = {0,9} which is
impossible; therefore H=9.  Now 14+L = W+10, so W=L+4 and {L,W} = {0,4}, so L=0
and W=4, which is the solution in .2.

So the only gap is the demonstration that R=7, which I took for granted.
1980.9kill of third case without assuming R=7FLOYD::YODERMFYFri Jun 23 1995 12:3915
This may be superfluous depending on how R=7 is demonstrated, but here goes.

The carries into columns 2 and 3 are both 4.  The carry into column 4 is 0 or 2;
if it is 0, we must have 4+3O+2R+V=8, but the total is at least 4+3*1+2*0+2=9,
so the carry is 2.  So 4+3O+2R+V=28, 3O+2R+V=24, hence 3 divides 2R+V.  Also, H
is 4 or 9, so it must be 4.

The carry into column 5 is 1, and into column 6 is 2, so 19+L=20+W, L=W+1.  The
remaining numbers are 65210; if {L,W} = {5,6} then 3O+2R+V < 28, so {L,W} is
either {0,1} or {1,2} and {O,R,V} = {6,5,0} or {6,5,2}.

If O=6, then 2R+V=6 and {R,V} = {5,0} or {5,2}, so V=5 and R=1, a contradiction. 
So one of R or V is 6; but 3 divides 2R+V, so 3 must divide both R and V, so
they must be 0 and 6, and O=5.  Then 9=2R+V, which implies V=6 (since R can't be
6), but then R=3, a contradiction, and we are done.
1980.10Proof that R=7 in second caseFLOYD::YODERMFYFri Jun 23 1995 17:0221
The carry into col. 3 is 2, so the total in C3 can't be 3; thus it must be 23
(since the carry into C4 is 0 or 2).  Therefore, H = 4 or 9.

Now 3O+2R+V=21, so O is one of {1,2,4}; also 3 divides 2R+V, so R==V (mod 3). 
The unassigned values are {0,1,2,4,7,9}, which separate mod 3 into {0,9},
{1,4,7}, and {2}.  Therefore R and V are == 0 or 1 (mod 3).

If {R,V} = {0,9}, either O=4 and V=9 (which is impossible because H = 4 or 9),
or O=1, V=0, R=9, so H=4 and {L,W} = {2,7} which doesn't work because we must
have 13+L = 10+W.  Therefore R and V are both in {1,4,7}.

Assume R is not 7.  If V also isn't 7, then {R,V} = {1,4}; 2R+V is either 6 or
9, which lead to O=4 or O=5, both impossible.  Therefore V=7 and R is 1 or 4.

We now have 3O+2R = 14; we have R=1, O=4, H=9 and {L,W} = {0,2} or R=4, O=2, H=9
(since R=4) and {L,W} = {0,1}.  But H=9 implies 14+L = 10+W, W = L+4, which is
incompatible with both possibilities.

Hence, R=7 QED.

Now we only need a proof that R=7 in the first case.
1980.11kill of first case without assuming R=7FLOYD::YODERMFYWed Jun 28 1995 11:1511
It is easy to show that the carries into columns 2 through 6 are 0, 1, 2, 1 or
2, and 1; and H = 4 or 9.  The digits left are {0,4,5,6,7,9}, and 3O+2R+V = 22,
so O is in {4,5,6}.  O=6 implies 6=2R+V, so R=0 and V=6 which conflicts with
O=6.  O=4 implies H=9 and 10=2R+V, so R=5 and V=0.  Then {L,W} = {6,7}, but 6+L
= 10+W, whence L = W+4 which is impossible.

Therefore O=5; so 7=2R+V, whence R=0 and V=7.  We must have {L,W,H} = {4,6,9};
now (1 or 2)+4+L = 10+W, so L = W+5 or W+4, so W=4 and L=9.  But this implies
H=6, and we know H is 4 or 9.

This should complete the proof.