[FoRK] low probability bits

Aaron Burt aaron at bavariati.org
Sun Feb 22 22:47:26 PST 2009

On Mon, Feb 23, 2009 at 12:12:37PM +1100, Damien Morton wrote:
> I need to generate a sequence of bits where Pr(1) < 0.5
> I know I can do this by generating a sequence of numbers [0,1) and testing r
> < Pr(1).
> Wondering if anyone has come across a fast way of generating a sequence of
> low-probability bits directly?

1. Google "boundary-scan".  Random bitstream generation is a high art
for VLSI and FPGA designers.

2. Take e.g the sequence 0-255, sort by sum of 1s into a table.
Generate a biased random number between 0 and 255, look up in table,
voila! 8 biased random bits.

"If you have a hammer, every problem looks like a nail.
 If you have an axe, every problem looks like HOURS OF FUN!"

More information about the FoRK mailing list