number generator

Hendrik van Rooyen mail at microcorp.co.za
Wed Mar 14 03:44:24 EDT 2007


"Gabriel Genellina" <ga...l-py2 at yahoo.com.ar> wrote:

>You can't have two different sets with four equal numbers - it's not a
>very difficult thing, it's impossible to distinguish because they're
>identical!
>Given 4 numbers in the set, the 5th is uniquely determined. By example:
>12, 3, 10, 18 *must* end with 7. The 5th number is not "random". Any
>randomness analysis should include only the first 4 numbers (or any other
>set of 4).
>In other words, there are only 4 degrees of freedom. In the fence analogy,
>you only have to choose where to place 4 poles; the 5th is fixed at the
>end.

Yes - the requirement of "5 random numbers" is in a sense in conflict
with the requirement of "that add up to 50" - because for the fifth number,
given that you have chosen the other 4, you have to "get lucky" and
choose the "right one" if you are doing it randomly...

What my question was about was whether some sort of cluster
analysis applied to the results of repeated application of two algorithms
would reveal the way in which the numbers were chosen - the first one being
choose five numbers, see if they add up to 50, repeat if not, repeat till say
1000 samples generated, and the second being choose four numbers,
see if they add to less than 50, repeat if not, else make the fifth the
difference
between the sum and 50, repeat till 1000 instances generated...

Intuitively, the second one will run a LOT faster, all other things being equal,
and I was simply wondering if one could tell the difference afterwards -
in the first case all the numbers clearly come from the same population,
while in the second case four of them do, and the fifth could possibly
be from a different population, as it was "forced" to make up the difference.

So I am not so very sure that the set of fifth numbers of the second run
would actually be indistinguishable from that of the first.

- Hendrik







More information about the Python-list mailing list