New solver

Now I can finally rest in peace.


It’s uber fast as I pre-computed all the solutions and store them in a long string. So instead of let a CGI do it in real time. I let a piece of java-script code search for the solutions in the said long string.

2 thoughts on “New solver

  1. Hi, I wrote a c# program utilizing your theory: (.net 4.0)
    Your result is concise but I still have a question: it seems that you turn ()/2/2 to ()/(2+2), as case 2 2 8 12, but (2+2) and (2*2) are still considered distinct solutions, as case 1 2 2 8.
    Actually converting /2/2 to /(2+2) is not mentioned in your theory part. I found it while doing regression test of my program against your result, so shall we consider any (2*2) is equivalent to (2+2) as a special rule like a b 1 1?
    BTW, I tried to use compile time evaluation to speed up the program, but unfortunately hit C#’s own limitation…D lang is capable, but I’m too lazy to hand-write a UI…

  2. That’s very good. I think I could add a special rule for 2*2 and 2 +2. But I was 1, too lazy and 2, 2 + 2 and 2 *2 are not trivially equivalent as those special rules for 1 and 0.

    Now what happens to /(2+2) and /2/2, that’s a BUG! I think in my code I just simply remove any solutions with /a/b in it, at the time I thought all /a/b has a=1 and b=1, and if you check the rules for 1, they should all be removed.

    Thanks to your comment, we know that there is one solution with /2/2 and should not be removed. And I believe it’s the only solution with /2/2 in it.

    So, thanks! I will update my solutions to reflect this.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>