Skip to content

(simplify_)sum is problematic with non-atomic arguments. #4178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rtoy opened this issue Jul 10, 2024 · 1 comment
Open

(simplify_)sum is problematic with non-atomic arguments. #4178

rtoy opened this issue Jul 10, 2024 · 1 comment

Comments

@rtoy
Copy link
Owner

rtoy commented Jul 10, 2024

Imported from SourceForge on 2024-07-09 19:33:04
Created by charpent on 2021-05-25 22:36:38
Original: https://sourceforge.net/p/maxima/bugs/3788


This one (initially reported as Sage ticket 31844) may or may not be news to you ;

(%i1) display2d:false;

(%o1) false
(%i2) load("simplify_sum");

(%o2) "/usr/local/sage-9/local/share/maxima/5.44.0/share/solve_rec/simplify_sum.mac"
(%i3) simplify_sum(sum(binomial(n-1,k-1)*t^(k-1),k,1,n));

(%o3) 0

Absurdly false. But converting the sum in order to work on atomic arguments alleviates the problem :

(%i4) subst([nj = n-j], simplify_sum(subst([n = nj+j],changevar(sum(binomial(n - j, k - j)*t^(k - j), k, j, n), kj = k - j, kj, k))));

(%o4) (t+1)^(n-j)

The same bug also strikes when substituting integers to j.

HTH,

@rtoy rtoy added the bugs label Jul 10, 2024
@rtoy
Copy link
Owner Author

rtoy commented Jul 10, 2024

Imported from SourceForge on 2024-07-09 19:33:05
Created by davewittemorris on 2021-05-27 01:06:34
Original: https://sourceforge.net/p/maxima/bugs/3788/#af48


I think the verbose output that is copied below shows that the problem is a wrong initial condition for Zeilberger's method. Maxima says the initial condition is sm[0] = 0, but I think this needs to be sm[1] = 1, because the recurrence relation sm[n]*(t+1) - sm[n+1] = 0 is not valid for n = 0.

(%i15) verbose_level: 100;
(verbose_level) 100

(%i16) load("simplify_sum");
(%o16)
/Applications/Maxima.app/Contents/Resources/opt/share/maxima/5.43.0/share/solve_rec/simplify_sum.mac

(%i17) simplify_sum(sum(t^(k-1)*binomial(n-1, k-1), k, 1, n));
Trying with simpsum=true ...
sum with simpsum=true returns: sum(binomial(n-1,k-1)*t^(k-1),k,1,n)
sum_by_parts returns sum(binomial(n-1,k-1)*t^(k-1),k,1,n)
Trying with integral representation.
Trying with Gosper ...
Trying with extended Gosper ...
Trying with Zeilberger ...
Summand: binomial(n-1,g5125)*t^g5125
Changed to: ((n-1)!*t^g5125)/(g5125!*(n-g5125-1)!)
Found support: [0,n-1]
Zeilberger returns: [[g5125/(n-g5125),[t+1,-1]]]
Degree of recurrence: 1
Zeilberger recurrence: sm[n]*(t+1)-sm[n+1]=0
Initial conditions: [sm[0]=0]
Solving recurrence returns: sm[n]=0
Simplified solution: 0
Zeilberger method returns: 0

(%o17) 0

@rtoy rtoy added this to the None milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant