Could someone on the list open a bug report for me,
because I don't have a sourceforge account.
Thanks
Andre Maute
On 09/09/2011 01:25 PM, Andrej Vodopivec wrote:
> This is a bug in nusum.
>
> (%i2) nusum(F(d,1,1,1,1,b2,l2), l2, 0, b2);
> (%o2) 0
>
> Basically, what nusum does is
>
> (%i3) load(zeilberger)$
> (%i4) ad: AntiDifference(F(d,1,1,1,1,b2,l2), l2)$
> (%i5) subst(l2=b2+1, ad) - subst(l2=0, ad)$
> factorial: factorial of negative integer -1 not defined.
> -- an error. To debug this try: debugmode(true);
>
> The error comes from the upper bound.
>
> (%i6) subst(l2=b2+1, ad);
> factorial: factorial of negative integer -1 not defined.
> -- an error. To debug this try: debugmode(true);
>
> My guess is that nusum does not handle this error and just returns the
> substitution of the lower bound
>
> (%i7) subst(l2=0, ad);
> (%o7) 0
>
> You could disable the nusum computation with use_gosper=false, but
> then simplify_sum fails to compute the sum:
>
> (%i12) simplify_sum(%), use_gosper=false;
> Is b2-1 positive, negative, or zero? pos;
> Is d-2 positive, negative, or zero? pos;
> Is d-1 positive, negative, or zero? pos;
> Is d+b2-1 positive, negative, or zero? pos;
> expt: undefined: 0 to a negative exponent.
> (%o12) sum(((-1)^l2*(l2+d-1)!*(l2+d+b2-2)!)/((b2-l2)!*l2!*(l2+d-2)!*(l2+d+1)!),l2,0,b2)
>
> I don't have time to investigate this further. Maybe you can open a bugreport.
>
> ---
> Andrej
>
> http://gplus.to/andrejv
>
>
>
> On Wed, Aug 31, 2011 at 2:58 PM, andre maute<andre.maute at gmx.de> wrote:
>> This is a repost,
>> to attract someone's attention, because i got no response.
>>
>> Andre
>>
>> On 08/24/2011 03:57 PM, andre maute wrote:
>>> Hi,
>>>
>>> I have the following test, with a sum depending on b2.
>>> For general b2 simplify_sum gives an incorrect value.
>>>
>>> Andre
>>>
>>> ------- test-simplify_sum-1.max -----------
>>>
>>> display2d : false;
>>>
>>> F(d,a1,k1,a2,k2,b2,l2) := block(
>>>
>>> [res:1],
>>>
>>> res : res/(b2-l2)!,
>>> res : res/l2!,
>>> res : res*(-1)^l2,
>>>
>>> res : res*(b2+l2+d-2)!,
>>> res : res/(l2+d-2)!,
>>>
>>> res : res*(k2+l2+d-2)!,
>>> res : res/(k2+l2+d-1+k1)!,
>>>
>>> return(res)
>>>
>>> );
>>>
>>> load("simplify_sum");
>>>
>>> s:sum(F(d,1,1,1,1,b2,l2),l2,0,b2);
>>> h : simplify_sum(s);
>>> h : factor(minfactorial(h));
>>>
>>> s:sum(F(d,1,1,1,1,2,l2),l2,0,2);
>>> h : simplify_sum(s);
>>> h : factor(minfactorial(h));
>>>
>>> ------- test-simplify_sum-1.max -----------
>>>
>>> ------- test-simplify_sum-1.txt -----------
>>>
>>> Maxima 5.19.2 http://maxima.sourceforge.net
>>> Using Lisp SBCL 1.0.40-1.fc14
>>> Distributed under the GNU Public License. See the file COPYING.
>>> Dedicated to the memory of William Schelter.
>>> The function bug_report() provides bug reporting information.
>>> (%i1) batch(test-simplify_sum-1.max)
>>>
>>> batching /home/user/progs/test-simplify_sum-1.max
>>> (%i2) display2d : false
>>> (%o2) false
>>> (%i3) F(d,a1,k1,a2,k2,b2,l2):=block([res:1],res:res/(b2-l2)!,res:res/l2!,
>>> res:res*(-1)^l2,res:res*(-2+d+l2+b2)!,res:res/(-2+d+l2)!,
>>> res:res*(-2+d+l2+k2)!,res:res/(k1-1+d+l2+k2)!,return(res))
>>> (%o3) F(d,a1,k1,a2,k2,b2,l2):=block([res:1],res:res/(b2-l2)!,res:res/l2!,
>>> res:res*(-1)^l2,res:res*(-2+d+l2+b2)!,res:res/(-2+d+l2)!,
>>> res:res*(-2+d+l2+k2)!,res:res/(k1-1+d+l2+k2)!,return(res))
>>> (%i4) load("simplify_sum")
>>> (%o4)
>>> "/home/user/opt/maxima/share/maxima/5.19.2/share/contrib/solve_rec/simplify_sum.mac"
>>> (%i5) s:sum(F(d,1,1,1,1,b2,l2),l2,0,b2)
>>> (%o5)
>>> 'sum((-1)^l2*(l2+d-1)!*(l2+d+b2-2)!/((b2-l2)!*l2!*(l2+d-2)!*(l2+d+1)!),
>>> l2,0,b2)
>>> (%i6) h:simplify_sum(s)
>>> (%o6) 0
>>> (%i7) h:factor(minfactorial(h))
>>> (%o7) 0
>>> (%i8) s:sum(F(d,1,1,1,1,2,l2),l2,0,2)
>>> (%o8) (d+1)!*(d+2)!/(2*d!*(d+3)!)-d!*(d+1)!/((d-1)!*(d+2)!)
>>> +(d-1)!*d!/(2*(d-2)!*(d+1)!)
>>> (%i9) h:simplify_sum(s)
>>> (%o9) (d+1)!*(d+2)!/(2*d!*(d+3)!)-d!*(d+1)!/((d-1)!*(d+2)!)
>>> +(d-1)!*d!/(2*(d-2)!*(d+1)!)
>>> (%i10) h:factor(minfactorial(h))
>>> (%o10) -2/((d+1)*(d+2)*(d+3))
>>> (%o10) "/home/user/progs/test-simplify_sum-1.max"
>>>
>>> ------- test-simplify_sum-1.txt -----------
>>> _______________________________________________
>>> Maxima mailing list
>>> Maxima at math.utexas.edu
>>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>