[40340] in cryptography@c2.net mail archive

home help back first fref pref prev next nref lref last post

correction to uniformly random selection algorithms

daemon@ATHENA.MIT.EDU (Travis H.)
Sun Sep 3 23:51:41 2006

X-Original-To: cryptography@metzdowd.com
X-Original-To: cryptography@metzdowd.com
Date: Sat, 2 Sep 2006 22:29:39 -0500
From: "Travis H." <solinym@gmail.com>
To: Cryptography <cryptography@metzdowd.com>

I just realized I made a small error in algorithm 2.

On 9/2/06, Travis H. <solinym@gmail.com> wrote:
> 2. This algorithm seems to waste fewer bits:
>
> Initialize with c = 0.
> x = extraction of n bits

That should read:
x = extraction of ceil(lg(p-c)) bits

Otherwise there's nothing gained by
carrying the remainder c.
-- 
"If you're not part of the solution, you're part of the precipitate."
Unix "guru" for rent or hire -><- http://www.lightconsulting.com/~travis/
GPG fingerprint: 9D3F 395A DAC5 5CCC 9066  151D 0A6B 4098 0C55 1484

---------------------------------------------------------------------
The Cryptography Mailing List
Unsubscribe by sending "unsubscribe cryptography" to majordomo@metzdowd.com

home help back first fref pref prev next nref lref last post