Slashdot Mirror


Pi: Less Random Than We Thought

Autoversicherung writes "Physicists including Purdue's Ephraim Fischbach have completed a study comparing the 'randomness' in pi to that produced by 30 software random-number generators and one chaos-generating physical machine. After conducting several tests, they have found that while sequences of digits from pi are indeed an acceptable source of randomness -- often an important factor in data encryption and in solving certain physics problems -- pi's digit string does not always produce randomness as effectively as manufactured generators do."

37 of 416 comments (clear)

  1. because it ain't random by frovingslosh · · Score: 3, Funny

    Gee, they found that pi wasn't random. Imagine that. Maybe someday we'll even be able to predict the value of pi.

    --
    I'm an American. I love this country and the freedoms that we used to have.
    1. Re:because it ain't random by mobby_6kl · · Score: 4, Funny

      That's only because they forgot to randomize first!

    2. Re:because it ain't random by i_should_be_working · · Score: 3, Insightful

      It's not that Pi is random or was ever though to be. But you can generate random (or not so random according to the article) numbers by picking out single digits from Pi.

      So I could take, for example, every 14th digit in Pi and that would make a good random string of numbers between 0 and 9.

    3. Re:because it ain't random by Anonymous Coward · · Score: 4, Informative

      Yes, picking every 14th digit of Pi may share the properties of a good random number (although, once again, the article points out that it is not as good as a RNG). However, actually using said digits for anything would be very unwise, since it wouldn't be that hard to determine that you were using a periodic subsequence of Pi's digits. I.e. don't use this for cryptographic keys.

    4. Re:because it ain't random by Rei · · Score: 3, Insightful

      I don't see why one should expect Pi to be the ultimate in mathematical random number generation. Its chaos comes from the fact that it is an iterative function; why should we assume that this particular iterative function generates more chaos than others? That would be too convenient.

      --
      Dear Lord: One of your creatures may be hurt tonight. Please let it be the other creature.
    5. Re:because it ain't random by calambrac · · Score: 4, Informative

      Being able to reproduce random sequences is a good thing. Let's say you want to set up a test that feeds random data into a program until it crashes. It would be nice to be able to rerun that sequence (without having to store the sequence) to make sure the problem gets fixed.

      That's why most random number generators let you specify a seed value. As long as you use the same seed value, you get the same sequence back. If you want a new sequence every time, peg your seed value to some number that varies, like the current time...

    6. Re:because it ain't random by shreevatsa · · Score: 5, Insightful

      Pi is a transcendental number
      Yes, that's right...
      and therefore cannot be exactly determined
      Er, that depends on what you mean by "exactly determined". Do we need to know the digits in decimal expansion (base 10) to "determine" pi? How about saying that pi is exactly "1.000" in "base pi"? IMHO, whether or not a number can be exactly determined is independent of whether its decimal expansion is known. By your logic, sqrt(2) cannot be exactly determined, as it is an irrational number and has infinitely many digits (and they aren't periodic, unlike 1/3=0.33333333333... which also has infinitely many digits). But I am not entirely comfortable with saying that sqrt(2) cannot be exactly determined. After all, we know exactly what it is -- the positive number whose square is two.

      I expect e and the square root of 2 to be better choices
      WTF? How is e a better choice? It is also a transcendental number, just like pi. And sqrt(2) isn't even transcendental!

  2. Computing any digit of pi by G4from128k · · Score: 4, Interesting

    Given that its possible to compute any digit of pi without computing the preceding digits its not surprising that the digits have structure. The bizarre part of this algorithm is that computes digits in hexadecimal.

    --
    Two wrongs don't make a right, but three lefts do.
    1. Re:Computing any digit of pi by cperciva · · Score: 5, Funny

      Not only that, but the five trillionth, forty trillionth, and the quadrillionth bits of Pi are all zero... I did all that work, and it all came to naught.

    2. Re:Computing any digit of pi by jfengel · · Score: 4, Informative

      I just remember that it was possible because pi was periodic in some obscure fractional base.

      I don't believe that's true. Pi is a transcendental number, which pretty much precludes it being periodic in an fractional base.

      (Assuming by "fractional" you mean "rational", the ratio of two whole numbers. Sorry to be picky; I'm just trying to be complete.)

      You can compute arbitrary digits of pi in hexadecimal (and binary and octal and any other 2^n base), but as far as I'm aware there isn't any corresponding algorithm for decimal numbers. I'm not certain it's been precluded, either, but I'm fairly certain you won't find pi to be periodic in any fractional base.

      If there does exist a proof that you can't do it in decimal, I suspect it will involve the fact that there exist fractions in base 10 that don't have terminating representations in base 16 (e.g. 1/5). That'll make it hard to apply the algorithm from base 16 back to base 10; a one-bit change in the base 16 representation will have dramatic effects all over the base 10 representation.

      (I'm not a mathematician, but I used to be, which is why this post is so maddeningly vague. I hope somebody gives you a better answer than I just did.)

    3. Re:Computing any digit of pi by coopex · · Score: 3, Informative

      The same guy came up with a new proof that allows computation in any base, check it out http://fabrice.bellard.free.fr/pi/pi_n2/pi_n2.html

      --
      The road to hell is paved with good intentions.
  3. I had great hope when clicking on the link... by Anonymous Coward · · Score: 5, Insightful

    ... but it seems a shitty research, based on the article:

    > Pi never scored less than a B on the tests, and in one case outperformed all the RNGs, which in addition to mathematical algorithms included a device that uses turbulence in a fluid as its source of randomness. But in most cases, pi lost out to at least one RNG, and in several it finished decidedly in the middle of the pack.

    Obviously. There is no reason that pi would beat every RNG out there on a sample of numbers. It should just be slightly ahead the pack (if some RNG are bad), or just in the middle (if all are good).

    > "Our work showed no correlations or patterns in pi's number set - in short, pi is indeed a good source of randomness," Fischbach said. "However, there were times when pi's performance was outdone by the RNGs."

    Well, there is a reason why mathematicians consider that statistics are not a branch of mathematic. And such article are a proof of it.

    pi output on the statistical tests were correct (if they werer not, then it would be an important news, as it would imply correlations). The fact that some other RNG generated "better" output for the (relatively) small sample they used is meaningless.

  4. Completely Unsurprised by DumbSwede · · Score: 3, Interesting
    I actually find this completely unsurprising. PI is completely UNRANDOM. It can be compressed very efficiently with the progression Pi =4 (1-1/3+1/5-1/7+1/9- ...). It is even possible to derive binary or decimal digits of PI in isolation with a formula as well. My point is that since the digits can be represented as a formula, they may completely screw up other functions expecting randomness from them. When they do I would predict there is some deeper connection between the function being tested and Pi than is realized.

    When you cite for example a deviation from a Chi distribution, then there is probably some connection between Chi and Pi that doesn't seem obvious from how Chi is calculated, but is there non-the-less.

    I am not a mathematician (though I did work at Wolfram Research for ten years). I look forward to seeing real mathematicians take on this.

    1. Re:Completely Unsurprised by crmartin · · Score: 4, Interesting

      Well, define "random". The digits of pi occur equiprobably (I believe this is proven) and so represent a random number in the usual sense.

      On the other hand, as you say, they're essentially "pseudorandom" in the sense that they can be computed by a deterministic program.

      What you're groping for here is called "Kolmogarov complexity", or sometimes "Kolmogarov- Solomonov- Chaitin complexity" which can be defined as the length in instructions for some fixed machine of the shortest program that can compute an output sequence. If, without loss of generality, we choose something like a conventional machine, you can think of this as the length of the shortest program in bits.

      What's kind of amazing about it is that there is a supremely elegant and simple proof that there are "really" random sequences in the sense that there is no program that can compute and output a sequence random sequence R that's any shorter than "print R". This is what you're looking for in the sense you're talking about "randomness".

      (The proof comes directly from the fact that there are more bit sequences of length n than there are sequences of length (n-k) for k>0. Thus there must exist sequences of length n which can't be computed by a program of length (n-k).)

      This leads to all sorts of cool stuff, including things like a unification of Gödel's Proof, Turing's Halting proof, Hilbert's Tenth Problem, and chaos theory.

      To learn more, Google for "algorithmic information theory" and "Gregory Chaitin".

    2. Re:Completely Unsurprised by Anonymous Coward · · Score: 3, Informative

      (I believe this is proven)

      Pi has not been proven normal.

      http://mathworld.wolfram.com/NormalNumber.html

  5. There must be a bug in my implementation... by exp(pi*sqrt(163)) · · Score: 3, Funny

    ...of pi. It's not random at all, I always get 3.14159....

    --
    Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  6. Re:infinitely improbable by moonbender · · Score: 3, Insightful

    As far as I have read, this has yet to be proven.

    --
    Switch back to Slashdot's D1 system.
  7. Pi experiments and random numbers by rice_burners_suck · · Score: 3, Interesting
    I would say that it's not too wise to get random digits from pi anyway, because it's too obvious a source. It's also not too difficult, what with storage and whatnot nowadays, to store about ten billion digits and then, knowing a few digits in the sequence, perform a quick pattern match, find it in pi, and know the next digit in the sequence.

    I was wondering, maybe not more than an hour ago, why not get a TV card and gather randomness from there? There are lots of channels on TV, and they have both a video and an audio component. You could set the thing up to change channels at random intervals, and gather things like the color of random pixels at random times, the frequency of random sounds, etc. Perhaps you could use a radio card to do something very similar with the radio. That, combined with entropy from the keyboard, mouse, the time between interrupts of various kinds, the contents of various processor registers or random memory locations, or whatever, should provide basically a random pool that is so random, you'll never have to worry about security problems with relation to them.

    Speaking of which, there are ten digits used in our radix 10 notation; if you want to store a character string in a strange format, you could conceivably store two digits in one byte, because four bits are enough to describe all ten digits, leaving plenty of room for things like a decimal point or a negative sign. I'm saying this because it's not too terribly expensive these days to get a terabyte of storage. If you store, on this terabyte, nothing but digits from pi, in this space-saving format I'm describing, you could store 2,417,851,639,229,258,349,412,352 digits from pi. You'd need some kind of cluster, like PI@home, to compute all those digits. Once computed, who said you can't use pattern-matching algorithms to see if there isn't some kind of pattern? I still believe that somewhere in there, there is a pattern, though it is very large. Hell, who said you can't get an exabyte of storage and do this? If anything, it could become one component in a random number generator that simply never repeats itself.

  8. Did Sagan See This? by NOLAChief · · Score: 3, Funny
    Calculate it in base 11. Eventually you'll get a sequence of zeroes and ones that when arranged into a square raster form a circle.

    Or so I'm told... :)

    1. Re:Did Sagan See This? by crmartin · · Score: 5, Interesting

      The fun thing about this is that if pi really is "normal", then if you compute long enough, you'll not only eventually find pictures of circles in base 11, you'll also find an MPEG-4 of NTS video of a hand writing, with goose-quill pen, "I exist, yours sincerely, God."

      What's worse is that somewhere else is NTS video of the same hand, writing "I don't exist after all, yours sincerely, God."

      (I leave the proof of this as an exercise for the interested student.)

    2. Re:Did Sagan See This? by KI0PX · · Score: 4, Funny

      Calculate it in base pi. After one digit, you'll get an infinite sequence of zeroes.

      10.000000......

  9. More on pi and randomness by karvind · · Score: 4, Informative
    The randomness of Pi: Frequency of the digits and Patterns appearing in the number Pi.

    ScienceNews article (2001) on Randomness of Pi's digits

    Interesting work from Johan on Testing the a-periodic randomness of and comparing it with a Quantum Mechanical source.

    But are the digits truely random ? In 1996, NERSC Chief Technologist David H. Bailey, together with Canadian mathematicians Peter Borwein and Simon Plouffe, found a new formula for pi. This formula permits one to calculate the n-th binary or hexadecimal digits of pi, without having to calculate any of the preceding n-1 digits. This formula was discovered by a computer, using Bailey's implementation of Ferguson's PSLQ algorithm

  10. Re:This just in: by g-san · · Score: 3, Funny

    you must be from Indiana...

  11. Re:infinitely improbable by Jozer99 · · Score: 3, Funny

    I wrote a Pi calculating program, that worked in base Pi. It didn't take long at all to compute pi, and it is a great source of random binary. The answer I got was "10". Now, simply take one of those digits 8 times, and you have a completely random byte.

  12. Re:infinitely improbable by keesh · · Score: 4, Informative

    Mod parent down, he needs to take a basic number theory class. It has not been proven that pi is normal. It has been proven that there are all kinds of infinite sequences which are not normal. Random is not the same as normal

  13. Re:infinitely improbable by Avenger337 · · Score: 4, Funny

    OMG!!! You mean Pi knows my SSN??? It must be a terrorist! We have to do something! (Maybe it knows where WMDs are, too)

  14. Re:Truly random by Anonymous Coward · · Score: 3, Informative

    "I was under umpression that truly random data should be completely uncomressible."

    Technically it is *chaotic* data that is not compressible. Since random data is almost always chaotic, people tend to play loose with the terminology. But random data can happen to be ordered very well, in which case you can compress it.

    "Random" is a feature of the method by which a number was created.

    "Chaos" is a feature or the number itself, regardless of how it was created.

  15. Re:infinitely improbable by Anonymous Coward · · Score: 3, Insightful

    That is a true and fun little fact, but it is nothing special to pi. You can do that with any irrational number, i.e. sqrt(2). Anyway, this story is ridiculous, noone pay attention to it. They did (from the article) 2 or 3 tests, the most significant appearing to be dividing 100 million digits into blocks of 10, plopping a decimal in the front. They then grabbed these blcoks in groups of 3 for x,y, z coordinates. They mapped these points in an imagnary cube and then graphed their distribution in the cube. From this they concluded that the other RNGs are more random. That is an extremely false conclusion. Arguing that one distribution is more random simply because it covers more of the cube or it's distrbution is more of a bell curve is just plain stupid so I really hope I missed some important fact when I read the article. Random is random and there is no rule saying that randomness is only random if it is distributed evenly or forms a bell curve (any such constraint would go against the nature of being random). Most RNGs try to distribute digits in a even manner because for cryptography purposes it is important, but is pointless when trying to deal with true sources of randomness. The fact that there is any such predefined distribution obviously shows that it isn't random (thus they are called pseudo-random), but arguing one algorithm generates a bell curve and another doesn't so the first one is better is just a dumb argument when dealing with random numbers. I hope a few mathematicians chime in and either blow my argument out of the water or confirm what I said.
    Regards,
    Steve

  16. and thus God disappears in a puff of logic by TrekkieGod · · Score: 3, Funny

    be careful what you prove next or zebra crossings might become dangerous.

    --

    Warning: Opinions known to be heavily biased.

  17. In school by gsasha · · Score: 4, Funny

    I had a teacher who insisted that Pi is exactly 3.14, and that the radiation after nuclear explosion decays by a factor of 2 in exactly 5 hours.
    Admittedly, he wasn't a math teacher though...

  18. Slightly different view.. by beldraen · · Score: 4, Insightful

    The real issue with statistics is that people who use them generally do not understand them. I get irritated with people all the time when people "prove" some statement. Statistics shows that a sample of the populace has some correlation within some bound that is likely to be true some percentage of the time. So, the real question is: what was the bound and what percentage of the time was the randomness within that bound. If PI's bound exists outside of the statistical error of the bounds of the other tests then one could say that PI is less random; however, it sounds like they indeed found a few tests where PI "beat" the other tests. In other words, the bound PI was within the statistical error of the other tests, but the computed mean was occasionally better. But, occasionally better is to be expected some percentage of the time. If it is with in that number of times, it is as you say, a meaningless conclusion. Statatics within the bounds of error are completely equal. Probability is math, but it is also just very probable that it is used wrong.

    --
    Bel, the mostly sane.. "Of course I can't see anything! I'm standing on the shoulders of idiots." -- Me
  19. Re:I'm not too suprised by Glonoinha · · Score: 5, Funny

    Even quantum physics, although theoretically 'random', is generally predictable and reliably recreatable for a large T distribution over time.
    If you want truly unpredictable, unrecreatable, random numbers - let my wife balance your checkbook.

    --
    Glonoinha the MebiByte Slayer
  20. Al-Kashi, a cool mathematician by kronocide · · Score: 5, Interesting

    I must tell you a story.

    In the first half of the 15th century the Persian mathematician Al-Kashi calculated pi to 14 places. It would be over a hundred years until a European calculated it to 9 places. But that's not what makes Al-Kashi cool, the Arabs where so much better at math in that period. What made him cool was that he stopped. He observed that, with his pi, the calculation of the circumference of a circle with a radius twice the size of Earth would have a margin of error smaller than a "horse hair" (a Persian unit). Problem solved, next problem. Meanwhile, people are still today using computers to get pi to _hundreds_of_billions_of_decimal_places!! As if there's something unique about pi because it's irrational and transcendental, when this is in fact true of the vast majority of all real numbers. Here's to Al-Kashi, a sane man and a pragmatic!

    1. Re:Al-Kashi, a cool mathematician by cryptor3 · · Score: 5, Funny

      Problem solved, next problem. ... Here's to Al-Kashi, a sane man and a pragmatic!

      Lazy bastard.

  21. Are you sure it's random? by waynemcdougall · · Score: 4, Funny

    Accounting Troll: "Over here we have our random number generator"

    Number Generator Troll: "Nine Nine Nine Nine Nine Nine"

    Dilbert: "Are you sure that's random?"

    Accounting Troll: "That's the problem with randomness: you can never be sure"

    --
    Recycle PCs and build a wireless community network www.hillsborough.org.nz
  22. Re:My crackpot PI theory by jim_deane · · Score: 3, Insightful
    A truly random number would never repeat a sequence no matter how many digits were in the sequence.


    This is untrue. The most common fallacy about random numbers is that they need to "appear" random.

    Of the list of numbers,

    734901253789
    666666666666
    123456789012

    Which is random? One answer is that all of them may be random. There is no reason why 1234 is any less random than 7305. A truly random number with infinite digits will absolutely repeat any sequence of numbers you can think of of any length whatsoever.

    Think of it this way: If you have a true random number generator, spitting out a digit every second, and you see it spit out:

    1...2...3...4...

    then can you predict what the next digit will be? If it is truely a random number generator, the answer is no, you can not. However, the next digit has a 1 in 10 chance (0..9) of being a 5, so it is possible. If you reject 1...2...3...4...5 as possible sequence, then you have instituted a rule restricting the possible outcomes of the random number generator--and have therefore reduced it's effective randomness. Rules defeat randomness, so 12345 is as valid a random number as any other sequence of five digits.

    Jim
  23. Re:infinitely improbable by Tango42 · · Score: 3, Informative

    No... 1 is one in all bases, by definition. 10 is the number of the base in all bases, again by definition. In base ten with represent ten as 10. In base pi, pi is 10.