Clan x86

General Forums => Academic / School => Math and Other Problems => Topic started by: Miamiandy on November 14, 2006, 09:57:29 pm

Title: Colored Pi
Post by: Miamiandy 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.

(http://static.flickr.com/41/102585611_5b8c6569a6_o.png)

Alternate link:
http://ccgforums.com/miamiandy/color_pi.png (http://ccgforums.com/miamiandy/color_pi.png)
Title: Re: Colored Pi
Post by: Sidoh on November 14, 2006, 10:21:38 pm
Interesting idea.  7, 0 and 9 aren't very "distinct," though.  They need more contrasting colors.
Title: Re: Colored Pi
Post by: d&q 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.
Title: Re: Colored Pi
Post by: Miamiandy 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.
Title: Re: Colored Pi
Post by: Sidoh 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.
Title: Re: Colored Pi
Post by: Miamiandy 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.
Title: Re: Colored Pi
Post by: Sidoh on November 14, 2006, 11:13:28 pm
http://www.sidoh.org/~sidoh/src/php/pi/pi.gif (1,000,000 digits)
Title: Re: Colored Pi
Post by: Miamiandy 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??
Title: Re: Colored Pi
Post by: Sidoh 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 (http://www.christophermullins.net/index.php/codebin/viewcode/8/?window=1).

Edit2:  Fixed the link.  This is the code that produces the ledgend at the top of the image, so it's longer.
Title: Re: Colored Pi
Post by: Miamiandy on November 14, 2006, 11:34:41 pm
Nice.
Title: Re: Colored Pi
Post by: d&q 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.
Title: Re: Colored Pi
Post by: Sidoh 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 (http://www.sidoh.org/~sidoh/src/php/pi/single_digits/)?
Title: Re: Colored Pi
Post by: Miamiandy on November 15, 2006, 12:04:01 am
That's a neat way of doing it as well.
Title: Re: Colored Pi
Post by: Sidoh 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.
Title: Re: Colored Pi
Post by: Joe on November 15, 2006, 11:22:03 am
I don't know if you guys knew this, but the formula for pi is (http://latex.sidoh.org/?render=4%2A%281-1%2F3%2B1%2F5-1%2F7...%29).
Title: Re: Colored Pi
Post by: Sidoh on November 15, 2006, 11:39:18 am
I don't know if you guys knew this, but the formula for pi is (http://latex.sidoh.org/?render=4%2A%281-1%2F3%2B1%2F5-1%2F7...%29).

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.
Title: Re: Colored Pi
Post by: iago on November 15, 2006, 12:42:55 pm
I don't know if you guys knew this, but the formula for pi is (http://latex.sidoh.org/?render=4%2A%281-1%2F3%2B1%2F5-1%2F7...%29).

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? :)
Title: Re: Colored Pi
Post by: Sidoh 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.
Title: Re: Colored Pi
Post by: 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. :)
Title: Re: Colored Pi
Post by: Sidoh 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.
Title: Re: Colored Pi
Post by: rabbit 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.
Title: Re: Colored Pi
Post by: Towelie on November 15, 2006, 08:34:27 pm
reminds me of gamesnakes paint pictures :)
Title: Re: Colored Pi
Post by: Miamiandy on November 15, 2006, 08:38:08 pm
I was so hoping to see something in the pi once it was drawn. O well.
Title: Re: Colored Pi
Post by: Chavo 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
Title: Re: Colored Pi
Post by: Sidoh 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?" ;)
Title: Re: Colored Pi
Post by: Chavo on November 16, 2006, 02:32:51 am
Are you suggesting that you can find patterns in randomness?

Lies!!! :-*
Title: Re: Colored Pi
Post by: iago 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
Title: Re: Colored Pi
Post by: Sidoh 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.
Title: Re: Colored Pi
Post by: Chavo on November 16, 2006, 01:33:34 pm
I was being sarcastic, hence the  :-*  ;)
Title: Re: Colored Pi
Post by: d&q 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.
Title: Re: Colored Pi
Post by: Chavo 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
Title: Re: Colored Pi
Post by: Miamiandy 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.
Title: Re: Colored Pi
Post by: Sidoh 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
Title: Re: Colored Pi
Post by: dark_drake 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.