+     ebrandt
From: (Eli Brandt)
Newsgroups: sci.crypt

Subject: Re: modran(x)
Date: 25 Feb 1994 02:17:56 GMT
Organization: Harvey Mudd College, Claremont CA
Lines: 15
Message-ID: <2kjn4k$>
References: <> <2kj4is$akq@transfer.stratus.
+           com>

In article <2kj4is$>, Carl Ellison  wrote:
>For example, if ranno() were to return a number in the range 0..14 and x
>were 10, then (ranno() % x) would produce an element in [0..4] twice as
>often as an element in [5..9].  So, the distribution is not uniform.

Related problem: you often see code like  
	if (!(rand()%1000))  { ... }
, with the intent that the block be run with probability .001, which
it won't be.  It's pretty close on a 32-bit machine, but not correct.

	 PGP 2 key by finger or e-mail
"Your hideous criminal clock, your insidious time 
 bomb, is tick-tick-ticking."		-- L. Detweiler