Bug 241047 - Problems with Summations
Problems with Summations
 Status: RESOLVED FIXED None kalgebra Applications general (show other bugs) unspecified Compiled Sources Linux NOR normal --- Aleix Pol

 Reported: 2010-06-07 22:30 UTC by Adria 2010-12-14 05:00 UTC (History) 0 users

Attachments
KAlgebra script with the summation (260 bytes, text/plain)
 Adria 2010-06-07 22:30:33 UTC ```Created attachment 47792 [details] KAlgebra script with the summation Version: unspecified (using KDE 4.4.3) OS: Linux There are some problems with summations: - Sometimes I can't define them (see Steps to reproduce) - The results from summations are not correct Thanks in advance Reproducible: Always Steps to Reproduce: Type this into KAlgebra console: comb:=(n, i)->factorial(n)/(factorial(i)*factorial(n-i)) p:=10^-2 pu:=n->sum(comb(n,i)*p^(n-i)*(1-p)^i:i=(floor((n-1)/2))..n) -> Can't define pu:=n->sum(comb(n,i)*p^(n-i)*(1-p)^i:i=0..(floor((n-1)/2))) -> OK Actual Results: If I type: pu(5) I get: 25.1510550449 Expected Results: The expected result is: pu5:=comb(5,0)*p^5*(1-p)*0 + comb(5,1)*p^4*(1-p)*1 + comb(5,2)*p^3*(1-p)*3 2.97495e-05 OS: Linux (x86_64) release 2.6.33-ARCH Compiler: gcc``` Aleix Pol 2010-12-14 05:00:35 UTC ```SVN commit 1206274 by apol: Remove some wrong stack depth calculation. Fixes the following bug, together with the last commit. (at last!) BUG: 241047 M +7 -9 analyzer.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1206274```