Re: Question about evaluation with Sum
- To: mathgroup at smc.vnet.net
- Subject: [mg19602] Re: [mg19587] Question about evaluation with Sum
- From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
- Date: Sat, 4 Sep 1999 21:09:12 -0400
- Sender: owner-wri-mathgroup at wolfram.com
This has already been discussed here and is undoubtedly caused a bug in Sum (whatever anyone might tell you about the role of Attributes here). The best way to see it is (in my opinion) by contrasting it with the behaviour of Product, which has exactly the same Attributes as Sum: In[1]:= p=k Out[1]= k In[2]:= Product[p,{k, 1, n}] Out[2]= n! In[3]:= Product[Evaluate[p],{k, 1, n}] Out[3]= n! (I hope that wri does not decide that there is a bug in Product!) -- Andrzej Kozlowski Toyama International University JAPAN http://sigma.tuins.ac.jp http://eri2.tuins.ac.jp ---------- >From: CORNIL Jack Michel <jmcornil at club-internet.fr> To: mathgroup at smc.vnet.net >To: mathgroup at smc.vnet.net >Subject: [mg19602] [mg19587] Question about evaluation with Sum >Date: Sat, Sep 4, 1999, 2:34 PM > > Hello, > > > I have a big problem of evaluation with the function Sum. > > With the very simple following example, > > p=k > > Sum[p,{k, 1, n}] > > p k > > Sum[Evaluate[p], {k, 1, n}] > > 1 > - n (1+n) > 2 > > Sum[p,{k, 1, 5}] > > 15 > > how can I explain my students that > > in the first case p is left unevaluate and it needs Evaluate, > > in the last case p is evaluate correctly ? > > I do not understand how the "Attributes" of Sum can explain this. > > > Thank You in advance > > > Jack Michel CORNIL > > Versailles FRANCE > >