[Terry Jones]
> The code below uses a RNG with period 5, is deterministic, and has one
> initial state. It produces 20 different outcomes.

Well, I'd call the sequence of 20 numbers it produces one outcome.
>From that view, there are at most 5 outcomes it can produce (at most 5
distinct 20-number sequences).  In much the same way, there are at
most P distinct infinite sequences this can produce, if the PRNG used
by random.random() has period P:

def belch():
    import random, math
    start = random.random()
    i = 0
    while True:
        i += 1
        yield math.fmod(i * start, 1.0)

The trick is to define "outcome" in such a way that the original claim
is true :-)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to