Re: generate a huge amount of random numbers




"John Herbster" <herb-sci1_AT_sbcglobal.net> schrieb

> "Guenther Wimpassinger" <gw_spam@xxxxxxxxx> wrote
> > Let's say, I have an array of bits. With the MaxProp parameter I
> > can control how many bits of this array are set (approximately).
> > So if I pass 1 as MaxProp all bits are set in this array,
> > if I pass 0.5 nearly half of all the bits are set. So, the number
> > of bits which should be set must be controllable.
>
> Guenther, So you have 40,000 elements.
> Are your "elements" bits or DWORDs?
I have 40,000 DWords which represtens 1,280,000 (40,000*32) bits and
each bit corespon to a cloud-point.

> Apparently MaxProp is the probably
> that a bit value is set to 1.
> And you are presently doing:
> for i := 0 to high(BitsArray) do
> begin
> BitsArray[i] := $00;
> for j := 0 to 31 do
> if random < MaxProp
> then BitsArray[i] := BitsArray[i] or (1 shl j);
> end;
exactly!

> 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.

Thanks
Guenther


.



Relevant Pages

  • Re: generate a huge amount of random numbers
    ... > Guenther, I suggest that you look at the CryptGenRandom ... I have an array of bits. ... can control how many bits of this array are set. ... executed for this cloud-point. ...
    (borland.public.delphi.language.basm)
  • Re: generate a huge amount of random numbers
    ... With the MaxProp parameter I ... > can control how many bits of this array are set. ...
    (borland.public.delphi.language.basm)
  • Re: Conversion Problem
    ... > ...talking about control arrays: ... > Why does a CommandButton have an Index even if it does ... just because it may or may not be part of an array. ... Because it's a hack. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Conversion Problem
    ... ...talking about control arrays: ... Why does a CommandButton have an Index even if it does not ... because it may or may not be part of an array. ... Now being able to attach any handler of any event as long as ...
    (microsoft.public.dotnet.languages.vb)
  • Re: global warming: is it us, or is it the sun?
    ... > structure (there is no such thing as a rigid structure on that scale) get ... if you use the whole array area as transmitting ... bit of control subsystems, etc. ... The power beam would be steered via coordinating the ...
    (sci.space.policy)