1. Member
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)+.......)

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.

3. ## Re: Calculate PI

Originally Posted by Nasima Ferdous Tripti
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)+.......)
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

4. Member
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..

5. ## Re: Calculate PI

Do you have code that you need help with? Please post it and ask some questions about the problems you are having.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•