News:

How did you even find this place?

Main Menu

Colored Pi

Started by Miamiandy, November 14, 2006, 09:57:29 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

Sidoh

#15
Quote from: Joex86] link=topic=7901.msg98982#msg98982 date=1163607723]
I don't know if you guys knew this, but the formula for pi is .

There are tons of formulae that you can use to evaluate pi to the nth digit.  The series you've listed is one that converges awfully slowly.  Plus, I'm not even sure it's correct.  I've seen

4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + 4/13 - 4/15...

before, but I haven't ever seen yours.  It's faster to read the digits from a file, so that's what I did.

iago

Quote from: Sidoh on November 15, 2006, 11:39:18 AM
Quote from: Joex86] link=topic=7901.msg98982#msg98982 date=1163607723]
I don't know if you guys knew this, but the formula for pi is .

There are tons of formulae that you can use to evaluate pi to the nth digit.  The series you've listed is one that converges awfully slowly.  Plus, I'm not even sure it's correct.  I've seen

4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + 4/13 - 4/15...

before, but I haven't ever seen yours.  It's faster to read the digits from a file, so that's what I did.
That is, obviously, identical :P

But isn't it cool that he used your formula program? :)

Sidoh

Quote from: iago on November 15, 2006, 12:42:55 PM
That is, obviously, identical :P

But isn't it cool that he used your formula program? :)

I read it incorrectly... not sure why.  Oops. Maybe I should start puting my glasses on in the morning. :P

In any case, this sort of formula converges rediculously slowly.

After 100,000,000 itterations (~2.5 seconds), this code:

              pi += (4 / (mode * numerator));
     
              numerator += 2;
              mode *= -1;
     
              itteration++;


Thinks pi is:

mullins@grays:~/src/c$ time ./pi
3.1415931

real    0m2.773s
user    0m2.764s
sys     0m0.008s


Pi really is: 3.14159265 (to the 8th digit)

So it would be asinine to calculate pi in place of using a file that stores its digits to 1,000,000 places.

iago

Which kind of variable are you using?  Don't forget that floats don't get a whole lot of accuracy. :)

Sidoh

Quote from: iago on November 15, 2006, 01:33:02 PM
Which kind of variable are you using?  Don't forget that floats don't get a whole lot of accuracy. :)

Double.  A quote from Dr. Math:

QuoteBut the above series converges extremely slowly - that is, you need to
compute a HUGE number of terms to get a better result. Since I have
done that program, I can tell you that even after the first 10,000
terms have been evaluated, the approximation is correct to only four
digits.

rabbit

Quote from: Sidoh on November 14, 2006, 11:13:28 PM
http://www.sidoh.org/~sidoh/src/php/pi/pi.gif (1,000,000 digits)
It reminds me of one of those stare-at-it-long-enough-and-you-see-a-sailboat-look-it's-schooner-WRONG-moron-it's-a-sailboat-a-schooner-is-a-sailboat-retard pictures.

Towelie

reminds me of gamesnakes paint pictures :)

Miamiandy

I was so hoping to see something in the pi once it was drawn. O well.
Want to meet someone famous?  Cut out this coupon!

___________________

|This coupon good for  \
|ONE FREE hunting        \
|expedition with            /
|Dick Cheney.             /

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Chavo

Maybe there is a pattern and you just can't see it because you didn't choose an appropriate number to wrap to the next line at :P

Sidoh

Quote from: unTactical on November 16, 2006, 12:32:22 AM
Maybe there is a pattern and you just can't see it because you didn't choose an appropriate number to wrap to the next line at :P

There's an infinite number of random digits.  Shouldn't that "maybe" be a "certainly?" ;)

Chavo

Are you suggesting that you can find patterns in randomness?

Lies!!! :-*

iago

Quote from: rabbit on November 15, 2006, 06:55:50 PM
Quote from: Sidoh on November 14, 2006, 11:13:28 PM
http://www.sidoh.org/~sidoh/src/php/pi/pi.gif (1,000,000 digits)
It reminds me of one of those stare-at-it-long-enough-and-you-see-a-sailboat-look-it's-schooner-WRONG-moron-it's-a-sailboat-a-schooner-is-a-sailboat-retard pictures.
Hahaha, Mallrats :D

Sidoh

Quote from: unTactical on November 16, 2006, 02:32:51 AM
Are you suggesting that you can find patterns in randomness?

Lies!!! :-*

Sure, if the dots are aranged in some arbitrary way.  That doesn't mean anything, though.

Chavo

I was being sarcastic, hence the  :-*  ;)

d&q

Actually, cant you, in this case? I don't believe its possible for computers to generate true random numbers, unless it is provided by some external source.
The writ of the founders must endure.