# One use of calculating Pi!

Well, here’s one kinky use of Pi I have, though admitedly it brands me as an incurable geek…

I keep a printout of the first 100,000 decimals of Pi (20 pages) by the computer. You want a random number? Just pick up the printout, select a page, and choose a series of digits. Voilà! Great for passwords.

The idea is that since Pi is an irrational number (i.e., it cannot be represented by a fraction of two integers), this means that all finite series of digits end up somewhere in Pi.

Don’t believe me? Check the “Where is your birthday in Pi?” page: www.facade.com/Fun/amiinpi

This may (or may not, for all I know) be true of Pi, it is definitely not true of irrational numbers in general. This number is irrational:
1.101001000100001…1<0n>1<o(n+1)>1
(i.e, we keep increasing numbers of zeroes
between ones)

Many finite strings of digits will never occur in this expansion…

(something funny happened to my posting, the result was not what I entered, perhaps an angle bracket got corrupted. I meant
1.
01
001
0001
00001
000001…

Alas, you just reduced the entropy of your password to lg(100000)==16.6 bits – under three alphanumeric characters’ worth.

I have never heard of a theorem that says that an irrational transcendental number must contain all possible finite strings of numbers. I think it is highly unlikely that pi has, anywhere in its expansion, 3333333…333 where the “…” represents five thousand repetitions of the number 3.

I use random numbers in conjunction with mixed cases. The purpose is not to get maximum entropy, but to avoid choosing familiar numbers that could later be deduced by a clever social engineer.

Hmm. You’re absolutely right. It’s definitely not true of all irrational numbers, but rather of numbers for which no rule is established. Another such number would be e.

That’s how pseudo-random numbers are generated on computers, for instance. You think your home computer has a random generator? Think again. The random number is actually a long series of digits, and the computer samples a segment of that series of digits when it wants a random number.

The idea is that this series of digits is long enough that repeating segments will occur with a very small probability, i.e., probably once in a lifetime.

That’s the rationale behind my use of Pi as a random number generator. If I point at random in the string of numbers, I’m likely to stumble upon a string of numbers which are more or less random.

However, someone knowing this could search through the digits of Pi to find the string in question. Say, for instance, that he is looking for a string of 10 numbers starting with 27344. The probability of finding the right string of ten digits starting with 27344 is 1/10^5 in a truly random case, but more with the first 100,000 digits of Pi.

But with ALL the digits of Pi (yeah, I know, impossible), we’d be back to 1/10^5.

Why not? Why is it hard to believe for an infinitenumber of digits which we know have no period?

Since we do not know the rule for individual digits of Pi, we have to consider it as a random series. In essence, Pi is a pseudo-random number. The probability of finding five thousand 3’s in Pi is 1/10^4999, which may be astronomical, but pales in comparison to infinity, as with all infinite numbers.

The more digits you compute, the more you’re likely to stumble upon strings of digits which seem to make sense; for instance, your birthday, or 123456. They’re still random, though; we just took a large enough sample that we stumbled upon a pattern we recognise as sensible, while in actuality it is no such thing.

Five thousand 3’s in succession are a pattern to us, but it’s still a random string that can naturally occur.

Doing some research, I have found a string of seven 3’s in the first 10 million digits of Pi (i.e. ‘3333333’). The probability of such an event is 1/10^7, and we happen to have 10^7 digits. It’s all within the realm of the probable.

So if you have 10^5000 digits (I know, not enough atoms in the Universe by far, but still), why not have a succession of five thousand 3’s?

If pi has an infinite number of zeroes, and if each digit is random, then the probability that ANY finite sequence of digits can be found within pi approaches, but is not equal to 100%. So, 50 BILLION 3’s in a row most likely can be found somewhere in pi.

It’s just like the monkeys banging on the typewriters and eventually banging out Hamlet. If you give them an eternity to do it, they probably eventually will.

However, there is an infinitessimal probability that they NEVER will.

• Jim

I meant if pi has an infinite number of digits.

[/quote]
It’s just like the monkeys banging on the typewriters and eventually banging out Hamlet. If you give them an eternity to do it, they probably eventually will.
[/quote]

Don’t wait up
There is exactly one document that would be the correct Hamlet, and an infinite number of possable documents that would not be Hamlet.
Even given the rest of time, there is exactly one chance out of infinity that the monkeys would type out Hamlet. Of couse, math with infinities is always a questionable venture, and I’m not about to get into an argument over my answer.

OTOH, I heard someone argue that the laws of entropy state that there is a certain threshold beyond which something is too orderly to have been created by a chaotic process. I don’t fully understand entropy, but the argument makes sense. Essentially, a monkey typing out Shakespere’s plays would be akin to a volcano randomly spewing out a late model Corvette ZR-1 with a 5 disk CD player and the puncture-proof tires.

“I had a feeling that in Hell there would be mushrooms.” -The Secret of Monkey Island

Regarding the speed limit for the expansion of the universe (a point raised by Dr. Neil Basecu in his comment on the pi question): it’s not the speed of light. At least according to noted physics popularizer John Gribbin at: http://epunix.biols.susx.ac.uk/Home/John_Gribbin/cosmo.htm
Space expanded faster than the speed of light for at least part of the universe’s history, according to most cosmologists. The speed of light is an absolute limit for objects traveling through space. So you may need those 39 decimal places after all.

" Hmm. You’re absolutely right. It’s
" definitely not true of all irrational
" numbers, but rather of numbers for which
" no rule is established. Another such
" number would be e.

I do not know this has been established.
Certainly it is true if the digits truly have a “random” quality. I had the impression those interested in extremely long expansions of Pi wanted to assess how “random” those digits really were.

" That’s how pseudo-random numbers are
" generated on computers, for instance. You
" think your home computer has a random
" generator? Think again. The random number
" is actually a long series of digits, and
" the computer samples a segment of that
" series of digits when it wants a random
" number.

Please, that sounds a little patronizing. You can certainly VISUALIZE the computer as sampling from a series of digits, but far more typical is running an algorithm that would RESULT in a long series of digits. The most common pseudo-random number generator is probably the linear congruential method, in which
X(n+1) = mod(a*X(n) + c, m)
generates a sequence of numbers X(1), X(2), etc. starting with an X(0) known as the “seed”. Choice of appropriate constants a, c, and m is very important for getting good qualities of numbers. Knuth, in his “The Art of Computer Programming”, dedicates about a third of the second volume to pseudo-random number generators for those interested in methods of generation, as well as methods of evaluating their qualities.

<< If pi has an infinite number of zeroes, and if each digit is random, then the probability that ANY finite sequence of digits can be found within pi approaches, but is not equal to 100%. So, 50 BILLION 3’s in a row most likely can be found somewhere in pi. >>

Yeah, but that’s the point. The digits in pi are NOT random (in the sense that you’re using the term “random.”) There are any number of forumlas that are used to caclulate the digits of pi, which makes them not random at all. No more than the .1010010001 … sequence is random.

Now, any small chain of digits in pi – like oh, say the first billion digits – appear to be random to the human eye. And if you want to use them as a source of generating random numbers of two or three or a dozen digits, as Elijah says, that’s fine. Close enough for practical purposes, as they used to say.

If you have a truly random infinite sequence of numbers, then, as Elijah comments, there is reasonable probability that the sequence contains a subsequence of a thousand 3’s (or whatever). And as someone else commented, that’s just like the monkeys banging at the typewriters. Now, if you have to actually FIND that sequence of a thousand 3’s, forget it… Just like, you’d probably have to spend your lifetime looking through all the dribble typed the monkeys, to come up with even one coherent speech from Hamlet, let alone a whole act.

You’re going to have extreme trouble finding more than 85 3’s in a row in pi. There are only about 10^85 electrons in the universe, so it will be hard to represent 10^85 digits in a computer, even if it is very economical in storage (one bit/electron).

1. While the digits of pi aren’t ‘truly’ random in that they’re predetermined by the
umpteen million infinite series that converge to fractions of pi, they’re close enough to defeat any outside test of randomness. For instance, knowing a string of 100,000 consecutive digits of pi won’t give you any edge in guessing the 100,001st. Since that’s generally the sort of thing we mean by ‘random’, why argue the point?

1. Dr. Askey’s sterling character reference for Gregory Chudnovsky has no bearing on the question of the usefulness of taking the expansion of pi out to ridiculous lengths. And, c’mon, what is the sequence of
digits in the expansion of pi going to tell you about either randomness itself, or about any of the properties of transcendental numbers, that the formulas for generating those digits won’t tell you more directly? I don’t buy it for a second.

‘PI’ is the name of a new film. It’s great too.

It shows another reason for calculating these numbers.

Not to mention since it won first prize, it came with \$1M prize money

Alright, lemme try to reply to a few threads all in one post…

RTFirefle:

Thank you. That’s exactly my point, and you express it well. That’s the same reason we can safely assume the digits generated by a computer are pseudo-random, since, although there is an algorithm, there is no clear rule for extrapolating the digits following a given series of digits.

jens:

Why is it patronising? Using an algorithm to select a long series of digits is different from the (simplified, granted) explanation that you select a series of digits from a greater series.

Let me put it this way: if you use the following algorithm to select a number:

a_n = n^2 + 1

You can say you use the above algorithm to select a given number, or you can say you merely select a number from a series of number, in that case,

1, 2, 5, …, (n^2+1), …

So, what’s the difference? Or are you merely saying I oversimplified?

George:

Yep. But the idea is to take a sufficiently large number that it can be approximated to an infinite series. It all depends how precise you want to be, but you’ll certainly agree that 10^3 << 10^10.

Hey, I’m not trying to argue Pi is a random number; I’m saying Pi is a pseudo-random number because there is no apparent correlation between digit k and digit k+1. That’s good enough for passwords, no?

Maybe we could deemphasize the word “random”, since it means a lot of different things.

One thing people are talking about is whether pi is a “normal number”, in whose digits every subsequence occurs with the expected probability, and consequently every finite string appears eventually with probability 1. This is widely believed, but not known. www.astro.virginia.edu/~eww6n/math/NormalNumber.html

Whether something makes a good password doesn’t depend on its passing statistical tests. It depends on how big the search space is.

A random 8-digit number is one of 10^8 possibilities. An 8-digit number picked randomly from the first million digits of pi has only 10^6 possibilities. It’s the same reason you shouldn’t pick passwords from other well-known sources: Monty Python lines, science fiction characters’ names, song lyrics, etc.

Although I can’t really advance the level of discourse here, which is admittedly impressive, I thought I’d throw in a couple of definitions for anyone who’s reading this and scratching their heads.

“Irrational” refers to a nonterminating decimal, and nothing more. 2/3, for example, translates to 0.66666666666… forever. That’s “irrational.”

“Transcendental” refers to an irrational number that cannot be expressed using a polynomial equation with rational coefficients – or, in English, a simple (terminating) equation with regular numbers. (In other words, the well-known 1/2 + 1/3 + 1/4 + 1/5 +… 1/n doesn’t count.) 0.66666… is therefore not a transcendental number, because it can be expressed as 2/3.

The two best-known transcendental numbers are e and pi, although some dude once proved that there are an infinite number of them. Oh, by the way, seeing that pi is transcendental – if you learned in school that 22/7 equals pi, be aware it’s an approximation that’s certainly close enough for most real-world purposes, but it ain’t pi; it diverges after just a few decimals.

Anyway, that’s my meager contribution to a fascinating thread. That’s what I love about the SDMB – whether the topic is math theory or toejam, the discussion will be enlightened and entertaining. It’s a beacon of rationality amid the sea of pseudointellectual detritus that comprises the rest of the 'net…

“I’m not an actor, but I play one on TV.”