Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.)

share|improve this question
3  
With brute force: $123-45-67+89 = 100$ and no other solutions. –  Mikko Korhonen Jan 16 '12 at 20:08
1  
Right, but my question isn't so much what is the solution as much as what is the process. –  sdasdadas Jan 16 '12 at 20:11
    
It might be a good starting point. Are we allowed to use parantheses or should we just go with standard order of operations? –  Mikko Korhonen Jan 16 '12 at 22:06
    
Standard order will probably be easier so that's completely fine. –  sdasdadas Jan 16 '12 at 23:04
    
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. –  Ross Millikan Jan 17 '12 at 3:09

1 Answer 1

up vote 10 down vote accepted

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$$

share|improve this answer

protected by Asaf Karagila May 29 at 11:03

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.