Log in

No account? Create an account


It seems that...

« previous entry | next entry »
Feb. 2nd, 2006 | 11:23 am
posted by: soullesshippy in mctcstudents

in order to leave an initial comment, you do need to log in / have a LiveJournal account.
You can reply to someone else's comment w/o logging in, using anonymous.
I just realized this, and it may make this avenue less attractive to some.

Creating a LiveJournal account is relatively quick and painless though, just look at the topright of the screen where it says LogInNow, beneath it is a link to Create account, for those still interested in participating.

Sorry, I just became aware of this nuance today.

Link | Leave a comment |

Comments {3}

question on assgn.3, #3

from: anonymous
date: Feb. 5th, 2006 06:39 pm (UTC)

Chris asked a good question about problem 3 on assgn. 3 (see below) and I just sent him this response - I'm putting my response here in case anyone else is confused about that problem in a similar way.

The problem is not stating that the sequence that you specified:
converges to pi. Instead, it is saying that the product of all terms of the form
from n=2 to n=N (N is a stopping value to be specified by the program user), multiplied by 8/(2N-1) will be close to pi.
For example, for N=2, this product = (8/5)*(4^2/3^2)
For N=3, this product = (8/7)*(4^2*6^2)/(3^2*5^2)
For N=4, this product = (8/9)*(4^2*6^2*8^2)/(3^2*5^2*7^2)
If you consider the sequence of these terms, this problem is saying that THAT sequence converges to pi.
In this exercise, you need to write a procedure similar to sum from the book that can be used to accumulate a product, rather than a sum; then, you are to use it to make a procedure that will then calculate the product I described above.
I just looked at your code. Your product procedure looks OK (but it would be more general if you used a fourth parameter, "next", so that the procedure could be used when the next term to be used is something other than the incrementation by one of the previous term). But, your "test" procedure is not quite correct - as described above, you need to acummulate the product (given in the brackets []) FIRST, and then multiply it by 8/(2n-1).

>>> Chris Keller <der.keller@gmail.com> 02/05/06 11:40 AM >>>
Hi Ed - I think I might be interpreting the formula for estimating pi
incorrectly for problem #4 on assignment 3. The way it looks to me is:


Which of course converges to 0 as the degree on the bottom is greater than
the degree on the top.

Is the "n" entered supposed to be any large number?

I've attached my code in case you want to take a look at it.

Thank you,
Chris Keller

Reply | Thread