Re: [math-fun] "Ponder This"
Hans Havermann <gladhobo@teksavvy.com> wrote:
Keith F. Lynch wrote:
It tried all 1,679,616 (6^8) possible ways of sticking zero or more plus signs, minus signs, times signs, divide signs, and decimal points into PONDER=THIS
? thus arbitrarily excluding, I think, a decimal point preceding a given string of digits.
Right. No prefix plus, minus, or decimal point, and no parentheses. In fact, each equation alternated between digits and operations, to make my parser run faster. Concatenation -- creating multi-digit numbers out of digits -- used the comma (suppressed on printing) so that I could loop through consecutive ASCII characters: * + , - . / A typical string was: 3,8*0.1,2,5=7/4-6+9 which meant 38*0.125=7/4-6+9
The unique solution to the meta-problem is a single division sign and a single minus sign. Insert those into PONDER=THIS so that it has a unique solution.
A quick Mathematica hack suggests PON-DER=TH/IS meets the requirement.
Correct. I've heard good things about Mathematica. Too bad it's so expensive. I've been doing everything in C. I'm curious whether Mathematica is reasonably fast. In C, it took me about a month of CPU time to solve the meta-meta-problem, i.e. to find that a single division sign and a single minus sign was a solution. (I got lucky in that it's also the *only* solution.) I'm curious how long it would take Mathematica to find that. And what the code would look like. I only solved the six-four problem: ______=____. I'm curious if there are similar solutions with the equal sign elsewhere. Maybe I should get one or two dozen Raspberry Pis and split the problem between them. Of course it's easy to prove that there can be no *global* unique solution, i.e. if the equal sign can go anywhere. It can't be the case that something like "assemble -/0123456789= into a correct equation" has a single solution. Can you see why?
I'm curious whether Mathematica is reasonably fast.
In my experience it's acceptably fast for most applications. It's generally not as fast as specialized software within its field -- gp is usually faster at number theory, GAP at algebra, yafu at factoring, etc. It does have nice near-linear code for trig evaluations, making it faster (in my experience) than other software I'm familiar with for high-precision transcendental work (> 20,000 digits, say). Charles Greathouse Analyst/Programmer Case Western Reserve University On Mon, May 6, 2013 at 10:11 PM, Keith F. Lynch <kfl@keithlynch.net> wrote:
Hans Havermann <gladhobo@teksavvy.com> wrote:
Keith F. Lynch wrote:
It tried all 1,679,616 (6^8) possible ways of sticking zero or more plus signs, minus signs, times signs, divide signs, and decimal points into PONDER=THIS
? thus arbitrarily excluding, I think, a decimal point preceding a given string of digits.
Right. No prefix plus, minus, or decimal point, and no parentheses. In fact, each equation alternated between digits and operations, to make my parser run faster. Concatenation -- creating multi-digit numbers out of digits -- used the comma (suppressed on printing) so that I could loop through consecutive ASCII characters: * + , - . /
A typical string was:
3,8*0.1,2,5=7/4-6+9
which meant
38*0.125=7/4-6+9
The unique solution to the meta-problem is a single division sign and a single minus sign. Insert those into PONDER=THIS so that it has a unique solution.
A quick Mathematica hack suggests PON-DER=TH/IS meets the requirement.
Correct. I've heard good things about Mathematica. Too bad it's so expensive. I've been doing everything in C.
I'm curious whether Mathematica is reasonably fast. In C, it took me about a month of CPU time to solve the meta-meta-problem, i.e. to find that a single division sign and a single minus sign was a solution. (I got lucky in that it's also the *only* solution.) I'm curious how long it would take Mathematica to find that. And what the code would look like.
I only solved the six-four problem: ______=____. I'm curious if there are similar solutions with the equal sign elsewhere. Maybe I should get one or two dozen Raspberry Pis and split the problem between them.
Of course it's easy to prove that there can be no *global* unique solution, i.e. if the equal sign can go anywhere. It can't be the case that something like "assemble -/0123456789= into a correct equation" has a single solution. Can you see why?
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
Keith F. Lynch: "I've heard good things about Mathematica. Too bad it's so expensive. I've been doing everything in C. I'm curious whether Mathematica is reasonably fast." I think Mathematica is a wonderful toy for the recreationalist (especially, with ready-made "black box" procedures for all manner of mathematical situations. For example, if I wanted to duplicate Bill Gosper's "representions of 31415 as sums of four squares" I'd use something like PowersRepresentations[31415,4,2]] and it might even be somewhat faster than his from-scratch procedure but, in general, I'll guess (based on C programmers trouncing my Mathematica-produced output in the past) that you can do things faster in C.
participants (3)
-
Charles Greathouse -
Hans Havermann -
Keith F. Lynch