Any "random" algorithm is broken over a sufficiently large data set. That is the basis behind Chaos Theory. Random events or data are not very random if you take a large enough data set.

I'm not sure I even understand those statements...

Firstly, by saying, "any 'random' algorithm is broken over a sufficiently large data set" are you implying that said algorithm is not broken over a smaller data set? Perhaps you got the phrasing backward and you meant that any such algorithm is broken over a smaller data set. Afterall, in the case of unique IDs, a smaller data set will be more likely to result in a duplicate ID than a large one. In any case, though, it's the reliance on randomness that breaks it, not the size of the data set.

Secondly, saying "random events or data are not very random if you take a large enough data set" doesn't make any sense at all. Randomness has nothing to do with the size of the data set¹. It has everything to do with predictability. If you have a function which randomly returns either 0 or 1 then you can choose numbers between 0 and 2**9876543210 - 1 with no loss or gain of randomness.

Finally, I don't see how any of this has anything to do with Chaos Theory. CT is concerned with deterministic processes where minute (even immeasurably so) differences in initial conditions can result in very different final states. The theory explains how apparent randomness can be observed even in very well-understood determistic systems.

It all boils down to what you consider to be acceptably "broken" and what your exposure is.

My point was that using randomness for generating unique IDs should not be recommended. There are ways to do it that aren't broken. Why concern yourself with using statistical analysis to determine how likely it is your program will fail when you can avoid failure altogether?

1. Well, almost nothing. Nothing for data sets with at least two elements you can choose. In other words, if you can only make one choice, you can't make it "randomly."

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re^2: Randomness by sauoq
in thread Use time() to create unique ID by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.