Inspired by the recent thread on PRNG, I began to wonder: suppose that I had a pseudorandom number generator that attempted to generate a nonuniform distribution. Suppose for instance that it was to generate a 0 bit 2/3 of the time, and a 1 bit 1/3 of the time. How would one go about testing this PRNG against an idealized (similarly biased) PRNG? - DLD
I'm very sorry, I didn't meant to post this to python-ideas. I didn't pay enough attention. I'm sending the same thing to the regular python list. On Wed, Dec 07, 2022 at 11:03:24AM -0500, David Lowry-Duda wrote:
Inspired by the recent thread on PRNG, I began to wonder: suppose that I had a pseudorandom number generator that attempted to generate a nonuniform distribution. Suppose for instance that it was to generate a 0 bit 2/3 of the time, and a 1 bit 1/3 of the time.
How would one go about testing this PRNG against an idealized (similarly biased) PRNG?
- DLD
How do I join the “regular” Python list? I’m not academically qualified for
python ideas
On Wed, Dec 7, 2022 at 10:05 AM David Lowry-Duda
I'm very sorry, I didn't meant to post this to python-ideas. I didn't pay enough attention. I'm sending the same thing to the regular python list.
On Wed, Dec 07, 2022 at 11:03:24AM -0500, David Lowry-Duda wrote:
Inspired by the recent thread on PRNG, I began to wonder: suppose that I had a pseudorandom number generator that attempted to generate a nonuniform distribution. Suppose for instance that it was to generate a 0 bit 2/3 of the time, and a 1 bit 1/3 of the time.
How would one go about testing this PRNG against an idealized (similarly biased) PRNG?
- DLD
Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/5C6XQA... Code of Conduct: http://python.org/psf/codeofconduct/
-- Truth causes consequences; consequences bring pain; pain exorcises guilt!
I suspect you wouldn't have to test it all, as it would simply be a trivial
redistribution of a standard (already known-good) generator:
def random_bit_666():
return int(random() > 2/3)
For other more sophisticated distributions, again simply verify that your
distribution algorithm is correct and let some library function take care
of the randomness.
On Wed, Dec 7, 2022 at 8:23 AM David Lowry-Duda
Inspired by the recent thread on PRNG, I began to wonder: suppose that I had a pseudorandom number generator that attempted to generate a nonuniform distribution. Suppose for instance that it was to generate a 0 bit 2/3 of the time, and a 1 bit 1/3 of the time.
How would one go about testing this PRNG against an idealized (similarly biased) PRNG?
- DLD _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/YOK7YR... Code of Conduct: http://python.org/psf/codeofconduct/
participants (4)
-
Barry
-
David Lowry-Duda
-
Eric Fahlgren
-
James Johnson