Author Topic: Colored Pi  (Read 11819 times)

0 Members and 1 Guest are viewing this topic.

Offline Miamiandy

  • Full Member
  • ***
  • Posts: 187
  • SpAm In ThE cAn
    • View Profile
    • MyHouseGeek
Colored Pi
« on: November 14, 2006, 09:57:29 pm »
This is interesting. "Each of the 10 possible decimals of the number pi is displayed by a distinct colored pixel." The decimal point isn't there in case you feel pointing that out. I was bored in my 5th period so I confirmed most of the first line.



Alternate link:
http://ccgforums.com/miamiandy/color_pi.png
Want to meet someone famous?  Cut out this coupon!

 ___________________

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

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

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #1 on: November 14, 2006, 10:21:38 pm »
Interesting idea.  7, 0 and 9 aren't very "distinct," though.  They need more contrasting colors.

Offline d&q

  • Hero Member
  • *****
  • Posts: 1427
  • I'm here.
    • View Profile
    • Site
Re: Colored Pi
« Reply #2 on: November 14, 2006, 10:24:43 pm »
Hm. Try looking for some patterns? Like, color them in one(let's say blue) palette. From a complete white, to all the way through the shades of blue to a black.
The writ of the founders must endure.

Offline Miamiandy

  • Full Member
  • ***
  • Posts: 187
  • SpAm In ThE cAn
    • View Profile
    • MyHouseGeek
Re: Colored Pi
« Reply #3 on: November 14, 2006, 10:26:30 pm »
I didn't do that myself btw. And once you are zoomed in all the way you can decently tell the color of the pixels apart.
Want to meet someone famous?  Cut out this coupon!

 ___________________

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

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

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #4 on: November 14, 2006, 10:38:03 pm »
Hm. Try looking for some patterns? Like, color them in one(let's say blue) palette. From a complete white, to all the way through the shades of blue to a black.

I think it's pretty much confirmed that the digits of pi (in this sort of very small reference frame, anyway!), there are no "patterns."

I didn't do that myself btw. And once you are zoomed in all the way you can decently tell the color of the pixels apart.

I know you didn't. ;P

Zooming in defeats the purpose of the thing!  I think this would be reasonably easy to create, though.  In fact... brb.

Offline Miamiandy

  • Full Member
  • ***
  • Posts: 187
  • SpAm In ThE cAn
    • View Profile
    • MyHouseGeek
Re: Colored Pi
« Reply #5 on: November 14, 2006, 10:51:19 pm »
Of course it would be easy to create, I could make in in c++. All you need is calculate pi to whatever place you want and then plot it pixel by pixel.
Want to meet someone famous?  Cut out this coupon!

 ___________________

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

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

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #6 on: November 14, 2006, 11:13:28 pm »
« Last Edit: November 14, 2006, 11:15:11 pm by Sidoh »

Offline Miamiandy

  • Full Member
  • ***
  • Posts: 187
  • SpAm In ThE cAn
    • View Profile
    • MyHouseGeek
Re: Colored Pi
« Reply #7 on: November 14, 2006, 11:17:27 pm »
Nice. See, made quickly. 1 hour 15 min after original post. How long did it take you??
Want to meet someone famous?  Cut out this coupon!

 ___________________

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

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

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #8 on: November 14, 2006, 11:18:25 pm »
Nice. See, made quickly. 1 hour 15 min after original post. How long did it take you??

About five minutes.  45 lines of code.

Edit: Here's the code.

Edit2:  Fixed the link.  This is the code that produces the ledgend at the top of the image, so it's longer.
« Last Edit: November 20, 2006, 01:45:02 pm by Sidoh »

Offline Miamiandy

  • Full Member
  • ***
  • Posts: 187
  • SpAm In ThE cAn
    • View Profile
    • MyHouseGeek
Re: Colored Pi
« Reply #9 on: November 14, 2006, 11:34:41 pm »
Nice.
Want to meet someone famous?  Cut out this coupon!

 ___________________

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

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

Offline d&q

  • Hero Member
  • *****
  • Posts: 1427
  • I'm here.
    • View Profile
    • Site
Re: Colored Pi
« Reply #10 on: November 14, 2006, 11:50:26 pm »
Hm. Try looking for some patterns? Like, color them in one(let's say blue) palette. From a complete white, to all the way through the shades of blue to a black.

I think it's pretty much confirmed that the digits of pi (in this sort of very small reference frame, anyway!), there are no "patterns."

I didn't mean patterns in that sense, I fully understand that pi is irrational and there are no patterns. I meant like, interesting formations. I'm saying it would be more aesthetically pleasing than just a huge Joseph's technicolor dreamcoat.
The writ of the founders must endure.

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #11 on: November 14, 2006, 11:59:13 pm »
I didn't mean patterns in that sense, I fully understand that pi is irrational and there are no patterns. I meant like, interesting formations. I'm saying it would be more aesthetically pleasing than just a huge Joseph's technicolor dreamcoat.

How's this?

Offline Miamiandy

  • Full Member
  • ***
  • Posts: 187
  • SpAm In ThE cAn
    • View Profile
    • MyHouseGeek
Re: Colored Pi
« Reply #12 on: November 15, 2006, 12:04:01 am »
That's a neat way of doing it as well.
Want to meet someone famous?  Cut out this coupon!

 ___________________

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

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

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #13 on: November 15, 2006, 12:08:45 am »
I changed the script so the single digit images are generated differently: white is the presence of the digit, black is the absence.  It's much easier on the eye that way.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Colored Pi
« Reply #14 on: November 15, 2006, 11:22:03 am »
I don't know if you guys knew this, but the formula for pi is .
I'd personally do as Joe suggests

You might be right about that, Joe.


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.

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: Colored Pi
« Reply #30 on: November 16, 2006, 09:28:44 pm »
the point was that you can always find a 'pattern' in anything if you just arrange it right

note that finding one doesn't mean the pattern exists outside of the scope you define it in

Offline Miamiandy

  • Full Member
  • ***
  • Posts: 187
  • SpAm In ThE cAn
    • View Profile
    • MyHouseGeek
Re: Colored Pi
« Reply #31 on: November 16, 2006, 09:36:59 pm »
Eh, I was hoping to see something in Pi. Who knows maybe the virgin mary would appear and you could copyright that exact method of producing the picture and then sell it on Ebay.
Want to meet someone famous?  Cut out this coupon!

 ___________________

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

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

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Colored Pi
« Reply #32 on: November 16, 2006, 11:57:01 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.

Right.  It is impossible for computers alone to generate random numbers.  Most algorithms base a result on something like a timestamp.  Even though this is a decent way to generate a "random" number, it's not truely random.  It could, in theory, be predicted.  While pi is random, it is constant.  Since it's impossible to pick a "random" digit in pi, it's chaotic nature doesn't help in the generation of random numbers.  I think there are algorithms that use pi to generate random digits, but it basically just creates a pseudo-prime out of a pseudo-prime -- mixing up the muck, so to speak.  There are random (or at least what we see to be random!) events in nature: some of the properties of light, etc.  There was a promising device that would produce random numbers from particle accelerators and another that anylized data from a neutron star, but they're obviously not practical solutions...

Eh, I was hoping to see something in Pi. Who knows maybe the virgin mary would appear and you could copyright that exact method of producing the picture and then sell it on Ebay.

You mean in the arangements that you saw?  If you mess around for long enough, I bet you'll see it. :p

Offline dark_drake

  • Mufasa was 10x the lion Simba was.
  • x86
  • Hero Member
  • *****
  • Posts: 2440
  • Dun dun dun
    • View Profile
Re: Colored Pi
« Reply #33 on: November 17, 2006, 12:02:42 am »
Pi is good.  I, in fact, had a slice of the peanut butter and chocolate variety, and it was delicious.
errr... something like that...