It’s the Friday Puzzle!

98

How can you place the arithmetical signs ‘+’ and ‘-‘ between the consecutive numbers 123456789 so that the end result is 100?  So, for example, you could go…..

12+34+56-7-89 , but that would make 6, so that doesn’t work.

Try to come up with the method that uses the least number of symbols.

As ever, please do NOT post your answers, but do feel free to say if you have a solution and how long it took.  See you Monday.

Update: @spacemagick has written to program to generate solutions and claims there are 11 solutions, of which one uses only 3 symbols!

Advertisements

98 comments on “It’s the Friday Puzzle!

  1. Kitty says:

    Got it!

    Maybe 5 minutes of playing around with the numbers, but I wonder if there’s a more systematic way.

  2. Does negative 100 count? lol..

  3. Luis says:

    Took about 10 minutes. 4 signs

  4. linzi catt says:

    about 5 mins 6 signs though 😦 be interesting to see others solutions!!!

  5. Thomas says:

    Cool… first number puzzle I solved on first attempt: 4 signs (or is that a spoiler? if so, please edit post)

  6. Thomas Widmer says:

    I found one with 3 signs, three with 4 signs, 6 with 6 signs and 1 with 7 signs.
    I admit that I used excel.

  7. James says:

    Took a couple of minutes using a calculator, 4 signs. 😀

  8. elsiem says:

    I came up with an answer that uses four signs in about a minute and was very pleased with myself, but having seen that Thomas Widner can do it in three I’m going to keep trying.

  9. Drew says:

    Found one with only 3 signs in about two minutes

  10. Using a systematic method, I got a solution with three signs.

    As for time taken, I can only be approximate, but perhaps three or four songs have played in the background while I was working on it.

    My approach was to draw a sort of crude tree diagram implemented as lines of indented text in Notepad. For example, one line in the diagram lists the four numbers that “1,2,3,4,5,6” might sum to if the solution continues “±78±9”. The tree is actually quite small if you omit obvious dead ends.

    • Joao Pedro Afonso says:

      I think your solution method is the one I’m most curious to know Monday. Can you explain it better that day? Or posting a drawing in your blog? I resort in my paper and pen approach to nines out, tables of partial sums with nines out, module operations (basically odd and even pairings) but in the end, I used trial and error as likely the same everyone. Wasted time. But your method appears promising.

    • Joao: Will try to explain it Monday provided I can still remember it by then.

  11. stu says:

    No systematic methond for me!! Just trial and error.

    I got a solution with 4 signs in about five minutes. Managed to get a solution using three signs about 15 minutes later.

  12. Steve Ulven says:

    Trial and error here as well. Took about five minutes.

  13. CaptSasquatch says:

    Got it! 3 signs, roughly 3-4 minutes. Used a calculator and trial and error.

  14. Cosmo Steve says:

    I started to write some code to figure this out then I stopped.

  15. Mchl says:

    Some three minutes four signs

  16. Rob says:

    I am feeling so good right now.
    Yeah baby.
    Oh yeah.
    Uh huh.
    Okay.

    1 answer, less than 2 minutes, 3 symbols.

    So elegant. Thank you Richard.
    (Sorry for bragging, but last week I had a complete block and failed all weekend to understand the puzzle, let alone answer it. It still confuses me…bloody probability. Give me arithmetic any time)

  17. Rob says:

    BTW, I used a version of trial and error, but like a previous contributor, I worked on the assumption that a lot of combos were no use and started with numbers that hovered around the target mark.

  18. Stephen Barnes says:

    3 signs, about 3 minutes.

  19. Marta says:

    Got it! First I got an answer with 6 sings and a couple of minutes later, 3 sings!

  20. Steve E says:

    Got the + and – answer in about 10 minutes, 4 signs.

    Related

    1+2+3+4+5+6+7+(8*9) = 100

  21. Marcus E says:

    It took me about 10 minutes for three symbols. I tried some obscure numbers, got close but no cigar. I may try for 4 or more symbols next and see if there is a pattern.

  22. lilabyrd says:

    ugh……aaahhh…..errrr….#$%$^#$@%$%^{just think Mel Gibson should get ya there}….don’t know why I’m getting total failure…..should be easy…..wwwhhhhhhyyyy can’t I think???? OK I got the weekend…..all I can see is a gorilla playing basket ball in a room with girls and the curtains keep changing color while a monkey in a box in the corner whispering “someone is gonna die”……

  23. This is cool. I got 3 sign only. Solved around 5 minutes.

  24. lilabyrd says:

    Neverrrr mind…..I got it one so far used 4 signs……phewwww….was starting to really worry. OK took me awhile…lost count of how long….but I got at least one! Now I can tell that monkey to take a flying leap….hehehe

  25. Local Government Officer says:

    2 signs. A few minutes proving that further a one sign solution is not possible; rather longer proving that most of the possible digit lengths corresponding to a putative two sign solution cannot lead to success; and, for the sole remaining configuration, 5 minutes to determine a solution (which I doubt is unique) by systematic trial and error.

  26. Derek says:

    Trial and error here. Actually just trial, first attempt got me a four-sign solution.
    After reading that there was a three-sign solution it took me another couple of minutes to get. There was only one possible set of numbers that would give a three-sign solution so it was just a matter of changing the signs.

  27. Tim B says:

    Took about 10 mins for a 3 sign solution, 5 mins reading the comments on this page looking for hints and 5 minutes trial and error in Excel.

    Slightly too hungover this morning to think of a systematic approach to this, might have a bash later at finding the other solutions.

  28. Joao Pedro Afonso says:

    Okay, I got it. The hard way, it took me ten minutes to reach a solution I believe is the best, plus more ten devising strategies in the end I didn’t use. Then I did the easy way to see how many different solutions… after half an hour, there is so many?, Wow!

    • Joao Pedro Afonso says:

      hmm… saying the number of signs spoils a lot, since it reduces a lot the number of trials. But every one is saying them, so, here’s my number: 3 signs between 4 terms, using paper and pen. And the number of total solutions (for the benefice of @Thomas Widmer), is 12, if my processes after that are right. I hate this idea of giving too much, but then, the smart solvers doesn’t read the comments before think on the problem, and might use them to achieve more. My admiration for the ones who got more than 4 terms using trial and error!

  29. Kris says:

    3 signs and a few thousand clock cycles.

    To the above poster, a 2 sign solution is not possible. There are 11 solutions and the shortest uses three signs.

    • Local Government Officer says:

      You are mistaken, Kris, unless we are defining our terms differently. Two signs, three numbers.

    • Joao Pedro Afonso says:

      12 solutions, @Kris. And I’m eager that Monday comes so I can see @Local Government Officer solution, since I think I proved that impossible in my calculations (you are not using implicit multiplications aren’t you?)

    • Joao Pedro Afonso says:

      Oops, I’m seeing now where I’m wrong. There is a solution starting with a -1, but the puzzle asks for signs between the numbers, so it should not be counted. My apologies for correcting you.

    • Derek says:

      I’m pretty confident now that a two-sign solution is impossible. The only remotely plausible candidates begin with 1234 or 123, and it doesn’t take long to discover that they’re both dead ends.

    • Local Government Officer says:

      Derek, Kris, my apologies, I had misread (or rather not read) the question. Truly a schoolboy error!. You are indeed quite correct that there is no two sign solution; these can be immediately eliminated by inspection. Therefore 3 is best one can do. More generally, however, it is the case that by removing the restriction for the numbers to be in consecutive order, the lowest number of operations to achieve 100 is 2 and this can only be achieved with a 3.3.3 configuration (not, e.g. 4.4.1)

  30. nebalia says:

    3 signs, between 5&10 minutes (distracted by an enthralling Antiques Roadshow)

  31. slightly_skeptical says:

    10 seconds, must have got lucky. 3 signs, 4 numbers.

  32. Lumpy Jay says:

    I’ve got two answers with four and five signs in about 5 minutes … albeit using a calculator (my mental arithmetic is not what it once was!). I’m going to have another play later to see if I can get more solutions 😀

  33. Lumpy Jay says:

    I got the impression that you have to use the consecutive numbers 1 – 9 so everyone should be using 9 numbers – or am I wrong?

  34. Derek says:

    Kris: I was just coming to the same conclusion. I thought I was going to have to use a systematic approach to confirm it but I’ll take your word for it instead!

  35. Wolf Martinus says:

    Took me 10 minutes to write my own program. can confirm the solution of the update, 11 solutions, using from 3 to 7 symbols.

  36. Erik R. says:

    I wrote a program too. You can even vary the inputs to test for other values and numbers of digits. Enjoy!

  37. Mark O says:

    First try. 3 signs in about 10 seconds. Think I must have seen it somewhere else since I don’t feel like a mathwiz.

  38. Manuel says:

    3 signs about one minute… it was luck I guess.

  39. Arnab Bose says:

    I confirm there are eleven solns one wtih 3 symbols. Took me about 15 minutes to write the C# code – too long I guess.

    • Arnab Bose says:

      Also if you allow a ‘-‘ sign in the beginning (which you can’t according to the rules) there is only one more.

    • Arnab Bose says:

      If you allow the ‘*’ and ‘/’ operations, then there are 97 ways to get 100.

  40. Stuart says:

    I used a program also, but a much less elegant brute force approach using random numbers to determine whether to put a ‘+’, ‘-‘ or nothing between each digit.

  41. Are brackets allowed?

  42. John says:

    Three symbols in just over 2 minutes

  43. Ken B says:

    Hold on… Let me ask Emma… 🙂

  44. Simon says:

    Yep, 11 solutions, 12 if it can start with -1. A one-line Mathematica program!

    • Joao Pedro Afonso says:

      I want to see that, Monday too. So far, we have here Excel, Python, JavaScript, and my one was VB Script.

    • Kris says:

      I’d like to see it too. If I were going to be a one-liner, it’d be something like http://pastebin.com/17JYq0u2 (although I wouldn’t put it on one line).

    • Simon says:

      Sorry it took me so long to reply: Here’s my one-line (in the front-end) solution:

      Select[Tuples[{“+”, “-“, “”}, 8], ToExpression[str = StringJoin[Riffle[Characters[“123456789”], #]]] == 100 &]

      or one that prints out the solutions in a nicer form:

      Do[If[ToExpression[str = StringJoin[Riffle[Characters[“123456789”], i]]] == 100, Print[“100=”,str]], {i, Tuples[{“+”, “-“, “”}, 8]}]

    • Simon says:

      I should not that this takes about 1/5th of a second to run.
      Also, the solution is very similar to the Pythonic one of Kris.

  45. Savio says:

    10 minutes. One solution with 6 signs and one with 3 signs.

  46. DeepField says:

    Ten minutes. Trial and error. 6 answers so far. The one with three signs was the first one.

  47. Waldo says:

    10 minutes of trial and error. Got it to total 98. Rounded up. Called it a day.

  48. Sarah G says:

    Got one using 4 symbols. I’m proud of myself, don’t play with my illusions of intelligence.

  49. norbert says:

    And the smallest positive integer that cannot be the sum of such a sequence is 160… the next one is 178.

    there are 26 solutions for a sum of 1 or 45. There is only one solution for a sum of 176.

  50. Sofie says:

    Got it! Took about two minutes with a calculator :).

  51. hala says:

    I’ve managed it with four symbols! Feels like Countdown! 🙂

  52. Miguel says:

    ~20m, 3 signs.

  53. Gib says:

    A “C” program got the same results as others for me.

    I’d love to see that 1 line program…

    • Kris says:

      You really went with C? My C version took about 5 times as long to write as my Python version (although it runs about 40 times as fast).

  54. Garrett says:

    lots of formulas in MS Excel. Got the same 11 solutions as the other programmers.

    1 using 7 symbols
    7 using 6
    2 using 4
    1 using 3

  55. Nathan says:

    Got it with three symbols in about one minute, with the help of my trusty calculator.

  56. Jerry says:

    Got an answer in about a minute or so, but it has four plus and minus signs in the answer. I will see if it is possible with fewer.

    • Jerry says:

      Later in the day, I found one with three signs. Skimming the other answers, I have not seen any fewer. Did someone find an answer with two signs that I missed?

    • Anonymous says:

      It looks like Local Government Officer found an answer with two signs. As I understand this problem, you must keep the digits in consecutive order. For example, a solution could contain the number 123 but not the number 321 or 132.

    • Local Government Officer says:

      I’m afraid I didn’t Anonymous – I hadn’t read the problem properly and neglected the constraint to keep the numbers consecutive. See earlier post…

  57. Ian says:

    3 signs in a few seconds plus the time to get a calculator to check I wasn’t mad. There was some logic in the way I did it, thinking about large numbers first and working from right to left.

  58. FormerComposer says:

    about 8 mins, 4 signs

  59. Fraser says:

    Yes!!

    A solution using three signs, and about… half a day!

  60. ejg06 says:

    I think it was a great article

  61. Zach says:

    this is going to take way too much time

  62. ZZCK says:

    Got it in about 3 minutes. 4 numbers, 3 signs. Had no particular technique though.

  63. Shyam says:

    3 signs and 1 min !

  64. 3 minutes 10 seconds. Is that a record ?

  65. Smylers says:

    I’ll avoid posting the answer, but I came up with a very short Perl program for finding it:

    foreach (glob join q[{,-,+}], 1 .. 9)
    {
    say if eval == 100;
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s