Re: generate a huge amount of random numbers



Hi Guenther,

>> You could fill your array with the required number
>> of one bit values and then do some shuffling of
>> both words, bytes, and bits. Regards, JohnH
> Maybe thats an idea, I will use the weekend to think
> about it.

You could do what John suggested, and then randomly xor all the dwords with
values that have an equal number of 0 and 1 bits. By doing so you will not
change the number of 1 bits, but if your xor process is sufficiently random
you should get a reasonably random progression of 0's and 1's with the
number of 1 bits exactly matching your predefined probability.

The downsize is that your probability for a 1 can only be a multiple of
1/32.

Regards,
Pierre


.



Relevant Pages

  • Quantum Gravity 214.0: Lubos Motl on QG Myth "Gravity May Be Classical"
    ... list and description of "myths" in Quantum Gravity, ... to say he regards that as a myth. ... His basic argument is that QM involves probabilities and probability ... "Myth", because it turns out from my viewpoint that the Myth is on the ...
    (sci.physics)
  • Re: The universe looks designed to me
    ... On Thu, 08 Sep 2005, Wall of Sleep wrote: ... > What I'm getting is a series of "we don't knows" in regards to the ... > probability that natural processes are the sole cause of life as we ...
    (talk.origins)
  • Re: The Harem-problem
    ... Your formula seems to hold against the values I calculated with this simulator. ... Regards, ... I started solving this probability problem but never found a closed ... Anyway, I assumed n women, each with a monthly cycle of t days, with each woman unavailable for a block of b consecutive days within that cycle, the blocks being uniformly randomly distributed. ...
    (sci.math)
  • Re: Probability
    ... Regards, ... > Here's my attempt, but I'm no mathamatician... ... > that they will pick a number nobody else has as they are the first. ... > second person has a probability of 99/100 that they will pick another ...
    (microsoft.public.excel)