Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • $\begingroup$ By my back of the envelope calculation, you'd be looking at over 600 million combinations. This would take about 10 hours to run on my computer. Maybe I should try 1,2,3,4 = 10 or something. $\endgroup$ Commented Nov 22, 2012 at 4:09
  • $\begingroup$ Strictly speaking, the "easy" case still needs a solution:) In your example, you are dropping the first operator in every 8-tuple. That is, your method is always concatenating 1 and 2, but concatenation is not allowed for other other digit. So, solutions like 1*2*3 - 4*5 + 6*7 + 8*9 (which violate the de facto restriction to treat 1 and 2 as 12) are missed. Did you intend to allow concatenation of digits as an allowed operation? (Like the question btw .. +1) $\endgroup$ Commented Nov 22, 2012 at 5:55
  • $\begingroup$ @kguler Oh! That's a mistake of the code, let me correct it. $\endgroup$ Commented Nov 22, 2012 at 6:04
  • $\begingroup$ any method that goes down branches will fail for a long enough string of digits. I have stochastic code to try to obtain the minima in much larger systems (using a monte carlo approach); is that interesting or do you only want exhaustive search techniques? $\endgroup$ Commented Nov 22, 2012 at 19:47
  • $\begingroup$ @acl Well, this question is mainly for fun, no deeper intention lies behind it, so, yes, I just want do find all the solutions :). $\endgroup$ Commented Nov 23, 2012 at 10:43