[Tutor] getting error while solving a series that estimates the value of pi

2011-07-18 Thread surya k
Hi, The problem is to estimate the value of pi using the following series. *1 / pi = (( 2 * sqrt(2) )/ 9801 ) * SIGMA of k[ (4k)! (1103 + 26390*k) / (k!^ 4 ) * 396^(4k) ]* *where k is [0, infinity)* * Problem is located at : ThinkPython Book, www.thinkpython.org *Pg 89, Exercise 7.5, Think

Re: [Tutor] getting error while solving a series that estimates the value of pi

2011-07-18 Thread Andre Engels
On Mon, Jul 18, 2011 at 6:10 PM, surya k sur...@live.com wrote: Hi, The problem is to estimate the value of pi using the following series. *1 / pi = (( 2 * sqrt(2) )/ 9801 ) * SIGMA of k[ (4k)! (1103 + 26390*k) / (k!^ 4 ) * 396^(4k) ]* *where k is [0, infinity)* * Problem is located at

Re: [Tutor] getting error while solving a series that estimates the value of pi

2011-07-18 Thread Alan Gauld
surya k wrote: *k = 0* *tot = 0* *temp1 = 0* *while k = 0 and temp1 == 0 :* * a = ( 2 * math.sqrt(2) ) / 9801 # first term before sigma * * nu = fact (4*k) * (1103 + (26390*k) ) # numerator of series* * de = pow( fact(k), 4 ) * pow ( 396, 4*k ) # denominator of series* * *

Re: [Tutor] getting error while solving a series that estimates the value of pi

2011-07-18 Thread James Reynolds
On Mon, Jul 18, 2011 at 12:10 PM, surya k sur...@live.com wrote: Hi, The problem is to estimate the value of pi using the following series. *1 / pi = (( 2 * sqrt(2) )/ 9801 ) * SIGMA of k[ (4k)! (1103 + 26390*k) / (k!^ 4 ) * 396^(4k) ]* *where k is [0, infinity)* * Problem is located

Re: [Tutor] getting error while solving a series that estimates the value of pi

2011-07-18 Thread surya k
Let me write the code again.. Thanks for your help. On Mon, Jul 18, 2011 at 10:38 PM, James Reynolds eire1...@gmail.com wrote: On Mon, Jul 18, 2011 at 12:10 PM, surya k sur...@live.com wrote: Hi, The problem is to estimate the value of pi using the following series. *1 / pi = (( 2 *