Re: local variables - Module, For loop

*To*: mathgroup at smc.vnet.net*Subject*: [mg113156] Re: local variables - Module, For loop*From*: Bill Rowe <readnews at sbcglobal.net>*Date*: Fri, 15 Oct 2010 13:53:18 -0400 (EDT)

On 10/13/10 at 11:28 PM, sschmitt at physi.uni-heidelberg.de (Sebastian Schmitt) wrote: >I thought Mathematica is smart enough to see that it could also use >the algebraic version even if I supply n in the call to Sum. But it >is probably on purpose this way. The issue is there is not (as far as I know) any a priori method to know whether an algebraic solution for the sum can be found quicker than actually doing the sum. For any given algorithm, it should not be difficult to find a summand that will require fairly time consuming complex manipulations to find the algebraic sum. So, it seems to me, the simplest approach is to do the sum when possible (when the user supplies numeric limits and values) rather than to look for an algebraic solution then do the substitution. Note, I don't know Wolfram actually uses the logic I've outlined here for Sum. But it is clear, there have to be some choices made, quite likely, on a largely heuristic basis.