tonyandkirsten.org

It’s our website!

A fun puzzler for finals week

So, there was once a poor college student who was quite adept at creating and solving puzzles. His name was Chris. At the end of his first year of college, Chris realized that in order to further his education, he was going to need a little more money. Thinking cheap, Chris bought a postcard to send home. After thinking about what to write, he though of a message that shows simultaneously his intelligence and his exact need. In a flourish, Chris scambles his message on the postcard and sticks it in the mail. The message was:

    SEND
  + MORE
  ------
   MONEY

After solving the puzzle, Chris’ parents promptly sent him a check for the amount specified. How much money did his parents send?

  1. erik Said,

    grrr, you forced me to read MAN pages. now my day is ruined…. the best answer i could come up with is that the amount is in a file called “—MONEY”. somehow i doubt that’s the real answer.

  2. tonyhill Said,

    Wrong track, Erik. It’s not computer-ey. It’s a math problem. Think (simple) cryptography.

  3. erik Said,

    oh, the thing that threw me off there was the fact that normally in an addition problem the + is on the left side of the stuff to be added, so i just thought throwing it on the right was a tricky way of it actually being a legal parameter to the unix command “more” :)

  4. tonyhill Said,

    Oh, that does look better!

  5. mike Said,

    hmm I know the first digit

  6. tonyhill Said,

    Yes, M=1.

    That’s the easiest part. You should be able to continue from there.

  7. erik Said,

    i got it…..
    here’s the answer…
    import java.lang.*;

    public class Calc{

    public static void main(String[] args){
    int s,e,n,d,m,o,r,y;
    int a1,a2,a3;
    m=1;

    for(s=0;s

  8. erik Said,

    bummer, it cut off my comment/program!

  9. erik Said,

    ohh, “open html tag” silly thing

  10. tonyhill Said,

    Put your code in the <code> </code> tags.

  11. Ben W Said,

    Are numbers exclusive to letters, or no (can m and y both be 1 for example)?

  12. erik Said,

    import java.lang.*;

    public class Calc{

    public static void main(String[] args){
    int s,e,n,d,m,o,r,y;
    int a1,a2,a3;
    m=1;

    for(s=0;s

    definitely not the most efficient way as i still had plenty of instances with duplicate values to sort through. but, nice and quick to write :)

  13. erik Said,

    bummer again. it wasnt tough, just a bunch of nested loops for each variable that loop 0 through 9, three assignments, and an if that prints the values. terrible in a big o sense, but whatever :)

  14. Ben W Said,

    Teacher, teacher!! Erik’s cheating!!
    Cheater, cheater, pumpkinseed eater!!

  15. tonyhill Said,

    Ben, yes the variables each contain a unique integer between 0 and 9, inclusively.

    While I’m sure Erik’s code brute forced its way to an answer (though we have not seen his answer), it is possible to use reason to solve for the variables.

    For instance, the only way that two four-digit numbers can add to a five-digit number results in a number between 10000 and 19998, so M must equal 1. Also, if a 1 is carried from the fourth column to the fifth column, S must be either an 8 or a 9. Regardless, the the addition results in O being either a 1 or a 0. Since M is already 1, we now know O to equal 0.

    Keep going and you can reason your way through the whole answer.

  16. erik Said,

    well i didnt want to spoil it for ben there!

    so dont read this!
    S=9,E=5,N=6,D=7,M=1,O=0,R=8,Y=2
    yes, brute force is the way to go :)

  17. Amy Said,

    Congratulations! You all get this weeks Nerd Award! (even though I don’t give it out every week) You should be very proud. :-)

  18. tonyhill Said,

    I am very proud, actually.

  19. Scott Said,

    Wasn’t this the NPR Car Talk Puzzler last week?

  20. tonyhill Said,

    Yes, it was the Car Talk puzzler last week. I did not come up with the puzzle, but I did solve it, myself.

  21. Ben W Said,

    Erik,

    You didn’t figure it out until 7:46 yesterday?! So, so, so very sad …

  22. mike Said,

    did you brute force it though tony?

  23. tonyhill Said,

    No, I solved this problem with a pen, some scraps of paper and cold, hard logic.

    Picking up where I left of earlier, with M = 1 and O = 0, we now see that S must equal 9, as there is no way to have a one carry from the third column to the fourth with a 0 in the third column.

    Noting that E != N, we now know that a 1 is carried from the 2nd column to the third. We also know that N = E + 1. We also know that N + R > 10. In fact, we know that the carry (or lack thereof) + R must equal 9, since that is the only way for N + R + (1 or 0) = 10 + E, since N = E + 1. With 9 already taken, R must equal 8, and there must be a one carried from the first column to the second.

    So, now we can look at the remaining digit pairs that could be E and N. Those are: (2,3), (3,4), (4,5), (5,6), and (6,7). The choice of E,N must be such that it is still possible for D + E > 11. Since the largest remaining digit is 7, E must be >= 5. There is only one pair of (E,N) that satisfies this condition, namely (5,6). We now also know that D must be 7.

    From here, it is just addition to find Y = 2.

    That’s how I solved it! :-)

  24. erik Said,

    yes benjamin, my code actually had to run for 3 hours to get an answer ;)
    here is the complete, unimpressive story of my solution to this problem:
    after figuring out the m=1 thing i figured s must be 8 or 9, and then thought it would be cute if o were 0…and then i thought, “hey i can make this into an equation and plug it into the ti-92″. then i realized i forgot the correct syntax for the ti-92’s solve function, and got a weird answer there. then i realized i could just write a java program in 10 minutes that did it. sure, it doesn’t ignore all duplicates, but by scrolling through the output i eventually found the right case. the end. :)
    so i failed twice, well maybe 1.5 times and the other half was not wanting to use my brain power like tony did to actually figure it out :)

Add A Comment