Author Topic: Colored Pi  (Read 14161 times)

0 Members and 2 Guests are viewing this topic.

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #15 on: November 15, 2006, 11:39:18 am »
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.
« Last Edit: November 15, 2006, 11:42:27 am by Sidoh »

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Colored Pi
« Reply #16 on: November 15, 2006, 12:42:55 pm »
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? :)

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #17 on: November 15, 2006, 12:53:09 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:

Code: [Select]
              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.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Colored Pi
« Reply #18 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. :)

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #19 on: November 15, 2006, 02:00:56 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:

Quote
But 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.

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Colored Pi
« Reply #20 on: November 15, 2006, 06:55:50 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.

Offline Towelie

  • pwnstar
  • x86
  • Hero Member
  • *****
  • Posts: 4873
    • View Profile
Re: Colored Pi
« Reply #21 on: November 15, 2006, 08:34:27 pm »
reminds me of gamesnakes paint pictures :)

Offline Miamiandy

  • Full Member
  • ***
  • Posts: 187
  • SpAm In ThE cAn
    • View Profile
    • MyHouseGeek
Re: Colored Pi
« Reply #22 on: November 15, 2006, 08:38:08 pm »
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.             /

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

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: Colored Pi
« Reply #23 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

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #24 on: November 16, 2006, 01:56:03 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?" ;)

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: Colored Pi
« Reply #25 on: November 16, 2006, 02:32:51 am »
Are you suggesting that you can find patterns in randomness?

Lies!!! :-*

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Colored Pi
« Reply #26 on: November 16, 2006, 08:17:27 am »
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

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #27 on: November 16, 2006, 12:24:07 pm »
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.

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: Colored Pi
« Reply #28 on: November 16, 2006, 01:33:34 pm »
I was being sarcastic, hence the  :-*  ;)

Offline d&q

  • Hero Member
  • *****
  • Posts: 1427
  • I'm here.
    • View Profile
    • Site
Re: Colored Pi
« Reply #29 on: November 16, 2006, 08:32:33 pm »
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.