spent a lot of time writing this, sorry for bad english, not a native tongue speaker.<p>the purpose of this game is obtaining 100 as result of various math operations following some rules<p>1) every digit from 0 to 9 (0 1 2 3 4 5 6 7 8 9) included must be used once and only once in the expression<p>2) every basic math operation (+ - * /) might be used<p>3) these math functions might be used:
-power: x^y
-square root: sqrt(x)
-cube root: cbrt(x)
-factorial: x! (for example 4! = 4 * 3 * 2 * 1)
-summation from 1 to x: S(x) (for example S(4) = 4+3+2+1)<p>4) parenthesis might be used<p>5) the 0 must be useful to obtain the final result of 100; if the 0 is removed from the expression and the final result doesn't change then the expression is unacceptable (example: expression + 0)<p>7) you can't juxtaposition (put together without operations/functions in between) digits (example: 78 is incorrect)<p>---<p>to value quality of solutions we'll use 3 indexes:
1) Single Occurences (SO): how many different operations/functions are used - the maximum is 9 of course<p>2) Multiple Occurences (MO): how many times operation/functions are used - the minimum should be 13.<p>3) Max Repetition (MR): the number of time the most used operation/function is used - the minimum should be 2.<p>You should maximize SO and minimize MO and MR<p>For the chart the first index that will be valued is SO, then MO and finally MR.<p>---<p>here's an example (it'd be correct if it had 100 as final result):<p>8 * (7+5) + 0 * (3+1) + (2+9+6) * 4
= 8 * 35 + 0 + 17 * 4
= 280 + 68 = 348<p>SO: * and + = 2<p>MO: 3 * and 6 + = 9<p>MR: + is used 6 times = 6<p>---<p>to submit the solution you should calculate your own indexes and final result like i did in the example.
(((7^4)-1)/(2<i>(3+9))+0!(5+sqrt(cbrt(sqrt(...8...))))/(S(S(..6..)))<p>I used an infinite number of square roots, cube roots, and sums. None of the rules require a finite expression :P<p>SO: ^ + - </i> / sqrt cbrt S= 9<p>MO: infinite<p>MR: infinite
You example is illegal. The operation 3+1 can be removed without changing the answer, violating rule 6. You should replace rule 5 and 6 with "Zero can only be used in power (as y) and factorial operations".
Can we assume only operators that return integers are valid? For instance, you can't do sqrt(2) factorial, but you can do sqrt(4) factorial. Kind of tricky when dealing with things like 2 * (3/6) though.