Happy π day

Discuss the language of the universe.

Moderators: kiore, Blip, The_Metatron

Re: Happy π day

#21  Postby susu.exp » Mar 14, 2010 9:18 pm

cateye wrote:Unique facts about pi website

The part about Sagan worries me. Did Sagan really say that!? :shock:


I´m worried by the parts around it. I mean, yea it´s transendental, so it contains any finite string of digits infinitely many times. There are infinitely many starting positions in which the digits of Pi in binary write out a text file of the bible. And justa s many starting positions from which you can get a blu-ray showing the pope having sex with a goat, or me. It´s a cool thing, but it applies to all transcendental numbers and thus to allmost all real numbers. So if it´s in Pi it´s in e as well.
If the universe has an answer that can be stated in some formal way it´s of course in Pi. But that´s rather useless, because if the answer is expressable digitally in n bits, the expected first starting point is 2n - you´ll find it faster without Pi.
"[I]t is an irrational numberIn other words, Pi’s digits go on randomly for infinite." is also rather shoddy in wording.
susu
susu.exp
 
Posts: 1690

Print view this post

Re: Happy π day

#22  Postby Sityl » Mar 14, 2010 9:21 pm

susu.exp wrote:
cateye wrote:Unique facts about pi website

The part about Sagan worries me. Did Sagan really say that!? :shock:


I´m worried by the parts around it. I mean, yea it´s transendental, so it contains any finite string of digits infinitely many times. There are infinitely many starting positions in which the digits of Pi in binary write out a text file of the bible. And justa s many starting positions from which you can get a blu-ray showing the pope having sex with a goat, or me. It´s a cool thing, but it applies to all transcendental numbers and thus to allmost all real numbers. So if it´s in Pi it´s in e as well.
If the universe has an answer that can be stated in some formal way it´s of course in Pi. But that´s rather useless, because if the answer is expressable digitally in n bits, the expected first starting point is 2n - you´ll find it faster without Pi.
"[I]t is an irrational numberIn other words, Pi’s digits go on randomly for infinite." is also rather shoddy in wording.


Yeah, it definately isn't "randomly".
Stephen Colbert wrote:Now, like all great theologies, Bill [O'Reilly]'s can be boiled down to one sentence - 'There must be a god, because I don't know how things work.'


Image
User avatar
Sityl
 
Name: Ser Sityllan Payne
Posts: 5131
Age: 42
Male

United States (us)
Print view this post

Re: Happy π day

#23  Postby cateye » Mar 14, 2010 9:25 pm

num1cubfn wrote:
susu.exp wrote:
cateye wrote:Unique facts about pi website

The part about Sagan worries me. Did Sagan really say that!? :shock:


I´m worried by the parts around it. I mean, yea it´s transendental, so it contains any finite string of digits infinitely many times. There are infinitely many starting positions in which the digits of Pi in binary write out a text file of the bible. And justa s many starting positions from which you can get a blu-ray showing the pope having sex with a goat, or me. It´s a cool thing, but it applies to all transcendental numbers and thus to allmost all real numbers. So if it´s in Pi it´s in e as well.
If the universe has an answer that can be stated in some formal way it´s of course in Pi. But that´s rather useless, because if the answer is expressable digitally in n bits, the expected first starting point is 2n - you´ll find it faster without Pi.
"[I]t is an irrational numberIn other words, Pi’s digits go on randomly for infinite." is also rather shoddy in wording.


Yeah, it definately isn't "randomly".

Indeed. "Randomly" is rather at odds with the fact that you can calculate every digit of the hexadecimal representation of Pi without knowing the other digits. See here.
Don't belong. Never join. Think for yourself. Peace.

Image
User avatar
cateye
 
Posts: 500
Age: 48
Male

Antarctica (aq)
Print view this post

Re: Happy π day

#24  Postby susu.exp » Mar 14, 2010 9:32 pm

It is for the definition of a random sequence. But it doesn´t follow from being irrational, but from being transcendent. There are irrationals for which the digits are not a random sequence. If I picked a starting position n and gave you binary digits of Pi starting at that position without telling you that I was using Pi, you could not find out that it is Pi, the sequence I´d give you has the same properties as a sequence of coin tosses. - The reason for this is the property of transcendentals that they contain any sequence of finite lenght infinitely many times. In particular all sequences of lenght L are in Pi equally often.
This is not true for all irrationals, some of them do not contain particular sequences at all. Consider the irrational number 0.1001100011100001111...
this never contains the sequence 101 for instance.
susu
susu.exp
 
Posts: 1690

Print view this post

Re: Happy π day

#25  Postby cateye » Mar 14, 2010 9:36 pm

susu.exp wrote:It is for the definition of a random sequence. But it doesn´t follow from being irrational, but from being transcendent. There are irrationals for which the digits are not a random sequence. If I picked a starting position n and gave you binary digits of Pi starting at that position without telling you that I was using Pi, you could not find out that it is Pi, the sequence I´d give you has the same properties as a sequence of coin tosses. - The reason for this is the property of transcendentals that they contain any sequence of finite lenght infinitely many times. In particular all sequences of lenght L are in Pi equally often.
This is not true for all irrationals, some of them do not contain particular sequences at all. Consider the irrational number 0.1001100011100001111...
this never contains the sequence 101 for instance.

Interesting. Do you have any insight as to how the digits are distributed? From what you just said it would follow they're uniformly distributed (since a single digit is a sequence of length 1) - that would imply the BBP formula for Pi is a perfect random number generator!
Don't belong. Never join. Think for yourself. Peace.

Image
User avatar
cateye
 
Posts: 500
Age: 48
Male

Antarctica (aq)
Print view this post

Re: Happy π day

#26  Postby Sityl » Mar 14, 2010 9:37 pm

355/113 is quite accurate! I was impressed.
Stephen Colbert wrote:Now, like all great theologies, Bill [O'Reilly]'s can be boiled down to one sentence - 'There must be a god, because I don't know how things work.'


Image
User avatar
Sityl
 
Name: Ser Sityllan Payne
Posts: 5131
Age: 42
Male

United States (us)
Print view this post

Re: Happy π day

#27  Postby Preno » Mar 14, 2010 9:44 pm

susu.exp wrote:I´m worried by the parts around it. I mean, yea it´s transendental, so it contains any finite string of digits infinitely many times.

That's incorrect. There are transcendental numbers which aren't normal (don't contain every sequence of numbers) - for example, Liouville's constant (which is rather similar in form to your example). In fact, there are transcendental numbers which aren't normal in any base.

Whether e and pi are normal is an open question, not something that would follow from the fact that they're transcendental.
User avatar
Preno
 
Posts: 268
Age: 37
Male

Print view this post

Re: Happy π day

#28  Postby susu.exp » Mar 14, 2010 10:37 pm

Preno wrote:That's incorrect. There are transcendental numbers which aren't normal (don't contain every sequence of numbers) - for example, Liouville's constant (which is rather similar in form to your example). In fact, there are transcendental numbers which aren't normal in any base.

Whether e and pi are normal is an open question, not something that would follow from the fact that they're transcendental.


Damn, that´s something I had memorized completely wrong. Well, the problem are the things we know, that just ain´t so as the saying goes... I retract my earlier statement and just note that I suspect Pi to be normal.

cateye wrote:Interesting. Do you have any insight as to how the digits are distributed? From what you just said it would follow they're uniformly distributed (since a single digit is a sequence of length 1) - that would imply the BBP formula for Pi is a perfect random number generator!


If Pi is normal, then yes they are uniformly distributed. However to used the BBP as a random number generator, you first have to insert a random digit number, which in turn requires a random number generator...
susu
susu.exp
 
Posts: 1690

Print view this post

Re: Happy π day

#29  Postby cateye » Mar 14, 2010 10:41 pm

susu.exp wrote:
cateye wrote:Interesting. Do you have any insight as to how the digits are distributed? From what you just said it would follow they're uniformly distributed (since a single digit is a sequence of length 1) - that would imply the BBP formula for Pi is a perfect random number generator!


If Pi is normal, then yes they are uniformly distributed. However to used the BBP as a random number generator, you first have to insert a random digit number, which in turn requires a random number generator...

Well, usually when using random number generators (speaking as a programmer here) you always have to "seed" them first. Since we don't have non-deterministic computers, any random generator is deterministic - if seeded by the same value, it will always yield the same sequence of (pseudo-random) numbers. That is infact very important in practical aspects: imagine a multiplayer game, where a simulation is running on the computer of each player - you don't want "random" events to cause the simulations to go "out of sync".
What makes the difference between a good and a bad random number generator is how uniform the distribution of numbers in that sequence will be.
Don't belong. Never join. Think for yourself. Peace.

Image
User avatar
cateye
 
Posts: 500
Age: 48
Male

Antarctica (aq)
Print view this post

Re: Happy π day

#30  Postby Sityl » Mar 14, 2010 11:05 pm

cateye wrote:
susu.exp wrote:
cateye wrote:Interesting. Do you have any insight as to how the digits are distributed? From what you just said it would follow they're uniformly distributed (since a single digit is a sequence of length 1) - that would imply the BBP formula for Pi is a perfect random number generator!


If Pi is normal, then yes they are uniformly distributed. However to used the BBP as a random number generator, you first have to insert a random digit number, which in turn requires a random number generator...

Well, usually when using random number generators (speaking as a programmer here) you always have to "seed" them first. Since we don't have non-deterministic computers, any random generator is deterministic - if seeded by the same value, it will always yield the same sequence of (pseudo-random) numbers. That is infact very important in practical aspects: imagine a multiplayer game, where a simulation is running on the computer of each player - you don't want "random" events to cause the simulations to go "out of sync".
What makes the difference between a good and a bad random number generator is how uniform the distribution of numbers in that sequence will be.


I thought they improved it's "randomness" by basing the seed on the time that a random number is requested? While it's not any more "random" it is a lot harder to predict.

This leads to the question of "is anything truly random, or is the future already set in stone, but just not knowable to us?"
Stephen Colbert wrote:Now, like all great theologies, Bill [O'Reilly]'s can be boiled down to one sentence - 'There must be a god, because I don't know how things work.'


Image
User avatar
Sityl
 
Name: Ser Sityllan Payne
Posts: 5131
Age: 42
Male

United States (us)
Print view this post

Re: Happy π day

#31  Postby cateye » Mar 14, 2010 11:15 pm

num1cubfn wrote:
cateye wrote:
susu.exp wrote:
cateye wrote:Interesting. Do you have any insight as to how the digits are distributed? From what you just said it would follow they're uniformly distributed (since a single digit is a sequence of length 1) - that would imply the BBP formula for Pi is a perfect random number generator!


If Pi is normal, then yes they are uniformly distributed. However to used the BBP as a random number generator, you first have to insert a random digit number, which in turn requires a random number generator...

Well, usually when using random number generators (speaking as a programmer here) you always have to "seed" them first. Since we don't have non-deterministic computers, any random generator is deterministic - if seeded by the same value, it will always yield the same sequence of (pseudo-random) numbers. That is infact very important in practical aspects: imagine a multiplayer game, where a simulation is running on the computer of each player - you don't want "random" events to cause the simulations to go "out of sync".
What makes the difference between a good and a bad random number generator is how uniform the distribution of numbers in that sequence will be.


I thought they improved it's "randomness" by basing the seed on the time that a random number is requested? While it's not any more "random" it is a lot harder to predict.

This leads to the question of "is anything truly random, or is the future already set in stone, but just not knowable to us?"

Well, you can seed using the system time. But think about the multiplayer game again: if on each computer the simulation is seeded using local system time (which may vary from machine to machine) you will have different simulations running on each machine, ie. each player would see different things on his screen. They're all supposed to see the same thing, though. The games have come "out of sync" and will eventually be drastically different (in one simulation an object may have been destroyed, while in the other it still exists) - this will eventually lead to a crash.
Random number generators are not supposed to be unpredictable - that's a common misconception - they're supposed to produce a preferrably uniform distribution (that's very important if you're running Monte-Carlo based numerical calculations).

If you seed each time before requesting a random number, you will break up that uniform distribution!
Don't belong. Never join. Think for yourself. Peace.

Image
User avatar
cateye
 
Posts: 500
Age: 48
Male

Antarctica (aq)
Print view this post

Re: Happy π day

#32  Postby susu.exp » Mar 14, 2010 11:50 pm

cateye wrote:Well, usually when using random number generators (speaking as a programmer here) you always have to "seed" them first. Since we don't have non-deterministic computers, any random generator is deterministic - if seeded by the same value, it will always yield the same sequence of (pseudo-random) numbers. That is infact very important in practical aspects: imagine a multiplayer game, where a simulation is running on the computer of each player - you don't want "random" events to cause the simulations to go "out of sync".
What makes the difference between a good and a bad random number generator is how uniform the distribution of numbers in that sequence will be.


I was thinking in terms of generating a random variable in mathematics. Of couse it´s a viable transformation, but it begs the question whether the seed is uniform and then whether the BBP for the range of the seed is uniform.
And asking you as a programmer: Do you know how good the random number generator in R is and whether it automatically re-seeds by clock? I´ve found an anylytic solution for a problem usually tackled with a Monte-Carlo technique, but the results don´t match well for large runs and a possible explanation would be that the resampling routine in R introduces some bias.

num1cubfn wrote:This leads to the question of "is anything truly random, or is the future already set in stone, but just not knowable to us?"


Possibly better off in the physics section. But Bell showed that for all local hidden variables theories of quantum mechanics a certain inequality holds in a particular experimental set up. This inequality has been found violated in all experiments so far and thus local hidden variables are out. This means you either accept non-locality (which in particular means that we can observe efeects prior to their causes, which opens "Back to the future" type of cans of worms) or that there are no hidden variables and thus the QM level of description is neccessarily stochastic.
susu
susu.exp
 
Posts: 1690

Print view this post

Re: Happy π day

#33  Postby Sityl » Mar 14, 2010 11:55 pm

susu.exp wrote:
cateye wrote:Well, usually when using random number generators (speaking as a programmer here) you always have to "seed" them first. Since we don't have non-deterministic computers, any random generator is deterministic - if seeded by the same value, it will always yield the same sequence of (pseudo-random) numbers. That is infact very important in practical aspects: imagine a multiplayer game, where a simulation is running on the computer of each player - you don't want "random" events to cause the simulations to go "out of sync".
What makes the difference between a good and a bad random number generator is how uniform the distribution of numbers in that sequence will be.


I was thinking in terms of generating a random variable in mathematics. Of couse it´s a viable transformation, but it begs the question whether the seed is uniform and then whether the BBP for the range of the seed is uniform.
And asking you as a programmer: Do you know how good the random number generator in R is and whether it automatically re-seeds by clock? I´ve found an anylytic solution for a problem usually tackled with a Monte-Carlo technique, but the results don´t match well for large runs and a possible explanation would be that the resampling routine in R introduces some bias.

num1cubfn wrote:This leads to the question of "is anything truly random, or is the future already set in stone, but just not knowable to us?"


Possibly better off in the physics section. But Bell showed that for all local hidden variables theories of quantum mechanics a certain inequality holds in a particular experimental set up. This inequality has been found violated in all experiments so far and thus local hidden variables are out. This means you either accept non-locality (which in particular means that we can observe efeects prior to their causes, which opens "Back to the future" type of cans of worms) or that there are no hidden variables and thus the QM level of description is neccessarily stochastic.


Well, with only understanding about 10% of what you just said, I have to reject any notion that violates the law of causality (although QED does seem to claim that in a vacuum, energy can be "borrowed" from the future as long as it is almost instantly paid back), so, assuming that what you presented is not a false dichotomy, I would have to pick "there are no hidden variables and thus the QM level of description is necessarily stochastic," even if I'm not sure what it means.
Stephen Colbert wrote:Now, like all great theologies, Bill [O'Reilly]'s can be boiled down to one sentence - 'There must be a god, because I don't know how things work.'


Image
User avatar
Sityl
 
Name: Ser Sityllan Payne
Posts: 5131
Age: 42
Male

United States (us)
Print view this post

Re: Happy π day

#34  Postby cateye » Mar 15, 2010 12:07 am

susu.exp wrote:
cateye wrote:Well, usually when using random number generators (speaking as a programmer here) you always have to "seed" them first. Since we don't have non-deterministic computers, any random generator is deterministic - if seeded by the same value, it will always yield the same sequence of (pseudo-random) numbers. That is infact very important in practical aspects: imagine a multiplayer game, where a simulation is running on the computer of each player - you don't want "random" events to cause the simulations to go "out of sync".
What makes the difference between a good and a bad random number generator is how uniform the distribution of numbers in that sequence will be.


I was thinking in terms of generating a random variable in mathematics. Of couse it´s a viable transformation, but it begs the question whether the seed is uniform and then whether the BBP for the range of the seed is uniform.

Yes, you're right, even if Pi were normal the first n digits may not be distributed in a suitable way.

susu.exp wrote:And asking you as a programmer: Do you know how good the random number generator in R is and whether it automatically re-seeds by clock? I´ve found an anylytic solution for a problem usually tackled with a Monte-Carlo technique, but the results don´t match well for large runs and a possible explanation would be that the resampling routine in R introduces some bias.

I don't use R, so I cannot comment on it. But you can easily build your own random generator, the "standard" way to do so is by using this formula:

xn+1=(a*xn+b) mod m

x0="seed"

There are some values for (a,b,m) that are considered (empirically afaik) to yield good distribution:

(23,0,108+1) [Lehmer]

(27+1,1,235) [Rotenberg]

(75,0,231-1) [GGL]

(131,0,235) [Neave]

(16333,25887,215) [Oakenfull]

(3432,6789,9973) [Oakenfull]

(171,0,30269) [Wichmann-Hill]

If your expecting to need many pseudo-random numbers, you should be better off going for large m, since you don't have to worry about granularity so much then I suspect, but the best thing is to just try out the above values and see what works best.
EDIT: keep in mind that necessarily the sequence is bound to repeat eventually /EDIT

If you happen to have access to "Springers mathematische Formeln, Rade/Westergren" it's in chapter 17.5 (page 427 in my edition).


susu.exp wrote:
num1cubfn wrote:This leads to the question of "is anything truly random, or is the future already set in stone, but just not knowable to us?"


Possibly better off in the physics section. But Bell showed that for all local hidden variables theories of quantum mechanics a certain inequality holds in a particular experimental set up. This inequality has been found violated in all experiments so far and thus local hidden variables are out. This means you either accept non-locality (which in particular means that we can observe efeects prior to their causes, which opens "Back to the future" type of cans of worms) or that there are no hidden variables and thus the QM level of description is neccessarily stochastic.

The philosophy section may be a good place to ask such things, too. ;)
Don't belong. Never join. Think for yourself. Peace.

Image
User avatar
cateye
 
Posts: 500
Age: 48
Male

Antarctica (aq)
Print view this post

Re: Happy π day

#35  Postby susu.exp » Mar 15, 2010 12:24 am

Causality is tricky in both cases. Consider the decay of an uranium nucleus. If there are no hidden variables this happens without a cause, we can only give a probability that it will spontaneously decay in some time interval, but there´s no cause. In the non-local case there would be a cause, but this cause wouldn´t have to be close to the uranium nucleus. In fact it could be light years away, even outside the observable universe. It would take ages for us to observe the cause after we´ve seen the decay happening, but there would be a cause. There are some suggestions that QM may be both non-local and free of hidden variables, so you have both in there. But the results of experiments so far have only rules dout that neither applies, we´re stuck with at least one of them. The original problem cam from a paper by Einstein, Podolsky and Rosen which strongly argued for a local hidden variables theory. But they ended up noting that there was no way to test this. Bell found a way to do so (quite ingenuous I have to say) showing that in a particular set-up we would expect a certain result at least 5/9 of the time (Bell favoured a local HVT as well, and if his inequality would hold that would support it). When it became technically feasible to set the experiment up, the result appeared only half the time.
susu
susu.exp
 
Posts: 1690

Print view this post

Re: Happy π day

#36  Postby xwrv » Mar 16, 2010 1:44 pm

The_Metatron wrote:I'd think that anyone who would bother to set a π day would be a little more exacting than simply mimicking the North American standard of date notation.


It's also the ISO 8601 format for writing dates, which is commonly used on computers because it can be sorted easily. Year-month-day is also used in a few other countries (see here), although day-month-year is clearly far more common and will never make the first 3 digits of pi. Nevertheless, here is pi second on my watch.Image
xwrv
 
Posts: 11
Age: 34
Male

Country: Germany
Germany (de)
Print view this post

Re: Happy π day

#37  Postby mizvekov » Mar 27, 2010 2:56 am

susu.exp wrote:
And asking you as a programmer: Do you know how good the random number generator in R is and whether it automatically re-seeds by clock? I´ve found an anylytic solution for a problem usually tackled with a Monte-Carlo technique, but the results don´t match well for large runs and a possible explanation would be that the resampling routine in R introduces some bias.

Well, I never used R, but there are multiple ways to go around this.
If you are interested in knowing how good R's random numbers are, you can create a R program which writes many times it's outputs to a file, and then run on that file one of many analysis tools.
I can't recommend one without knowing what architeture/operating system you are using ofcourse.

If you are interested in going around the problem by not using R's random number generator at all, you can read random numbers from files. There are many solutions for this.
In linux and some other unix systems, you can open the 'magic' file /dev/random or /dev/urandom
When you read from those, the kernel gives you random data, and they make use of any hardware random number generator that the system has (Which are usually based on thermal noise or radioactive decay). The difference between /dev/random and /dev/urandom is that random reads and depletes the kernel's entropy pool, and when the pool is empty, the read blocks while it get's filled in again. This is usually not a problem when you have a hw rnd device, but ofcourse you can read from it faster then it can fill the pool. But otherwise, your application will have sluggish performance, which can be a little improved by moving around the mouse (linux also uses mouse data, hard-drive activity and other events to fill the entropy pool, but they are very slow for this). /dev/urandom uses a pseudo-random number generator using the entropy pool as seed, and it does not deplete it, so the data it provides is worse, but you never have to wait for it.
On other systems which don't have such magic files, you can use any application to create a normal file filled with random data, if you are careful to create one big enough, and optionally using any interface to hw rnd generators.
You can buy those, and they usually come with some application to dump their data to a file, or a library you can use from many programming environments to read from it directly. (They are a bit pricey though)
You can even download such files, and so not bother generating them yourself.
http://www.random.org/files/ provides very good data, generated from atmospheric noise.
mizvekov
 
Posts: 314
Age: 40
Male

Brazil (br)
Print view this post

Previous

Return to Mathematics

Who is online

Users viewing this topic: No registered users and 1 guest