[FoRK] low probability bits
dmorton at bitfurnace.com
Mon Feb 23 03:30:26 PST 2009
You're just not frugal enough with your random bits. Generating 32 (or 64!)
of them for every skewed bit you emit. Shame on you and your profligate
Its not like I am working on a supercomputer here.
Let me guess - your first programming language was Java, right?
On Mon, Feb 23, 2009 at 9:47 PM, Russell Turpin <russell.turpin at gmail.com>wrote:
> Y'all are working too hard.
> def genOnesToProb(p):
> while True:
> if p and random.random() <= p:
> yield 1
> yield 0
> 1s, uniformly distributed, to any desired probability p.
> FoRK mailing list
More information about the FoRK