Nonuniform PRNG?

Robert E. Beaudoin rbeaudoin at acm.org
Wed Dec 7 21:50:37 EST 2022


One thing you could do is to apply von Neumann de-biasing to convert a
string of output bits from your biased PRNG to an unbiased string, and
test the de-biased output.  If such tests pass I don't know that you
can be satisfied thaty your biased PRNG is close to a theorieical
biased random bit stream, but if they fail that should indicate a
problem.

Robert E. Beaudoin


On Wed, 7 Dec 2022 11:05:53 -0500
David Lowry-Duda <david at lowryduda.com> wrote:

> Inspired by the recent thread about pseudorandom number generators on 
> python-ideas (where I also mistakenly first wrote this message), 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




More information about the Python-list mailing list