## [Maxima-bugs] [ maxima-Bugs-3202926 ] simplify_sum gives wrong answer for sum related to poisson..

 [Maxima-bugs] [ maxima-Bugs-3202926 ] simplify_sum gives wrong answer for sum related to poisson.. From: SourceForge.net - 2011-04-24 09:03:01 ```Bugs item #3202926, was opened at 2011-03-08 13:21 Message generated for change (Settings changed) made by andrejv You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Simplification Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: PAngArd (pangard) >Assigned to: Andrej Vodopivec (andrejv) Summary: simplify_sum gives wrong answer for sum related to poisson.. Initial Comment: The following should give the variance of a poisson RV with parameter lambda=4 (it should be 4) (%i98) simplify_sum(sum(%e^-4*(k-4)^2*4^k/k!, k, 0, inf)); - 4 284 %e (%o98) --------- 3 What's amazing is that if (k-4)^2 is split, then the individual results are all correct: (%i99) simplify_sum(sum(%e^-4*k^2*4^k/k!, k, 0, inf)); (%o99) 20 (%i100) simplify_sum(sum(%e^-4*k*4^k/k!, k, 0, inf)); (%o100) 4 (%i101) simplify_sum(sum(%e^-4*4^k/k!, k, 0, inf)); (%o101) 1 And the completely symbolic sum is also correct: (%i102) simplify_sum(sum(%e^-l*(k-l)^2*l^k/k!, k, 0, inf)); (%o102) l Some similar sum produce correct results: (%i106) simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); - 4 (%o106) 8 %e while others do not: (%i104) simplify_sum(sum(%e^-4*(k-5)^2*4^k/k!, k, 0, inf)); - 4 643 %e (%o104) --------- 3 I couldn't find a pattern! ---------------------------------------------------------------------- Comment By: PAngArd (pangard) Date: 2011-03-08 13:27 Message: Ooops, the report above has some issues: * output is not formatted, the wrong answer for the first command is: (284/3)*%e^(-4) * I claimed that the result of simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); was correct, but it is not. The correct result is 8, not 8%e^(-4). However, the random behaviour persists: A correct result: (%i110) simplify_sum(sum(%e^-4*(k^2-15)*4^k/k!, k, 0, inf)); (%o110) 5 An incorrect result: (%i109) simplify_sum(sum(%e^-4*(k^2-16)*4^k/k!, k, 0, inf)); (740/3)%e^(-4) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 ```

 [Maxima-bugs] [ maxima-Bugs-3202926 ] simplify_sum gives wrong answer for sum related to poisson.. From: SourceForge.net - 2011-03-08 12:21:35 ```Bugs item #3202926, was opened at 2011-03-08 13:21 Message generated for change (Tracker Item Submitted) made by pangard You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Simplification Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: PAngArd (pangard) Assigned to: Nobody/Anonymous (nobody) Summary: simplify_sum gives wrong answer for sum related to poisson.. Initial Comment: The following should give the variance of a poisson RV with parameter lambda=4 (it should be 4) (%i98) simplify_sum(sum(%e^-4*(k-4)^2*4^k/k!, k, 0, inf)); - 4 284 %e (%o98) --------- 3 What's amazing is that if (k-4)^2 is split, then the individual results are all correct: (%i99) simplify_sum(sum(%e^-4*k^2*4^k/k!, k, 0, inf)); (%o99) 20 (%i100) simplify_sum(sum(%e^-4*k*4^k/k!, k, 0, inf)); (%o100) 4 (%i101) simplify_sum(sum(%e^-4*4^k/k!, k, 0, inf)); (%o101) 1 And the completely symbolic sum is also correct: (%i102) simplify_sum(sum(%e^-l*(k-l)^2*l^k/k!, k, 0, inf)); (%o102) l Some similar sum produce correct results: (%i106) simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); - 4 (%o106) 8 %e while others do not: (%i104) simplify_sum(sum(%e^-4*(k-5)^2*4^k/k!, k, 0, inf)); - 4 643 %e (%o104) --------- 3 I couldn't find a pattern! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-3202926 ] simplify_sum gives wrong answer for sum related to poisson.. From: SourceForge.net - 2011-03-08 12:27:40 ```Bugs item #3202926, was opened at 2011-03-08 13:21 Message generated for change (Comment added) made by pangard You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Simplification Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: PAngArd (pangard) Assigned to: Nobody/Anonymous (nobody) Summary: simplify_sum gives wrong answer for sum related to poisson.. Initial Comment: The following should give the variance of a poisson RV with parameter lambda=4 (it should be 4) (%i98) simplify_sum(sum(%e^-4*(k-4)^2*4^k/k!, k, 0, inf)); - 4 284 %e (%o98) --------- 3 What's amazing is that if (k-4)^2 is split, then the individual results are all correct: (%i99) simplify_sum(sum(%e^-4*k^2*4^k/k!, k, 0, inf)); (%o99) 20 (%i100) simplify_sum(sum(%e^-4*k*4^k/k!, k, 0, inf)); (%o100) 4 (%i101) simplify_sum(sum(%e^-4*4^k/k!, k, 0, inf)); (%o101) 1 And the completely symbolic sum is also correct: (%i102) simplify_sum(sum(%e^-l*(k-l)^2*l^k/k!, k, 0, inf)); (%o102) l Some similar sum produce correct results: (%i106) simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); - 4 (%o106) 8 %e while others do not: (%i104) simplify_sum(sum(%e^-4*(k-5)^2*4^k/k!, k, 0, inf)); - 4 643 %e (%o104) --------- 3 I couldn't find a pattern! ---------------------------------------------------------------------- >Comment By: PAngArd (pangard) Date: 2011-03-08 13:27 Message: Ooops, the report above has some issues: * output is not formatted, the wrong answer for the first command is: (284/3)*%e^(-4) * I claimed that the result of simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); was correct, but it is not. The correct result is 8, not 8%e^(-4). However, the random behaviour persists: A correct result: (%i110) simplify_sum(sum(%e^-4*(k^2-15)*4^k/k!, k, 0, inf)); (%o110) 5 An incorrect result: (%i109) simplify_sum(sum(%e^-4*(k^2-16)*4^k/k!, k, 0, inf)); (740/3)%e^(-4) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-3202926 ] simplify_sum gives wrong answer for sum related to poisson.. From: SourceForge.net - 2011-04-24 09:03:01 ```Bugs item #3202926, was opened at 2011-03-08 13:21 Message generated for change (Settings changed) made by andrejv You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Simplification Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: PAngArd (pangard) >Assigned to: Andrej Vodopivec (andrejv) Summary: simplify_sum gives wrong answer for sum related to poisson.. Initial Comment: The following should give the variance of a poisson RV with parameter lambda=4 (it should be 4) (%i98) simplify_sum(sum(%e^-4*(k-4)^2*4^k/k!, k, 0, inf)); - 4 284 %e (%o98) --------- 3 What's amazing is that if (k-4)^2 is split, then the individual results are all correct: (%i99) simplify_sum(sum(%e^-4*k^2*4^k/k!, k, 0, inf)); (%o99) 20 (%i100) simplify_sum(sum(%e^-4*k*4^k/k!, k, 0, inf)); (%o100) 4 (%i101) simplify_sum(sum(%e^-4*4^k/k!, k, 0, inf)); (%o101) 1 And the completely symbolic sum is also correct: (%i102) simplify_sum(sum(%e^-l*(k-l)^2*l^k/k!, k, 0, inf)); (%o102) l Some similar sum produce correct results: (%i106) simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); - 4 (%o106) 8 %e while others do not: (%i104) simplify_sum(sum(%e^-4*(k-5)^2*4^k/k!, k, 0, inf)); - 4 643 %e (%o104) --------- 3 I couldn't find a pattern! ---------------------------------------------------------------------- Comment By: PAngArd (pangard) Date: 2011-03-08 13:27 Message: Ooops, the report above has some issues: * output is not formatted, the wrong answer for the first command is: (284/3)*%e^(-4) * I claimed that the result of simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); was correct, but it is not. The correct result is 8, not 8%e^(-4). However, the random behaviour persists: A correct result: (%i110) simplify_sum(sum(%e^-4*(k^2-15)*4^k/k!, k, 0, inf)); (%o110) 5 An incorrect result: (%i109) simplify_sum(sum(%e^-4*(k^2-16)*4^k/k!, k, 0, inf)); (740/3)%e^(-4) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-3202926 ] simplify_sum gives wrong answer for sum related to poisson.. From: SourceForge.net - 2011-04-28 06:21:11 ```Bugs item #3202926, was opened at 2011-03-08 13:21 Message generated for change (Comment added) made by andrejv You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Simplification Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: PAngArd (pangard) Assigned to: Andrej Vodopivec (andrejv) Summary: simplify_sum gives wrong answer for sum related to poisson.. Initial Comment: The following should give the variance of a poisson RV with parameter lambda=4 (it should be 4) (%i98) simplify_sum(sum(%e^-4*(k-4)^2*4^k/k!, k, 0, inf)); - 4 284 %e (%o98) --------- 3 What's amazing is that if (k-4)^2 is split, then the individual results are all correct: (%i99) simplify_sum(sum(%e^-4*k^2*4^k/k!, k, 0, inf)); (%o99) 20 (%i100) simplify_sum(sum(%e^-4*k*4^k/k!, k, 0, inf)); (%o100) 4 (%i101) simplify_sum(sum(%e^-4*4^k/k!, k, 0, inf)); (%o101) 1 And the completely symbolic sum is also correct: (%i102) simplify_sum(sum(%e^-l*(k-l)^2*l^k/k!, k, 0, inf)); (%o102) l Some similar sum produce correct results: (%i106) simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); - 4 (%o106) 8 %e while others do not: (%i104) simplify_sum(sum(%e^-4*(k-5)^2*4^k/k!, k, 0, inf)); - 4 643 %e (%o104) --------- 3 I couldn't find a pattern! ---------------------------------------------------------------------- >Comment By: Andrej Vodopivec (andrejv) Date: 2011-04-28 08:21 Message: Fixed in git: (%i7) simplify_sum(sum(%e^-4*(k-4)^2*4^k/k!, k, 0, inf)); (%o7) %e^-4*((12*%e^4-284)/3+284/3) (%i8) ratsimp(%); (%o8) 4 (%i13) simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); (%o13) %e^-4*(8*%e^2*sqrt(%pi)*bessel_i(3/2,2)+6*%e^4-6) (%i14) ratsimp(exponentialize(%)), besselexpand=true; (%o14) 8 (%i15) simplify_sum(sum(%e^-4*(k^2-16)*4^k/k!, k, 0, inf)); (%o15) %e^-4*((12*%e^4+740)/3-740/3) (%i16) ratsimp(%); (%o16) 4 ---------------------------------------------------------------------- Comment By: PAngArd (pangard) Date: 2011-03-08 13:27 Message: Ooops, the report above has some issues: * output is not formatted, the wrong answer for the first command is: (284/3)*%e^(-4) * I claimed that the result of simplify_sum(sum(%e^-4*(k-2)^2*4^k/k!, k, 0, inf)); was correct, but it is not. The correct result is 8, not 8%e^(-4). However, the random behaviour persists: A correct result: (%i110) simplify_sum(sum(%e^-4*(k^2-15)*4^k/k!, k, 0, inf)); (%o110) 5 An incorrect result: (%i109) simplify_sum(sum(%e^-4*(k^2-16)*4^k/k!, k, 0, inf)); (740/3)%e^(-4) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3202926&group_id=4933 ```