3
$\begingroup$

Given the sequence 123456789:

You can insert three operations ($+$,$-$,$\times$,$/$) into this sequence to make the equation = 100.

My question is: is there a way to solve this without brute force?

(I tried to represent it as a graph but I'm unsure where to go from there.)

  • 3
    With brute force: $123-45-67+89 = 100$ and no other solutions.2012-01-16
  • 1
    Right, but my question isn't so much what is the solution as much as what is the process.2012-01-16
  • 0
    It might be a good starting point. Are we allowed to use parantheses or should we just go with standard order of operations?2012-01-16
  • 0
    Standard order will probably be easier so that's completely fine.2012-01-16
  • 0
    Reasonable heuristics will help. You will have at least one three digit number and unless you have a second the others will be two digits. 123 is the only three digit number that is close, which forces the rest to be 45, 67, 89. Then divide and multiply are out. You need two minus and one plus to have any hope. Now brute force the three possibilities.2012-01-17
  • 0
    @Ross, are you assuming that only plus and minus signs are going to be used? Is it that easy to rule out things like $1234/56+78/9$?2012-01-17
  • 0
    @GerryMyerson: divisibility is hard-you need the result to be an integer or to get rid of the fraction. That was the sense of "heuristics"-I don't claim a proof, but you know it's true.2012-01-17
  • 0
    $(1 \times 23) - 4+5-6-7+89 = 100$2012-04-20
  • 0
    I've got another $(1-2+3-4+5)\times6 -7+89$2012-04-20
  • 0
    As usual with this kind of question, details are missing. Are parenthesis allowed ? How does operator precedence work ? Are inexact divisions allowed ? Are intermediate fractional values allowed ?2015-03-19

1 Answers 1

11

The strategy I would use is the following:

Goal is to get $100$ as sum. Among the digits $123456789$, pick and choose the sum close to $100$, such as $89$. Therefore I would attempt to get a value of $11$ from $1234567$ using different combinations.

When you start working on a smaller sum now (sort of like divide and conquer), you may get the desired result. (Of course there is no specific algorithm).

In order to get $11$, I have

$$(1\times 23)-4+5-6-7 = 11$$

$$(1-2+3-4+5)\times 6 -7= 11$$

$$123-45-67 = 11$$

Therefore

$$(1\times 23)-4+5-6-7+89 = 100$$

$$(1-2+3-4+5)\times 6 - 7+89=100$$

$$123-45-67+89=100$$

${\bf{Adding}}$ ${\bf{more}}$ to it: If we look at $78+9 = 87$ and instead of $89$, we seek the remaining $13$ to be derived from $123456$, and one way to get that is

$$6+5+4-3+2-1=13$$

Therefore

$$78+9+6+5+4-3+2-1=100$$