Re: Re: Re: Just another bug in MMA 3.0
- To: mathgroup at smc.vnet.net
- Subject: [mg7587] Re: [mg7532] Re: [mg7491] Re: [mg7431] Just another bug in MMA 3.0
- From: Allan Hayes <hay at haystack.demon.co.uk>
- Date: Thu, 19 Jun 1997 03:13:50 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On 13 Jun 1997
Kai Koehler<koehler at math.uni-bonn.de>
in [mg7532] Re: [mg7491] Re: [mg7431] Just another bug in MMA 3.0
wrote as copied after **************
The original problem [mg7491] was that
Sum[Sum[Log[Log[k+j]],{k,1,n}],{j,1,5}]
gives
5*Sum[Log[Log[k + j]], {k, 1, n}].
The behaviour seems to be explained by the fact that with j set to
1 (j =1) then
Sum[Log[Log[k+j]],{k,1,n}]
does not sum and so is returned unevaluated; similarly with j =
2,3,4,5. Thus we end up adding together 5 copies of it.
The following two examples show up the processm (I change the 5 to
3 to reduce the print out)
(1) If we put n = 2 then the summations are done
Sum[Sum[Log[Log[k+j]],{k,1,2}],{j,1,3}]
Log[Log[2]]+2 Log[Log[3]]+2 Log[Log[4]]+Log[Log[5]]
(2) If we drop the outer Log then again the summations are done
Sum[Sum[Log[k+j],{k,1,n}],{j,1,3}]
-Log[2]-Log[6]+Log[Gamma[2+n]]+Log[Gamma[3+n]]+Log[Gamma[4+n]]
Allan Hayes
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk/training.html
voice:+44 (0)116 2714198
fax: +44 (0)116 2718642
12 Copse Close, Leicester, LE2 4FB, UK
*******
In article <5nfpv3$5qp at smc.vnet.net>, Paulo Mouat
<mouat at mail.telepac.pt> wrote:
> Kai Koehler wrote:
> > Sum[Sum[Log[Log[k+j]],{k,1,n}],{j,1,5}]
> >
> > gives
> >
> > 5*Sum[Log[Log[k + j]], {k, 1, n}].
> If you want to do a multiple sum, the input should read
>
> Sum[Log[Log[k+j]],{k,1,n},{j,1,5}]
>
> What you have typed is a simple sum over k with a function that has an
> unknown j. The j on the outer Sum is a dummy variable, with no
> relation to the one in Log[k+j].
>
> This is not a bug. Mathematica simply interpreted what you did type,
> which is not quite what you intended to do.
If this where true,
Sum[Sum[j,{k,1,n}],{j,1,5}]
should give 5 n j as output. Instead you get 15 n (correctly, IMHO).
Also, in StandardForm, the difference between
Sum[Sum[Log[Log[k+j]],{k,1,n}],{j,1,5}]
and
Sum[Log[Log[k+j]],{k,1,n},{j,1,5}]
is just the insertion of a factor (e.g. 1) between the two sums:
\!\(\+\(j = 1\)\%5 1 \(\+\(k = 1\)\%n Log[Log[k + j]]\)\)
gives a different output then
\!\(\+\(j = 1\)\%5\(\+\(k = 1\)\%n Log[Log[k + j]]\)\)
Similarly,
\!\(\+\(j = 1\)\%5\((\ \+\(k = 1\)\%n Log[Log[k + j]])\)\)
gives a different output then
\!\(\+\(j = 1\)\%5\((\ \+\(k = 1\)\%n Log[Log[k + j]] + 1)\)\)
What you wrote is actually what Michael Trott from Wolfram support mailed
me 2 days ago: It's not a bug, it's a feature. This really worries me: If
they do not even recognize a bug when you show it to them, then what can
you expect them to do?
Kai Koehler