The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #1 Posted by Jeff Kearns on 26 Apr 2012, 11:19 a.m.

4,000,000 Digits of Pi

      
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #2 Posted by C.Ret on 26 Apr 2012, 12:01 p.m.,
in response to message #1 by Jeff Kearns

HI,

I really wonder how they keep 4'000'000 digits in a JPG picture of 960 x 540 pixels. If the compression rate is one pixel per digit of PI, the maximum of digits store in such an image size it at maximum 518'400. It's only 12.96% of the advertize count!

Moreover, the JPG is a losy compressing process, so most of the PI digit are lost there!

OK. I always surprise how in the nowadays digital world, peoples have lost elementary notion of what a digit is!

Here a bunch of question following this remarkable link.

What will be the pixel Height and Width of an standard 4/5 proportion bitmap picture (standard) needed to store then 4'000'000 first digits of PI at the rate of one colored pixel per digit?

And for a 16/9 sized picture?

What, will be the bit depth to code for the 10 digits code (0 to 9) ?

What will be the minimal size of the corresponding bitmap image? What make it impossible to share it on the Web ?

What is the pixel surface of the large black PI draws in the middle of the bitmap? What is the consequence of the Height and Width adjustment to guaranty the 4’000’000 digits representation?

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #3 Posted by Bill (Smithville, NJ) on 26 Apr 2012, 12:19 p.m.,
in response to message #2 by C.Ret

Quote:
I really wonder how they keep 4'000'000 digits in a JPG picture of 960 x 540 pixels. If the compression rate is one pixel per digit of PI, the maximum of digits store in such an image size it at maximum 518'400. It's only 12.96% of the advertize count!

You're right, but go to the APP page

PI App

and you'll see that they show it as a 500,000 digit section of the total 4 million. You can use the right hand scroller to move to any 500,000 digit section.

Bill

                  
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #4 Posted by C.Ret on 26 Apr 2012, 12:27 p.m.,
in response to message #3 by Bill (Smithville, NJ)

Thank you very much for the link !

It is well done. And the used color set (for coding digits) is of a great effet making the whole image green/blue !

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #5 Posted by Crawl on 26 Apr 2012, 12:29 p.m.,
in response to message #2 by C.Ret

That's not the real image. The real image is here:

http://two-n.com/pi/

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #6 Posted by Pete Wilson on 26 Apr 2012, 7:15 p.m.,
in response to message #2 by C.Ret

Along the lines of your questions, I would like to see the visualization with more compressed mappings to the digits.

How about mapping three digits to 10% increments of RGB?

Or, given 8-bit JPEG depth, how about mapping two digits at a time to each of RGB?

Somehow I think a little ImageMagick is in order.

      
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #7 Posted by Matt Agajanian on 26 Apr 2012, 3:17 p.m.,
in response to message #1 by Jeff Kearns

Hello all.

Please help me figure this out. Yes, it is quite amazing and fascinating that in our technical and machine age, we can devise computational methods to unravel Pi to more and more digits every year. Obviously, as Pi is an irrational value with no repeat in sight, what's the point of finding its value to the umpteen billionth decimal place? What further puzzles me is that even with the best computers, they can only process calculation with double or triple precision, so again, what's the point of Pi to the seven millionth, etc. decimal place? And, even so, people can only comprehend and use Pi to a handful of digits for both regular usage and even in the sciences.

Just wondering

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #8 Posted by Steve Simpkin on 26 Apr 2012, 3:46 p.m.,
in response to message #7 by Matt Agajanian

The same reason people climb mountains. Because it is there.

                  
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #9 Posted by P.Hart on 26 Apr 2012, 7:28 p.m.,
in response to message #8 by Steve Simpkin

Quote:
The same reason people climb mountains. Because it is there.
No, not Capt. Kirk. The quotation is from a 1930's British mountaineer Eric Shipton who was asked why he was trying to climb Mt Everest.
                        
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #10 Posted by Ed Wright on 30 Apr 2012, 8:40 a.m.,
in response to message #9 by P.Hart

This quote is always attributed to George Mallory, also a great British explorer who died in his attempt to climb Mt. Everest.

                              
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #11 Posted by P.Hart on 30 Apr 2012, 10:36 a.m.,
in response to message #10 by Ed Wright

Quote:
This quote is always attributed to George Mallory
You may be right. Memory fallible but it says I have seen the saying attributed to Shipton in a book by one of his contemporary mountaineers. According to Wikipaedia on Mallory there is doubt about the attribution to him.
                                    
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #12 Posted by Ed Wright on 30 Apr 2012, 1:44 p.m.,
in response to message #11 by P.Hart

I wasn't aware of the controversy. It appears we'll never know who really said it.

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #13 Posted by Matt Agajanian on 26 Apr 2012, 4:12 p.m.,
in response to message #7 by Matt Agajanian

Thanks for quoting James T. Kirk (yes, from 'Star Trek V: The Final Frontier.' I can see the point of the challenge as with computer programming. I guess I was looking too closely at the practicality of Pi's multi-million digit string and not seeing it as a challenge to be fascinated by.

Thanks

                  
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #14 Posted by Bart (UK) on 26 Apr 2012, 7:24 p.m.,
in response to message #13 by Matt Agajanian

Ha ha, that reminds me of an early episode of Star Trek where Spock tasks the Enterprise's onboard computer to calculate the last digit of pi, causing it to channel all it's resources to the problem thus diverting it from doing something bad. Although I was still quite young, it left an impression on me as it was the first time the endlessness of pi dawned on me (my maths teacher probably had mentioned it, but it just doesn't carry the same impact as your favourite sci-fi program :-).

                        
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #15 Posted by Jeff O. on 27 Apr 2012, 8:52 a.m.,
in response to message #14 by Bart (UK)

The purpose of Spock's assignment was to drive an evil entity (which had been various incarnations of evil throughout history including Jack the Ripper) from the ship's computer. Of course one might call being able to give the computer a problem to which it would devote more and more resources until it could do nothing else a serious security flaw.

(season 2 Episode, "Wolf in the Fold", original air date 12/22/67, episode Stardate 3614.9)

                              
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #16 Posted by Bart (UK) on 28 Apr 2012, 12:56 p.m.,
in response to message #15 by Jeff O.

I must have seen it a dozen or so years after it's first air date (I would have been 1 at the time :-). Apart from that flaw, I think these days we would expect a futuristic computer to be programmed with an intelligent response that it would be futile to attempt that sort of task :-).

                                    
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #17 Posted by Jeff O. on 28 Apr 2012, 5:05 p.m.,
in response to message #16 by Bart (UK)

Hi Bart,
I was not really expecting a response :-) I guess I posted because a lot of otherwise useless Star Trek information is rattling around my head, so I let it out whenever I get the chance. (I did have to look up the exact episode name, air date and star date.)

Quote:
I must have seen it a dozen or so years after it's first air date (I would have been 1 at the time :-).
I won't give my exact age, but I'm pretty sure that I saw it on its original air date.

Edited: 28 Apr 2012, 5:06 p.m.

                              
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #18 Posted by Pete Wilson on 28 Apr 2012, 5:45 p.m.,
in response to message #15 by Jeff O.

I'm pretty sure Spock is a system admin :)

-- Pete (a system admin)

      
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #19 Posted by Howard Owen on 26 Apr 2012, 5:16 p.m.,
in response to message #1 by Jeff Kearns

I was born on February 4th, 1956. If I put that in mmddyyyy format, it's 02041956. That sequence doesn't occur in the first 4 X 106 digits of Pi, according to the search function on the java applet linked to in the referenced article. If I code my birthday as ddmmyyyy, I get 04021956, which also doesn't appear. 241956 does show up, however. (The applet says it handles up to 6 digits, but it will actually accept 8, and find other 8 digit strings.)

What is the probability that a given 8 digit sequence will be found in the first 4 million digits of Pi? How many digits of Pi would you need to reach a probability of, say, 80% that such a sequence would appear? Given a particular eight digit sequence, what is the probability that the first sequence and another sequence formed by transposing 2 arbitrary digits in the original will both appear in 4 million digits of Pi?

Please show your work because I have no freakin' idea how to find the answers. :)

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #20 Posted by fhub on 26 Apr 2012, 5:23 p.m.,
in response to message #19 by Howard Owen

Quote:
I was born on February 4th, 1956. If I put that in mmddyyyy format, it's 02041956. That sequence doesn't occur in the first 4 X 106 digits of Pi
Well, I would say you are just too old for Pi. ;-)

For me it's even worse: birthyear 1955. :-(

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #21 Posted by W. Bruce Maguire II on 26 Apr 2012, 8:24 p.m.,
in response to message #19 by Howard Owen

Howard:

Quote:
What is the probability that a given 8 digit sequence will be found in the first 4 million digits of Pi?

Well, I'm not a mathematician, but I would say that it would be reasonable to assume that the digits of 'pi' are random for this sort of thing. The probability that a given *random* digit was the same as your first "given" digit would be 1 in 10. The next digit would be independent of the first, so the probability would again be 1 in 10. Therefore, the probability that any 8 random digits exactly matches your "given" 8-digit number would be 1 in 10^8 (or 1e-8). So the probability that the first 8 "random" digits in 'pi' do *not* match yours is (1 - 1e-8). So the probability that 4 million (4e6) consecutive tries do *not* match is ((1 - 1e-8) ^ 4e6). So:

P = (1 - 1e-8) ^ 4e6
ln(P) = 4e6 ln(1 - 1e-8)
ln(P) = -4e-2
P = e^(ln(P)) = e^(-4e-2) = 0.961  (approximately)
That means there is a 96% chance of *not* matching the "given" 8 digits; so I would say you have about a 4% chance of finding any given 8-digit sequence in the first 4-million digits of 'pi'.

Quote:
How many digits of Pi would you need to reach a probability of, say, 80% that such a sequence would appear?
Well, that would mean how many digits do you need to have only a 20% chance of *not* finding your given 8-digit sequence, so from above:
0.20 = (1 - 1e-8) ^ N
ln(0.20) = N ln(1 - 1e-8)
N = 1.61e8  (approximately)
So I would say that you would need to have 161 million digits of 'pi' to have an 80% chance of finding your given 8-digit sequence in there.

I gotta go, so I can't look at the other question(s).

I *really* hope that I didn't embarrass myself!
Bruce.

                  
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #22 Posted by Gerson W. Barbosa on 27 Apr 2012, 7:27 a.m.,
in response to message #21 by W. Bruce Maguire II

So your formula states that the probability p that an n-digit sequence appears in the first N digits of pi is

p = 1 - (1 - 10-n)N
This matches the examples in a table in The Pi-Search Page.
Number Length	Chance of Finding (in the first 100 million digits of pi)
    1-5		      100%
      6	              Nearly 100%
      7	              99.995%
      8		      63%
      9		      9.5%
     10		      0.995%%
     11	              0.09995%

Well done!

Gerson.

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #23 Posted by nina scholz on 27 Apr 2012, 3:43 a.m.,
in response to message #19 by Howard Owen

it accepts only 6 digits for searching ...

                  
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #24 Posted by Howard Owen on 27 Apr 2012, 12:51 p.m.,
in response to message #23 by nina scholz

It says it only accepts six, but it actually accepts eight. It just occurred to me that the stated limit might be because (per Gerson's formulation of Bruce's procedure) the probability of an eight digit sequence being found in the first 4 X 106 digits of Pi is 3.9%, whereas a six digit string has a probability of 98% of occurring.

Six digits would limit the birthday format to mmddyy, or ddmmyy. Using the first format, my birthday appears 4 times in the given data set.

001 LBL 'PIP 002 'PI DIGITS? 003 PROMPT 004 'N SIZE? 005 PROMPT 006 10 007 X<>Y 008 CHS 009 Y^X 010 1 011 X<>Y 012 - 013 X<>Y 014 Y^X 015 1 016 X<>Y 017 - 018 END

                        
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #25 Posted by Gerson W. Barbosa on 27 Apr 2012, 7:27 p.m.,
in response to message #24 by Howard Owen

The table says 100% for n=1 to 5 (in the first 100 million digits of pi). That's true for the digits 0 through 9, since this is verified in the first 33 digits of pi. For 2, 3, 4 and 5-digit sequences the probability is very close to 100%, but not exactly 100%.

Any particular reason for not using 10^X?

001 LBL 'PIP
002 'PI DIGITS?
003 PROMPT
004 'N SIZE?
005 PROMPT
006 CHS
007 10^X
008 CHS
009 1
010 +
011 X<>Y
012 Y^X
013 CHS
014 1
015 +
016 END
or, more accurately,
001 LBL 'PIP
002 'PI DIGITS?
003 PROMPT
004 'N SIZE?
005 PROMPT
006 CHS
007 10^X
008 CHS
009 LN1+X
010 *
011 E^X-1
012 CHS
013 END

                              
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #26 Posted by Paul Dale on 27 Apr 2012, 7:37 p.m.,
in response to message #25 by Gerson W. Barbosa

Quote:
The table says 100% for n=1 to 5 (in the first 100 million digits of pi). That's true for the digits 0 through 9, since this is verified in the first 33 digits of pi. For 2, 3, 4 and 5-digit sequences the probability is very close to 100%, but not exactly 100%.

Unless, of course, all such sequences really do occur in the digits available. In this case the probability is 1.

- Pauli

                                    
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #27 Posted by Gerson W. Barbosa on 27 Apr 2012, 8:34 p.m.,
in response to message #26 by Paul Dale

Yes, but until all 111,100 sequences have been checked we cannot take that for granted.

Gerson.

                                          
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #28 Posted by Paul Dale on 27 Apr 2012, 9:15 p.m.,
in response to message #27 by Gerson W. Barbosa

I suspect they have been :-) Of course, I don't know for sure and am too lazy to write a program to do such a check...

- Pauli

                                                
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #29 Posted by Gerson W. Barbosa on 27 Apr 2012, 9:51 p.m.,
in response to message #28 by Paul Dale

Most likely all sequences are there:

http://www.wolframalpha.com/input/?i=100%281-%281-10%5E-5%29%5E1e8%29

Click four times on 'More digits'.

Gerson.

                        
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #30 Posted by Gerson W. Barbosa on 28 Apr 2012, 2:41 a.m.,
in response to message #24 by Howard Owen

You'll find the first occurrence of the sequence 02041956 at position 252,431,153, according to Pi Explorer.

Gerson.

                              
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #31 Posted by Howard Owen on 28 Apr 2012, 6:23 p.m.,
in response to message #30 by Gerson W. Barbosa

Good to know, Gerson! Now, what exactly can I do with this information? :)

It's a leading question. Be nice. :)

                                    
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #32 Posted by Gerson W. Barbosa on 28 Apr 2012, 7:09 p.m.,
in response to message #31 by Howard Owen

Just thought you'd like to know, since you appeared to be somewhat disappointed because your birthday string would not show up in the first few million digits of pi.
In theory even the complete works of Shakespeare might be found inside pi, considering the constant behaves as it has been doing thus far. However no one will ever know where they start. How many digits should be looked at before the string "the undiscover’d country from whose bourn no traveller returns" appears, for instance?

                                          
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #33 Posted by Howard Owen on 28 Apr 2012, 7:49 p.m.,
in response to message #32 by Gerson W. Barbosa

Quote:
Just thought you'd like to know, since you appeared to be somewhat disappointed because your birthday string would not show up in the first few million digits of pi.
Helping me to understand the probabilities reduced my disappointment considerably. :)

Quote:
How many digits should be looked at before the string "the undiscover’d country from whose bourn no traveller returns" appears, for instance?

Along the same lines, Here are some strings I'd like to see in Pi:

  • Turn back! Here there be dragons!
  • My other irrational constant is a Volkswagen.
  • Keep it up. The answer to everything appears starting at digit numbhYfd]9uf8
  • There's no meaning in Pi other than the fact that it's a constant of nature, or at least of nature with a flat topology.

Apologies, slow afternoon. :)

      
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #34 Posted by Bill (Smithville, NJ) on 26 Apr 2012, 7:24 p.m.,
in response to message #1 by Jeff Kearns

If you like PI visualized in color, there's also PI visualized as music. There are plenty of videos showing it, but I like he following:

Musical PI

Bill

      
Now, that is a proof
Message #35 Posted by Frank Boehm (Germany) on 27 Apr 2012, 7:52 a.m.,
in response to message #1 by Jeff Kearns

They always said, there is no secret to be found within the number of Pi - but it seems that they were wrong. I can see a huge "pi"-Sign right in the middle of the chaos. Did someone else notice this as well?

      
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #36 Posted by Crawl on 29 Apr 2012, 8:51 p.m.,
in response to message #1 by Jeff Kearns

Actually, looks like they got the very first digit wrong:

            
Re: OT: The first 4,000,000 digits of Pi, visualized in a single image
Message #37 Posted by Jeff Kearns on 29 Apr 2012, 11:06 p.m.,
in response to message #36 by Crawl

I am unable to reproduce this string when I place my cursor at the upper leftmost position. I get the decimal portion of Pi starting with 141592...

Has anyone else gotten this result?

Jeff


[ Return to Index | Top of Index ]

Go back to the main exhibit hall