Results 1 to 5 of 5
Thread: Calculate PI
 06182014, 06:17 PM #1Member
 Join Date
 Jun 2014
 Location
 Dhaka
 Posts
 5
 Rep Power
 0
Calculate PI
will u pls help me with this problem?
Write a program called ComputePi to compute the value of pi using the following series expansion. you have to decide on the termination criterion used in the computation(such as number of terms used or the magnitude of an additional term). Is this series suitable for compute pi?
PI=4*(1(1/3)+(1/5)(1/7)+(1/9)(1/11)+(1/13)(1/15)+.......)
 06182014, 06:24 PM #2
Re: Calculate PI
What have you tried?
Notice that the sign changes from term to term and that the denominator increase by 2 in every term. Using that you should be able to write a loop to do the summing of terms.If you don't understand my response, don't ignore it, ask a question.
 06182014, 07:12 PM #3
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,051
 Blog Entries
 7
 Rep Power
 23
Re: Calculate PI
Yep, it's suitable, although it converges a bit slow though ... find the 'regularity' in that series: the numerator stays equal to one, while the denominator is odd and changes it sign for every next value ...
kind regards,
Jos
edit: I should've read the entire thread before replying; Norm was first, by far ... ;)The only person who got everything done by Friday was Robinson Crusoe.
 06192014, 07:22 PM #4Member
 Join Date
 Jun 2014
 Location
 Dhaka
 Posts
 5
 Rep Power
 0
Re: Calculate PI
I tried bt it was not the right way.. so I shared the problem..
 06192014, 07:37 PM #5
Similar Threads

Calculate GPA
By thessler1 in forum New To JavaReplies: 22Last Post: 06272012, 05:13 AM 
Need help to calculate avg
By vavavoom1 in forum New To JavaReplies: 2Last Post: 04022011, 07:42 PM 
fastest way to calculate the sum of 1 to x
By imorio in forum New To JavaReplies: 5Last Post: 11072010, 11:47 PM 
calculate fft
By ram.west in forum Advanced JavaReplies: 2Last Post: 08272008, 03:05 AM 
Calculate what e1 and e2 should be
By Legoland in forum New To JavaReplies: 11Last Post: 07022007, 06:01 PM
Bookmarks