Re: [math-fun] "Ponder This"
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." HansH>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. ------- Yow! In[36]:= tim[Length[PowersRepresentations[31415, 4, 2]]] During evaluation of In[36]:= 1.875057 Out[36]= 829 Anybody feel like speedbumming this in C? --rwg
Maple has a student edition, identical to the professional edition, for $99, must provide proof you're a student. Sage is free. -- Gene
________________________________ From: Bill Gosper <billgosper@gmail.com> To: math-fun@mailman.xmission.com Sent: Tuesday, May 7, 2013 12:16 PM Subject: Re: [math-fun] "Ponder This"
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."
HansH>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. ------- Yow! In[36]:= tim[Length[PowersRepresentations[31415, 4, 2]]]
During evaluation of In[36]:= 1.875057
Out[36]= 829
Anybody feel like speedbumming this in C? --rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
both mathematica and maple have "home use" versions for under $300. you don't have to be a student, but you have to promise that you won't use it for any professional purpose. bob --- Eugene Salamin wrote:
Maple has a student edition, identical to the professional edition, for $99, must provide proof you're a student. Sage is free.
-- Gene
________________________________ From: Bill Gosper <billgosper@gmail.com> To: math-fun@mailman.xmission.com Sent: Tuesday, May 7, 2013 12:16 PM Subject: Re: [math-fun] "Ponder This"
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."
HansH>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. ------- Yow! In[36]:= tim[Length[PowersRepresentations[31415, 4, 2]]]
During evaluation of In[36]:= 1.875057
Out[36]= 829
Anybody feel like speedbumming this in C? --rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
Mathematica has a Student edition, as well. BC -----Original Message----- From: math-fun-bounces@mailman.xmission.com [mailto:math-fun-bounces@mailman.xmission.com] On Behalf Of Eugene Salamin Sent: Tuesday, May 07, 2013 1:32 PM To: math-fun Subject: [EXTERNAL] Re: [math-fun] "Ponder This" Maple has a student edition, identical to the professional edition, for $99, must provide proof you're a student. Sage is free. -- Gene
________________________________ From: Bill Gosper <billgosper@gmail.com> To: math-fun@mailman.xmission.com Sent: Tuesday, May 7, 2013 12:16 PM Subject: Re: [math-fun] "Ponder This"
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."
HansH>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. ------- Yow! In[36]:= tim[Length[PowersRepresentations[31415, 4, 2]]]
During evaluation of In[36]:= 1.875057
Out[36]= 829
Anybody feel like speedbumming this in C? --rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
I was just browsing SAGE a few days ago and wasn't able to find a differential equations solver. I don't care about an explicit formula for the solution, but rather a solver that in particular can create nice graphical output of the trajectories. 2D is essential, but even better if it can do 3D as well, allowing rotations of space for viewing the trajectories. Anyone know of such a thing? (I believe Cornell used to allow free downloading of their dynamical systems software, unfortunately named DSTools, which could do these things. But its website seems dead.) --Dan On 2013-05-08, at 6:31 AM, Cordwell, William R wrote:
Mathematica has a Student edition, as well.
BC
-----Original Message----- From: math-fun-bounces@mailman.xmission.com [mailto:math-fun-bounces@mailman.xmission.com] On Behalf Of Eugene Salamin Sent: Tuesday, May 07, 2013 1:32 PM To: math-fun Subject: [EXTERNAL] Re: [math-fun] "Ponder This"
Maple has a student edition, identical to the professional edition, for $99, must provide proof you're a student. Sage is free.
-- Gene
"DA" == Dan Asimov <dasimov@earthlink.net> writes:
DA> (I believe Cornell used to allow free downloading of their dynamical DA> systems software, unfortunately named DSTools, which could do these DA> things. But its website seems dead.) goog says http://www.math.cornell.edu/~gucken/software.html with working links: http://www.math.cornell.edu/~gucken/dstool_tk.tgz http://www.math.cornell.edu/~gucken/userman.ps.gz http://www.math.cornell.edu/~gucken/PDF/cpoad.pdf http://www.math.cornell.edu/~gucken/Canard_demo.tar.gz The user manual is also in the tgz. -JimC -- James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
Thanks, Jim!!! On 2013-05-08, at 2:30 PM, James Cloos wrote:
"DA" == Dan Asimov <dasimov@earthlink.net> writes:
DA> (I believe Cornell used to allow free downloading of their dynamical DA> systems software, unfortunately named DSTools, which could do these DA> things. But its website seems dead.)
goog says http://www.math.cornell.edu/~gucken/software.html with working links:
http://www.math.cornell.edu/~gucken/dstool_tk.tgz http://www.math.cornell.edu/~gucken/userman.ps.gz http://www.math.cornell.edu/~gucken/PDF/cpoad.pdf http://www.math.cornell.edu/~gucken/Canard_demo.tar.gz
The user manual is also in the tgz.
-JimC -- James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
a C/C++ version might RUN faster. however, if you take into account the amount of time required to PROGRAM it (in arbitrary precision!), the advantage might go to mathematica. plus, PowersRepresentations[n,k,p] is more general: it gives the distinct representations of the integer n as a sum of k non-negative p^th powers. bob --- Bill Gosper wrote:
------- Yow! In[36]:= tim[Length[PowersRepresentations[31415, 4, 2]]]
During evaluation of In[36]:= 1.875057
Out[36]= 829
Anybody feel like speedbumming this in C? --rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
On 5/7/13, Bill Gosper <billgosper@gmail.com> wrote:
------- Yow! In[36]:= tim[Length[PowersRepresentations[31415, 4, 2]]]
During evaluation of In[36]:= 1.875057
Out[36]= 829
Anybody feel like speedbumming this in C? --rwg
Magma running on iMac core-i7 is 10x faster (if I haven't misunderstood above) !! // List unordered decompositions of integer as sum of 4 natural squares function foursquares (n) local w,x,y,z,reslist; reslist := []; for w in [Ceiling(Sqrt(n/4)) .. Floor(Sqrt(n))] do for x in [Ceiling(Sqrt((n - w^2)/3)) .. Min(w, Floor(Sqrt(n - w^2)))] do for y in [Ceiling(Sqrt((n - w^2 - x^2)/2)) .. Min(x, Floor(Sqrt(n - w^2 - x^2)))] do z := Floor(Sqrt(n - w^2 - x^2 - y^2)); // w >= x >= y >= z if w^2 + x^2 + y^2 + z^2 eq n then Append(~reslist, [w,x,y,z]); end if; end for; end for; end for; return reslist; end function;
q := 31415; time squsq := foursquares(q); Time: 0.170 #squsq; 829
WFL
Fred lunnon: Magma running on iMac core-i7 is 10x faster.. q := 31415; time squsq := foursquares(q); Time: 0.170 #squsq; 829 Since Bill Gosper was using his own timing function (as opposed to one of Mathematica's built-in timing functions), I guess it needs to be asked: Is your time absolute or CPU-time only?
participants (8)
-
Bill Gosper -
Cordwell, William R -
Dan Asimov -
Eugene Salamin -
Fred lunnon -
Hans Havermann -
James Cloos -
Robert Baillie